From: David Hildenbrand <david@redhat.com>
To: Wei Yang <richard.weiyang@gmail.com>,
akpm@linux-foundation.org, lorenzo.stoakes@oracle.com,
riel@surriel.com, Liam.Howlett@oracle.com, vbabka@suse.cz,
harry.yoo@oracle.com
Cc: linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm/rmap: not necessary to mask off FOLIO_PAGES_MAPPED
Date: Sat, 16 Aug 2025 08:29:40 +0200 [thread overview]
Message-ID: <601ff999-6a3d-4010-b316-6b4b294b5417@redhat.com> (raw)
In-Reply-To: <20250815084943.23063-2-richard.weiyang@gmail.com>
On 15.08.25 10:49, Wei Yang wrote:
> At this point, we are sure (nr < ENTIRELY_MAPPED). This means the upper
> bits are already cleared.
>
> Not necessary to mask off it.
>
> Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
> Cc: Rik van Riel <riel@surriel.com>
> Cc: Liam R. Howlett <Liam.Howlett@oracle.com>
> Cc: Vlastimil Babka <vbabka@suse.cz>
> Cc: Harry Yoo <harry.yoo@oracle.com>
> ---
> mm/rmap.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/rmap.c b/mm/rmap.c
> index 1c5988dbd1e7..a927437a56c2 100644
> --- a/mm/rmap.c
> +++ b/mm/rmap.c
> @@ -1749,7 +1749,7 @@ static __always_inline void __folio_remove_rmap(struct folio *folio,
> nr_pages = folio_large_nr_pages(folio);
> if (level == PGTABLE_LEVEL_PMD)
> nr_pmdmapped = nr_pages;
> - nr = nr_pages - (nr & FOLIO_PAGES_MAPPED);
> + nr = nr_pages - nr;
> /* Raced ahead of another remove and an add? */
> if (unlikely(nr < 0))
> nr = 0;
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers
David / dhildenb
next prev parent reply other threads:[~2025-08-16 6:29 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-15 8:49 [PATCH 0/3] mm/rmap: small cleanup for __folio_remove_rmap() Wei Yang
2025-08-15 8:49 ` [PATCH 1/3] mm/rmap: not necessary to mask off FOLIO_PAGES_MAPPED Wei Yang
2025-08-15 9:38 ` Lorenzo Stoakes
2025-08-16 0:33 ` Wei Yang
2025-08-16 6:29 ` David Hildenbrand [this message]
2025-08-15 8:49 ` [PATCH 2/3] mm/rmap: could be partially_mapped only after no entire map Wei Yang
2025-08-15 10:08 ` Lorenzo Stoakes
2025-08-16 6:31 ` David Hildenbrand
2025-08-16 9:06 ` Wei Yang
2025-08-16 9:16 ` David Hildenbrand
2025-08-16 10:05 ` Giorgi Tchankvetadze
2025-08-16 10:32 ` David Hildenbrand
2025-08-16 14:03 ` Wei Yang
2025-08-15 8:49 ` [PATCH 3/3] mm/rmap: use folio_large_nr_pages() when we are sure it is a large folio Wei Yang
2025-08-15 10:04 ` Lorenzo Stoakes
2025-08-16 6:32 ` David Hildenbrand
2025-08-15 10:11 ` [PATCH 0/3] mm/rmap: small cleanup for __folio_remove_rmap() Lorenzo Stoakes
2025-08-16 0:36 ` Wei Yang
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=601ff999-6a3d-4010-b316-6b4b294b5417@redhat.com \
--to=david@redhat.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=harry.yoo@oracle.com \
--cc=linux-mm@kvack.org \
--cc=lorenzo.stoakes@oracle.com \
--cc=richard.weiyang@gmail.com \
--cc=riel@surriel.com \
--cc=vbabka@suse.cz \
/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;
as well as URLs for NNTP newsgroup(s).