linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: 21cnbao@gmail.com, david@redhat.com
Cc: Liam.Howlett@oracle.com, akpm@linux-foundation.org,
	baolin.wang@linux.alibaba.com, bhe@redhat.com, chrisl@kernel.org,
	fan.ni@samsung.com, harry.yoo@oracle.com, kasong@tencent.com,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	lorenzo.stoakes@oracle.com, mhocko@suse.com, riel@surriel.com,
	rppt@kernel.org, ryan.roberts@arm.com, schatzberg.dan@gmail.com,
	surenb@google.com, v-songbaohua@oppo.com, vbabka@suse.cz,
	yukaixiong@huawei.com, zhengtangquan@oppo.com
Subject: Re: [PATCH RFC] mm: make try_to_unmap_one support batched unmap for anon large folios
Date: Fri, 23 May 2025 20:25:17 +1200	[thread overview]
Message-ID: <20250523082517.3144-1-21cnbao@gmail.com> (raw)
In-Reply-To: <20250513084620.58231-1-21cnbao@gmail.com>

> @@ -2159,9 +2179,10 @@ static bool try_to_unmap_one(struct folio *folio, struct vm_area_struct *vma,
> 
> 			/* See folio_try_share_anon_rmap(): clear PTE first. */
>  			if (anon_exclusive &&
> -			    folio_try_share_anon_rmap_pte(folio, subpage)) {
> -				swap_free(entry);
> -				set_pte_at(mm, address, pvmw.pte, pteval);
> +			    __folio_try_share_anon_rmap(folio, subpage, nr_pages,
> +							RMAP_LEVEL_PTE)) {


I have a question for David regarding the __folio_try_share_anon_rmap()  
function. I noticed that it only clears the Exclusive flag for the first  
subpage, even when nr_pages > 1. Shouldn't we be clearing the Exclusive  
flag for all subpages in this case? Could this be a potential bug?

Thanks
Barry


      parent reply	other threads:[~2025-05-23  8:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-13  8:46 Barry Song
2025-05-14  7:56 ` Dev Jain
2025-05-15  1:38   ` Barry Song
2025-05-14  8:11 ` Baolin Wang
2025-05-15  1:35   ` Barry Song
2025-05-15  3:40     ` Baolin Wang
2025-05-23  8:25 ` Barry Song [this message]

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=20250523082517.3144-1-21cnbao@gmail.com \
    --to=21cnbao@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bhe@redhat.com \
    --cc=chrisl@kernel.org \
    --cc=david@redhat.com \
    --cc=fan.ni@samsung.com \
    --cc=harry.yoo@oracle.com \
    --cc=kasong@tencent.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=mhocko@suse.com \
    --cc=riel@surriel.com \
    --cc=rppt@kernel.org \
    --cc=ryan.roberts@arm.com \
    --cc=schatzberg.dan@gmail.com \
    --cc=surenb@google.com \
    --cc=v-songbaohua@oppo.com \
    --cc=vbabka@suse.cz \
    --cc=yukaixiong@huawei.com \
    --cc=zhengtangquan@oppo.com \
    /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