linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "zhangpeng (AS)" <zhangpeng362@huawei.com>
To: Sidhartha Kumar <sidhartha.kumar@oracle.com>,
	<linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Cc: <willy@infradead.org>, <akpm@linux-foundation.org>,
	<wangkefeng.wang@huawei.com>, <sunnanyong@huawei.com>
Subject: Re: [PATCH 1/2] mm: remove page_rmapping()
Date: Sat, 1 Jul 2023 10:57:50 +0800	[thread overview]
Message-ID: <530c0778-577d-2476-24f4-612e80551d21@huawei.com> (raw)
In-Reply-To: <b235b65b-3b1d-9d97-5461-b5a2ed4dfccc@oracle.com>

On 2023/7/1 0:03, Sidhartha Kumar wrote:

> On 6/30/23 5:13 AM, Peng Zhang wrote:
>> From: ZhangPeng <zhangpeng362@huawei.com>
>>
>> After converting the last user to folio_raw_mapping(), we can safely
>> remove the function.
>>
>> Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
>> ---
>>   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;
>


  reply	other threads:[~2023-07-01  2:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-30 12:13 [PATCH 0/2] " Peng Zhang
2023-06-30 12:13 ` [PATCH 1/2] " Peng Zhang
2023-06-30 15:56   ` Sidhartha Kumar
2023-06-30 16:03   ` Sidhartha Kumar
2023-07-01  2:57     ` zhangpeng (AS) [this message]
2023-06-30 12:13 ` [PATCH 2/2] mm: use a folio in fault_dirty_shared_page() Peng Zhang
2023-06-30 15:58   ` Sidhartha Kumar
2023-06-30 21:39 ` [PATCH 0/2] mm: remove page_rmapping() Matthew Wilcox
2023-07-01  2:57   ` zhangpeng (AS)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=530c0778-577d-2476-24f4-612e80551d21@huawei.com \
    --to=zhangpeng362@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sidhartha.kumar@oracle.com \
    --cc=sunnanyong@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox