From: Oscar Salvador <osalvador@suse.de>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
linux-fsdevel@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Muchun Song <muchun.song@linux.dev>
Subject: Re: [PATCH v1 2/2] fs/proc/task_mmu: convert smaps_hugetlb_range() to work on folios
Date: Wed, 17 Apr 2024 14:31:38 +0200 [thread overview]
Message-ID: <Zh_BKoUNK0uKJF8r@localhost.localdomain> (raw)
In-Reply-To: <209b1956-a46f-41aa-bec1-cd65484f36cd@redhat.com>
On Wed, Apr 17, 2024 at 02:18:10PM +0200, David Hildenbrand wrote:
> On 17.04.24 14:09, Oscar Salvador wrote:
> > On Wed, Apr 17, 2024 at 11:23:13AM +0200, David Hildenbrand wrote:
> > > Let's get rid of another page_mapcount() check and simply use
> > > folio_likely_mapped_shared(), which is precise for hugetlb folios.
> > >
> > > While at it, use huge_ptep_get() + pte_page() instead of ptep_get() +
> > > vm_normal_page(), just like we do in pagemap_hugetlb_range().
> >
> > That is fine because vm_normal_page() tries to be clever about mappings which
> > hugetlb does not support, right?
>
> Right, using vm_normal_page() is even completely bogus. Usually (but not
> always) we have PMDs/PUDs and not PTEs for mapping hugetlb pages -- where
> vm_normal_folio_pmd() would be the right thing to do.
>
> That's also the reason why hugetlb.c has not a single user of
> vm_normal_page() and friends ... it doesn't apply to hugetlb, but likely
> also isn't currently harmful to use it.
I guess not because we skip the special handling, but I agree that
replacing it is the right thing to do.
Thanks for explaining!
--
Oscar Salvador
SUSE Labs
prev parent reply other threads:[~2024-04-17 12:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-17 9:23 [PATCH v1 0/2] fs/proc/task_mmu: convert hugetlb functions to work on folis David Hildenbrand
2024-04-17 9:23 ` [PATCH v1 1/2] fs/proc/task_mmu: convert pagemap_hugetlb_range() to work on folios David Hildenbrand
2024-04-17 10:21 ` Oscar Salvador
2024-04-17 9:23 ` [PATCH v1 2/2] fs/proc/task_mmu: convert smaps_hugetlb_range() " David Hildenbrand
2024-04-17 12:09 ` Oscar Salvador
2024-04-17 12:18 ` David Hildenbrand
2024-04-17 12:31 ` Oscar Salvador [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=Zh_BKoUNK0uKJF8r@localhost.localdomain \
--to=osalvador@suse.de \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=muchun.song@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.