Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp23196690rwd; Fri, 30 Jun 2023 20:29:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlE4xHP/3T4A6LjsH/V4Or2IuI6ScNz57kTh4ebzrg7CUJ6Nd+ZH34KSgF6Kli1hLCqHsPPY X-Received: by 2002:a25:278a:0:b0:bcf:b219:7919 with SMTP id n132-20020a25278a000000b00bcfb2197919mr4216092ybn.44.1688182191491; Fri, 30 Jun 2023 20:29:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688182191; cv=none; d=google.com; s=arc-20160816; b=w2AC8092FXrFMuu1FHXEi+bDYNXVufhFZeqBBSCt7soHgj+x6uZgZGL40GgzsX863y uyzk6l57OzkJxS8m2I0R0i/gxJElTTAiLPf9ffLUgz68sbUcGAxZsksUvfgBvv0B84XN n19Va0bG6rkN7HvgReV5x0sb6ZIXudYEpVvjauUFPIESa6rNaiv1WdgfC+EDWBxzZGoT CciRbOtf0sI0F3UG+KcXm4XC1p4x5ETwVQEbZtKHNcw1pRljoWeBi2rgwcnBj059L+Gl T1B2D39xPTKsEfJImrEPURCEFkybNWDbSLkX89akMeY3tv88QYlF3QbzaicMK5d5y5N7 wrtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=8dLNprRkNIxnmx7sXCJmcalmskFOVN/B6DzwH8freQQ=; fh=dh8WL/04x9LN41GJIgSYakBykExaKphENag0f3dKS+o=; b=upQtflHGeg0J8elGgL97qv3g4NmAKotKeFZtSBsm8gOPFyrjuuS94pT5fP/KmIMQNh eATjg1d2IJKH5/Vq+KQJB/vWFaL2hrqnYksGRzBDaGN1gyWeZ+LsqFDZM0Qyt+klsKTc WtM4N84eo8VGUizVevKPM8cXVfs0id/QtlOY4/ql+jlbYsi6aCoNrJR9LEc0Wo4vW0Qb jrCPfUVsSp+FMa+2Ytmq8o1IDA+OGw2eQXMvs8d4TfAZQB9EAMcz4nEquNxwDyZiHLlU JbFGynFNw/MYXw+rhhmU7cNO7P+yKma/hIEnX6oPWHv74Zq5pvkgjQrwYklYLl0HVTrH K11g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w18-20020a634912000000b00542d69c515bsi13380895pga.533.2023.06.30.20.29.37; Fri, 30 Jun 2023 20:29:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229747AbjGAD1B (ORCPT + 99 others); Fri, 30 Jun 2023 23:27:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbjGAD0r (ORCPT ); Fri, 30 Jun 2023 23:26:47 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08AF144A2 for ; Fri, 30 Jun 2023 19:57:53 -0700 (PDT) Received: from kwepemm600020.china.huawei.com (unknown [172.30.72.55]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4QtGyl2VkBzLn1h; Sat, 1 Jul 2023 10:55:43 +0800 (CST) Received: from [10.174.179.160] (10.174.179.160) by kwepemm600020.china.huawei.com (7.193.23.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Sat, 1 Jul 2023 10:57:50 +0800 Message-ID: <530c0778-577d-2476-24f4-612e80551d21@huawei.com> Date: Sat, 1 Jul 2023 10:57:50 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 1/2] mm: remove page_rmapping() Content-Language: en-US To: Sidhartha Kumar , , CC: , , , References: <20230630121310.165700-1-zhangpeng362@huawei.com> <20230630121310.165700-2-zhangpeng362@huawei.com> From: "zhangpeng (AS)" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.160] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600020.china.huawei.com (7.193.23.147) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/7/1 0:03, Sidhartha Kumar wrote: > On 6/30/23 5:13 AM, Peng Zhang wrote: >> From: ZhangPeng >> >> After converting the last user to folio_raw_mapping(), we can safely >> remove the function. >> >> Signed-off-by: ZhangPeng >> --- >>   include/linux/mm.h | 1 - >>   mm/memory.c        | 2 +- >>   mm/util.c          | 6 ------ >>   3 files changed, 1 insertion(+), 8 deletions(-) >> >> diff --git a/include/linux/mm.h b/include/linux/mm.h >> index 9ecb8b9c07f6..8c7eba7370b2 100644 >> --- a/include/linux/mm.h >> +++ b/include/linux/mm.h >> @@ -2129,7 +2129,6 @@ static inline void *folio_address(const struct >> folio *folio) >>       return page_address(&folio->page); >>   } >>   -extern void *page_rmapping(struct page *page); >>   extern pgoff_t __page_file_index(struct page *page); >>     /* >> diff --git a/mm/memory.c b/mm/memory.c >> index 21fab2727209..6921df44a99f 100644 >> --- a/mm/memory.c >> +++ b/mm/memory.c >> @@ -2979,7 +2979,7 @@ static vm_fault_t >> fault_dirty_shared_page(struct vm_fault *vmf) >>        * pinned by vma->vm_file's reference.  We rely on unlock_page()'s >>        * release semantics to prevent the compiler from undoing this >> copying. >>        */ > > >     struct page *page = vmf->page; > >     ... > >     dirtied = set_page_dirty(page); >     VM_BUG_ON_PAGE(PageAnon(page), page); > > Can this earlier part of the function be converted to folios so a > folio can be passed directly in folio_raw_mapping()? Thanks for your feedback. I convert the last user to use a folio in patch 2. I'll reverse the order of the two patches. Best Regards, Peng >> -    mapping = page_rmapping(page); >> +    mapping = folio_raw_mapping(page_folio(page)); >>       unlock_page(page); >>         if (!page_mkwrite) >> diff --git a/mm/util.c b/mm/util.c >> index dd12b9531ac4..5e9305189c3f 100644 >> --- a/mm/util.c >> +++ b/mm/util.c >> @@ -734,12 +734,6 @@ void *vcalloc(size_t n, size_t size) >>   } >>   EXPORT_SYMBOL(vcalloc); >>   -/* Neutral page->mapping pointer to address_space or anon_vma or >> other */ >> -void *page_rmapping(struct page *page) >> -{ >> -    return folio_raw_mapping(page_folio(page)); >> -} >> - >>   struct anon_vma *folio_anon_vma(struct folio *folio) >>   { >>       unsigned long mapping = (unsigned long)folio->mapping; >