Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp896490rdf; Fri, 3 Nov 2023 20:56:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEsrCADXuc1slTO7jdADYIPnTIdsKr7ZY8TSqFeKgv3T8iHSrrYo+10G2GOgpgO+FfQgfBp X-Received: by 2002:a05:6a20:3c86:b0:15d:b407:b0a0 with SMTP id b6-20020a056a203c8600b0015db407b0a0mr5901916pzj.26.1699070216350; Fri, 03 Nov 2023 20:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1699070216; cv=none; d=google.com; s=arc-20160816; b=SM8iMj2XjwMbMd39SUODHbaD0X0iaH/aA4wgo7BMA2qO8qi+vr3mxpcdQD4qQjad1f p5zxPBIzqxYSl24yw35NQFVcp4bYAvcDOo4620lq89Dvg1ggMUUepbkd41v2c/tR8iy5 xjY9u9nyyKJEF4eQse6pn3sNi1bb5z/NnWeR9MVBDAjnmct9cxTqjV1UUQhraNHdRVgA hrLYhEBUmlGmAJmSx4rMm1HVA2D26BJjgmLX7xReef48wVh73jRb6dgfew6Z6IsJ6shE oWiw6KjAGistZAxAPpoC8Ruukp+1fY55JJEOkrYXO/rtjrwadifVgANo2wIBekksOCow sTBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=DR0NwF5aoEPfBIrGPy27I4jQhGFlovTU4h4vQaXGQfk=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=d/sYwjr41PmT0N/JwKh4s83PitL1sTifBH4B560POaaRO3d9hzlDf1fAy21WhhL2pD +pRKiKlBKZJSS8ymG7WUV2HYrSG7srqnw1bGvtnifZc/LqV9VokncX3dn7bX6rOvd0L1 TJNDV6pf2F+V7uvedo/Xrq34KATfWwoo+o3xFpaGBUpdBWqe56bekgpxA23qmVzlSTdV zaLa65FlmGCQn8tKc1wAoVicjESC+kM+xS62nG2UneMAuLu0k5EMeEcsvuKmylEJ7M6C 2q28cmObXUE8NgWC9f0gZnNgRlHwfaQ+PDyIXI4RvbR+te8gZhqJ6oGTbnSSqW86E2BC ZmfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id s9-20020a656449000000b005b92d40e118si2992280pgv.309.2023.11.03.20.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Nov 2023 20:56:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 763DF804C210; Fri, 3 Nov 2023 20:56:13 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378029AbjKDD4L (ORCPT + 99 others); Fri, 3 Nov 2023 23:56:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbjKDDzs (ORCPT ); Fri, 3 Nov 2023 23:55:48 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CFBD53; Fri, 3 Nov 2023 20:55:45 -0700 (PDT) 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 To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang 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: 7BIT Content-Type: text/plain; charset=US-ASCII 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 03 Nov 2023 20:56:13 -0700 (PDT) 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 --- mm/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; /* -- 2.27.0