Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2215251rdf; Mon, 6 Nov 2023 07:51:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IHzc/JSjanVMytpIXZNF0Jy4DmQQJiz5K2gyAFgF88EfuXnaMZsZCoaF/zpcAMEg6//ljoQ X-Received: by 2002:a17:90a:f2d4:b0:27c:f845:3e3f with SMTP id gt20-20020a17090af2d400b0027cf8453e3fmr28496381pjb.1.1699285885340; Mon, 06 Nov 2023 07:51:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699285885; cv=none; d=google.com; s=arc-20160816; b=QPKH4u36Twxpng/7/czG4vGly0pT6r/ZToMo61ZsOIAbxBhIM4nICeBf+abNwX0XFl 0pvHPS6rVblnhqCKWruZNCF+yJY0lKkqQI/5e3GsCIyuSFAEdyOJL1DSMe/zjK196IWY 0rWM19SiFJpNJSYl3GmAHr/+F7HSxprtCPTHFpdiwo3OmN+GtD/o3P7zjQKsNy/L4gsk RMBJKqxcYeFd2vVUNrbHgJhgwxl/uYl+Leqi4NhIRsruZeJCBsIQvxpQkqEpjB5cE+ZV z0Cm37BLFb6CeR9dRlNbs+Mo7FWCyCtePZb5QrUNRu6VKRzMM2n7JiB4WnvC26KupDH7 9cJQ== 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=PXinfkgX9Mk6qMgnf/9ujGJB/UjAvuMExZucM1FxJLU=; fh=kUj/5waaepfljbNx30rj2BALdV0u/mUCTaFWThlgquQ=; b=cpti+NJAjT6QHnzvH5p45qbfTZeFFHB3YD/kApRy1x/iBU0lfcmA8ByMuEeFA9bauU NFZl+YSm1t/xyxa6ml8z6ZEehySfRvspCKQfEpOBgdu2r7q6pYFeSUvKx4C/dH9v1aoV O27RqEzQVPLmKDkQpEysNFQwlrNtNksLa+3mHPGRJheCNYdWdk8M+jAuksrrsNFfdT3L 10Uq/HhI2GlNrUAilH7eiND4ppAEoP3pDW4PXo8ZvV8hGvOtw4VGkaaqssFPqedq5PCL u49a2RH6egyInOfs5WEqyQMbuZg4hEx63QHEe90+ug8GdvKISqiSYexjRLUq3L/XnmT+ RmAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id gt4-20020a17090af2c400b0027ced8e1837si8023359pjb.180.2023.11.06.07.51.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 07:51:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id ED0B280B87E8; Mon, 6 Nov 2023 07:51:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232856AbjKFPuX (ORCPT + 99 others); Mon, 6 Nov 2023 10:50:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232346AbjKFPuH (ORCPT ); Mon, 6 Nov 2023 10:50:07 -0500 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56BF7118; Mon, 6 Nov 2023 07:50:04 -0800 (PST) Received: from dggpemm100001.china.huawei.com (unknown [172.30.72.53]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4SPFzz4mWdzMmWr; Mon, 6 Nov 2023 23:45:35 +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; Mon, 6 Nov 2023 23:50:01 +0800 From: Kefeng Wang To: Andrew Morton CC: , , Matthew Wilcox , David Hildenbrand , , Kefeng Wang Subject: [PATCH 07/10] mm: memory: use a folio in do_set_pmd() Date: Mon, 6 Nov 2023 23:49:47 +0800 Message-ID: <20231106154950.3399469-8-wangkefeng.wang@huawei.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20231106154950.3399469-1-wangkefeng.wang@huawei.com> References: <20231106154950.3399469-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: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm100001.china.huawei.com (7.185.36.93) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 06 Nov 2023 07:51:15 -0800 (PST) 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 669f167f45cd..fbed32a09fec 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4322,12 +4322,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