Message ID | 20231104035522.2418660-8-wangkefeng.wang@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 623AEC4332F for <linux-mm@archiver.kernel.org>; Sat, 4 Nov 2023 03:56:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 07B948D00DA; Fri, 3 Nov 2023 23:56:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 004218D00D5; Fri, 3 Nov 2023 23:56:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E0E648D00DA; Fri, 3 Nov 2023 23:56:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id CE9848D00D5 for <linux-mm@kvack.org>; Fri, 3 Nov 2023 23:56:26 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id A9685C0EB8 for <linux-mm@kvack.org>; Sat, 4 Nov 2023 03:56:26 +0000 (UTC) X-FDA: 81418909572.30.00DE53A Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf25.hostedemail.com (Postfix) with ESMTP id 07BA9A0010 for <linux-mm@kvack.org>; Sat, 4 Nov 2023 03:56:20 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699070184; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DR0NwF5aoEPfBIrGPy27I4jQhGFlovTU4h4vQaXGQfk=; b=IjB+6xATQUA+1Bc7ospYbCZLcPi5uB1t7trwSZRu/Q47Nua8Q9xlJlRsmfTGRMbvhl4Lul laouATdj0LPzxULVLb9z0jvq5CVjAO8BD6T63PhJK1WB8dHz4oiYz0MLsZaMbsgOvxfQcU QaJM89xSAf5OHCDObv+1KckleuqMNDI= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699070184; a=rsa-sha256; cv=none; b=vN26yaiDWK4sHsChYliYw4HIeYlp+sQYQSGnFxl63z0HcsyYg1t7g2xmxwTbrICTdD/LUm AmS0cCZu1JCBRrJdconmu4jH9UbW1FC92fsED7zCf/20IGFnQ2ry+QI7u84Fh7lNnyGjdL CMyiZfhV86HCuuon3qqUSzR7hVrQWGw= Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SMkKl453TzvQCR; Sat, 4 Nov 2023 11:55:39 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm100001.china.huawei.com (7.185.36.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Sat, 4 Nov 2023 11:55:43 +0800 From: Kefeng Wang <wangkefeng.wang@huawei.com> To: Andrew Morton <akpm@linux-foundation.org> CC: <linux-kernel@vger.kernel.org>, <linux-mm@kvack.org>, Matthew Wilcox <willy@infradead.org>, David Hildenbrand <david@redhat.com>, <linux-s390@vger.kernel.org>, Kefeng Wang <wangkefeng.wang@huawei.com> Subject: [PATCH v2 07/10] mm: memory: use a folio in do_set_pmd() Date: Sat, 4 Nov 2023 11:55:19 +0800 Message-ID: <20231104035522.2418660-8-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231104035522.2418660-1-wangkefeng.wang@huawei.com> References: <20231104035522.2418660-1-wangkefeng.wang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Rspam-User: X-Stat-Signature: aw3pycf7kiriu1uyt3p53wqwdhwug8pr X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 07BA9A0010 X-HE-Tag: 1699070180-488971 X-HE-Meta: U2FsdGVkX1/wImwUfND8Nn9PBssyfB7Sv9NQAbP/7YR3ims05Tt2rT4pVdsoWabgMtovLFuHDczUg2WF1diY17uVDTcJE+OPtmd4aN2GzkfmuZ/zwaaxukJiJwUCu44ZitldmwvUNHDenzXC5q2CUfRNYjTlJO+ir9h0PMTMhcA76KBTneGOFzSa9r5NonQu+aVxBNn/2AG4pIu9fgt8OmR/HkxrQZNOpkNYZPTFcB4RddVA/FU52q0kAa8Wef5gQmCs6qPZS1gaBpnWbof6i3G1eqqr7SRpFoYmDDTazP8/4sm5OdXCqwcwHGIKQoqNrx6sfqa/AlKd/J/2770sRbSiNbM+HZvmff2guX+W5SZaaq86zW/bGetB0Da6ao1O+rcb5kBN0NA7wCwCy9E5fbXJQkBvDPwcg+SBDmohF65TFRXTmIL9YkV7/0xF+sjQPBsy/U1jnLWXSiSjbrqiHmX/xSpTtKDbSFemFYzbYGv1x0uF0xw7d+g/MSJvjyyJYnvO2fcPWaEUsHxqDAGbNCZycKYGV+UcnJzqZlR9p+/OS99tqYe6a2x6xmCU3emCrpbSR0zg8LOeO9mSY7BSdO5LxfXed73dvW9V/6eA+5TF6QPDLsDHfyIFvzaX/HwOM7qbRrLDyGymlzs7vN8xFCVwUb8QLV8lAEgrWT3YkpFwm0cQj0G7gC3rv6ejcRMg+PBA/u6ApIXeGmW86Puzb7ltbkBWqKCd7KpOr095YG8IFnWxyF2cQOfIAMnziZxmzrfOODatVbruZqBPZYcUv85a56AcuSnvfXoC60xqr/YAAhTxKYh4pXh6PZ4OaACln8LwYE8T8UE7+wbqheBujhjwZRUsS0c3bJMnuW0mPbnYawSVSUoH+o4GeZ9F7kxlrZQQe7TesxrCVHg1UXIttz8JgI0cyTbIM9pw83XhBy3gKzNwAikaDxJWwqVv0UMLfsbavk298vOq8rcoW85 QectSVpR DjDuhtqc+f9xKtUVVOT7ViPBCMhVtNBhIxjc80GhC4oOqbToegzvOxVQwyg0PQgNftcwcb2KQ77GT2GgAFjalus4Jcpj39gfU4FxpHDhwEWhD5JyEvObqpVKGL3fwO8H021THZOvksQbNDnKeJ9iEvkzCa4WdfhCrvjZNaM+hStVfxdXgtXgAvj6o/rxzjRIGy6Tt X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: convert mm counter to take a folio
|
expand
|
diff --git a/mm/memory.c b/mm/memory.c index 806568f9605b..ac247850919a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4318,12 +4318,13 @@ vm_fault_t do_set_pmd(struct vm_fault *vmf, struct page *page) unsigned long haddr = vmf->address & HPAGE_PMD_MASK; pmd_t entry; vm_fault_t ret = VM_FAULT_FALLBACK; + struct folio *folio; if (!transhuge_vma_suitable(vma, haddr)) return ret; - page = compound_head(page); - if (compound_order(page) != HPAGE_PMD_ORDER) + folio = page_folio(page); + if (folio_order(folio) != HPAGE_PMD_ORDER) return ret; /*
Use a folio in do_set_pmd(), which is a preparetion for converting mm counter functions to take a folio. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> --- mm/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)