From: David Hildenbrand <david@redhat.com>
To: Peter Xu <peterx@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: Vlastimil Babka <vbabka@suse.cz>,
Oscar Salvador <osalvador@suse.de>,
linux-s390@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Matthew Wilcox <willy@infradead.org>,
Dan Williams <dan.j.williams@intel.com>,
Michal Hocko <mhocko@kernel.org>,
linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org,
Alex Williamson <alex.williamson@redhat.com>,
Jason Gunthorpe <jgg@nvidia.com>,
x86@kernel.org, Alistair Popple <apopple@nvidia.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org,
Ryan Roberts <ryan.roberts@arm.com>,
Hugh Dickins <hughd@google.com>,
Axel Rasmussen <axelrasmussen@google.com>
Subject: Re: [PATCH RFC 0/6] mm: THP-agnostic refactor on huge mappings
Date: Mon, 22 Jul 2024 15:29:43 +0200 [thread overview]
Message-ID: <cf36725d-c197-4c07-8998-d34711335fdb@redhat.com> (raw)
In-Reply-To: <20240717220219.3743374-1-peterx@redhat.com>
On 18.07.24 00:02, Peter Xu wrote:
> This is an RFC series, so not yet for merging. Please don't be scared by
> the code changes: most of them are code movements only.
>
> This series is based on the dax mprotect fix series here (while that one is
> based on mm-unstable):
>
> [PATCH v3 0/8] mm/mprotect: Fix dax puds
> https://lore.kernel.org/r/20240715192142.3241557-1-peterx@redhat.com
>
> Overview
> ========
>
> This series doesn't provide any feature change. The only goal of this
> series is to start decoupling two ideas: "THP" and "huge mapping". We
> already started with having PGTABLE_HAS_HUGE_LEAVES config option, and this
> one extends that idea into the code.
>
> The issue is that we have so many functions that only compile with
> CONFIG_THP=on, even though they're about huge mappings, and huge mapping is
> a pretty common concept, which can apply to many things besides THPs
> nowadays. The major THP file is mm/huge_memory.c as of now.
>
> The first example of such huge mapping users will be hugetlb. We lived
> until now with no problem simply because Linux almost duplicated all the
> logics there in the "THP" files into hugetlb APIs. If we want to get rid
> of hugetlb specific APIs and paths, this _might_ be the first thing we want
> to do, because we want to be able to e.g., zapping a hugetlb pmd entry even
> if !CONFIG_THP.
>
> Then consider other things like dax / pfnmaps. Dax can depend on THP, then
> it'll naturally be able to use pmd/pud helpers, that's okay. However is it
> a must? Do we also want to have every new pmd/pud mappings in the future
> to depend on THP (like PFNMAP)? My answer is no, but I'm open to opinions.
>
> If anyone agrees with me that "huge mapping" (aka, PMD/PUD mappings that
> are larger than PAGE_SIZE) is a more generic concept than THP, then I think
> at some point we need to move the generic code out of THP code into a
> common code base.
>
> This is what this series does as a start.
Hi Peter!
From a quick glimpse, patch #1-#4 do make sense independent of patch #5.
I am not so sure about all of the code movement in patch #5. If large
folios are the future, then likely huge_memory.c should simply be the
home for all that logic.
Maybe the goal should better be to compile huge_memory.c not only for
THP, but also for other use cases that require that logic, and fence off
all THP specific stuff using #ifdef?
Not sure, though. But a lot of this code movements/churn might be avoidable.
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-07-22 13:29 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 22:02 Peter Xu
2024-07-17 22:02 ` [PATCH RFC 1/6] mm/treewide: Remove pgd_devmap() Peter Xu
2024-07-17 22:02 ` [PATCH RFC 2/6] mm: PGTABLE_HAS_P[MU]D_LEAVES config options Peter Xu
2024-08-22 17:22 ` LEROY Christophe
2024-08-22 19:16 ` Peter Xu
2024-08-23 6:19 ` LEROY Christophe
2024-08-26 14:34 ` Peter Xu
2024-07-17 22:02 ` [PATCH RFC 3/6] mm/treewide: Make pgtable-generic.c THP agnostic Peter Xu
2024-07-17 22:02 ` [PATCH RFC 4/6] mm: Move huge mapping declarations from internal.h to huge_mm.h Peter Xu
2024-07-17 22:02 ` [PATCH RFC 5/6] mm/huge_mapping: Create huge_mapping_pxx.c Peter Xu
2024-07-17 22:02 ` [PATCH RFC 6/6] mm: Convert "*_trans_huge() || *_devmap()" to use *_leaf() Peter Xu
2024-07-22 13:29 ` David Hildenbrand [this message]
2024-07-22 15:31 ` [PATCH RFC 0/6] mm: THP-agnostic refactor on huge mappings Peter Xu
2024-07-23 8:18 ` David Hildenbrand
2024-07-23 21:04 ` Peter Xu
2024-07-23 21:22 ` David Hildenbrand
2024-08-22 17:08 ` LEROY Christophe
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=cf36725d-c197-4c07-8998-d34711335fdb@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=apopple@nvidia.com \
--cc=axelrasmussen@google.com \
--cc=dan.j.williams@intel.com \
--cc=hughd@google.com \
--cc=jgg@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-s390@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mhocko@kernel.org \
--cc=osalvador@suse.de \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=sparclinux@vger.kernel.org \
--cc=vbabka@suse.cz \
--cc=willy@infradead.org \
--cc=x86@kernel.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