khugepaged: add mTHP collapse support
Subsystems (7)
Re: [PATCH mm-unstable v18 14/14] Documentation: mm: update the admin guide for mTHP collapse
In reply to Nico PacheQuoted 7 lines · Nico Pache
Now that we can collapse to mTHPs lets update the admin guide to reflect these changes and provide proper guidance on how to utilize it.
Reviewed-by Lorenzo Stoakes <[email protected]>Reviewed-by Bagas Sanjaya <[email protected]>Signed-off-by Nico Pache <[email protected]>---
Hi Andrew,
Can you please append the following fixup to this commit.
The changes are simply undoing a deleted note i added and reworking it slightly to reflect the new khugepaged behavior.
Cheers!
--Nico
commit d81806992231ef920c731e62468a3a1b2ef6b869
Author: Nico Pache <[email protected]> Date: Tue May 26 07:47:42 2026 -0600
fixup: add back note and edit doc about khugepaged limits
Documentation/admin-guide/mm/transhuge.rst +5 -0
@@ -265,6 +265,11 @@ support the following arguments:: Khugepaged controls ------------------- +.. note:: + khugepaged currently only searches for opportunities to collapse file/shmem + to PMD-sized THP. Only anonymous memory will attempt to collapse to other THP + sizes. + khugepaged runs usually at low frequency so while one may not want to invoke defrag algorithms synchronously during the page faults, it should be worth invoking defrag at least in khugepaged. However it's
Quoted 104 lines
Documentation/admin-guide/mm/transhuge.rst | 50 +++++++++++++--------- 1 file changed, 30 insertions(+), 20 deletions(-)Documentation/admin-guide/mm/transhuge.rst +30
-20@@ -63,7 +63,8 @@ often. THP can be enabled system wide or restricted to certain tasks or even memory ranges inside task's address space. Unless THP is completely disabled, there is ``khugepaged`` daemon that scans memory and -collapses sequences of basic pages into PMD-sized huge pages. +collapses sequences of basic pages into huge pages of either PMD size +or mTHP sizes, if the system is configured to do so. The THP behaviour is controlled via :ref:`sysfs <thp_sysfs>` interface and using madvise(2) and prctl(2) system calls.@@ -219,10 +220,10 @@ this behaviour by writing 0 to shrink_underused, and enable it by writing echo 0 > /sys/kernel/mm/transparent_hugepage/shrink_underused echo 1 > /sys/kernel/mm/transparent_hugepage/shrink_underused -khugepaged will be automatically started when PMD-sized THP is enabled +khugepaged will be automatically started when any THP size is enabled (either of the per-size anon control or the top-level control are set to "always" or "madvise"), and it'll be automatically shutdown when -PMD-sized THP is disabled (when both the per-size anon control and the +all THP sizes are disabled (when both the per-size anon control and the top-level control are "never") process THP controls@@ -264,11 +265,6 @@ support the following arguments:: Khugepaged controls ------------------- -.. note:: - khugepaged currently only searches for opportunities to collapse to - PMD-sized THP and no attempt is made to collapse to other THP - sizes. - khugepaged runs usually at low frequency so while one may not want to invoke defrag algorithms synchronously during the page faults, it should be worth invoking defrag at least in khugepaged. However it's@@ -296,11 +292,11 @@ allocation failure to throttle the next allocation attempt:: The khugepaged progress can be seen in the number of pages collapsed (note that this counter may not be an exact count of the number of pages collapsed, since "collapsed" could mean multiple things: (1) A PTE mapping -being replaced by a PMD mapping, or (2) All 4K physical pages replaced by -one 2M hugepage. Each may happen independently, or together, depending on -the type of memory and the failures that occur. As such, this value should -be interpreted roughly as a sign of progress, and counters in /proc/vmstat -consulted for more accurate accounting):: +being replaced by a PMD mapping, or (2) physical pages replaced by one +hugepage of various sizes (PMD-sized or mTHP). Each may happen independently, +or together, depending on the type of memory and the failures that occur. +As such, this value should be interpreted roughly as a sign of progress, +and counters in /proc/vmstat consulted for more accurate accounting):: /sys/kernel/mm/transparent_hugepage/khugepaged/pages_collapsed@@ -308,16 +304,21 @@ for each pass:: /sys/kernel/mm/transparent_hugepage/khugepaged/full_scans -``max_ptes_none`` specifies how many extra small pages (that are -not already mapped) can be allocated when collapsing a group -of small pages into one large page:: +``max_ptes_none`` specifies how many empty (none/zero) pages are allowed +when collapsing a group of small pages into one large page:: /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none -A higher value leads to use additional memory for programs. -A lower value leads to gain less thp performance. Value of -max_ptes_none can waste cpu time very little, you can -ignore it. +For PMD-sized THP collapse, this directly limits the number of empty pages +allowed in the 2MB region. + +For mTHP collapse, only 0 or (HPAGE_PMD_NR - 1) are supported. At +HPAGE_PMD_NR - 1, we collapse to the highest possible order. Any intermediate +value will emit a warning and mTHP collapse will default to max_ptes_none=0. + +A higher value allows more empty pages, potentially leading to more memory +usage but better THP performance. A lower value is more conservative and +may result in fewer THP collapses. ``max_ptes_swap`` specifies how many pages can be brought in from swap when collapsing a group of pages into a transparent huge page::@@ -337,6 +338,15 @@ that THP is shared. Exceeding the number would block the collapse:: A higher value may increase memory footprint for some workloads. +.. note:: + For mTHP collapse, khugepaged does not support collapsing regions that + contain shared or swapped out pages, as this could lead to continuous + promotion to higher orders. The collapse will fail if any shared or + swapped PTEs are encountered during the scan. + + Currently, madvise_collapse only supports collapsing to PMD-sized THPs + and does not attempt mTHP collapses. + Boot parameters ===============
Quoted 127 lines · Nico Pache
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
To achieve this we generalize the khugepaged functions to no longer depend on
PMD_ORDER. Then during the PMD scan, we use a bitmap to track individual pages that are occupied (!none/zero). After the PMD scan is done, we use the bitmap to find the optimal mTHP sizes for the PMD range. The restriction onmax_ptes_noneis removed during the scan, to make sure we account for the whole PMD range in the bitmap. When no mTHP size is enabled, the legacy behavior of khugepaged is maintained.We currently only support
max_ptes_nonevalues of 0 orHPAGE_PMD_NR- 1 (ie 511). If any other value is specified, the kernel will emit a warning and mTHP collapse will default to max_ptes_none=0. If a mTHP collapse is attempted, but contains swapped out, or shared pages, we don't perform the collapse.
It is now also possible to collapse to mTHPs without requiring the PMD THP size to be enabled. These limitations are to prevent collapse "creep" behavior. This prevents constantly promoting mTHPs to the next available size, which would occur because a collapse introduces more non-zero pages that would satisfy the promotion condition on subsequent scans.Patch 1-2: Generalize
hugepage_vma_revalidateandalloc_charge_folio
for arbitrary orders.Patch 3: Rework max_ptes_* handling into helper functions Patch 4: Generalize __collapse_huge_page_* for mTHP support Patch 5: Require collapse_huge_page to enter/exit with the lock dropped Patch 6: Generalize collapse_huge_page for mTHP collapse Patch 7: Skip collapsing mTHP to smaller orders Patch 8-9: Add per-order mTHP statistics and tracepoints Patch 10: Introduce collapse_allowable_orders helper function Patch 11-13: Introduce bitmap and mTHP collapse support, fully enabled Patch 14: DocumentationTesting:
- Built forx86_64, aarch64, ppc64le, and s390x
- ran all arches on test suites provided by the kernel-tests project
- internal testing suites: functional testing and performance testing
- selftests mm
- I created a test script that I used to push khugepaged to its limits while monitoring a number of stats and tracepoints. The code is available here[1] (Run in legacy mode for these changes and set mthp sizes to inherit)
The summary from my testings was that there was no significant regression noticed through this test. In some cases my changes had better collapse latencies, and was able to scan more pages in the same amount of time/work, but for the most part the results were consistent.
- redis testing. I did some testing with these changes along with my defer changes (see followup [2] post for more details). We've decided to get the mTHP changes merged first before attempting the defer series.
- some basic testing on 64k page size.
- lots of general use.[1] - https://gitlab.com/npache/khugepaged_mthp_test
[2] - https://lore.kernel.org/lkml/[email protected]/V18 Changes:
- Added RBs/Acks
- [patch 02] Guardcount_memcg_folio_eventswithis_pmd_order()to keepTHP_COLLAPSE_ALLOCPMD-only (Usama, Lance)
- [patch 03] Convert C++ comments to C-style; fix "none-page" terminology to "empty PTEs or PTEs mapping the shared zeropage"; drop unnecessary userfaultfd comment; add const to local max_ptes_* variables; fix "repect" typo (Lance, David)
- [patch 04]collapse_max_ptes_none()now returns 0 instead of-EINVALfor unsupported values; removeSCAN_INVALID_PTES_NONE; change return type from int to unsigned int and propagate to all callers; add comment above__collapse_huge_page_swapinexplaining mTHP swap bail-out (David, Lorenzo, Lance, Wei Yang, Usama)
- [patch 05] Rewritecollapse_huge_pagelock comment to David's suggested wording (David)
- [patch 11] Propagate unsigned int return type formax_ptes_none; remove the now-unnecessary negative return check (consequence of patch 04); Add optimization to thenext_ordergoto that will prevent unnecessary iterations if there are no lower orders enabled (Vernon); update locking comment; pass VMA tomthp_collapseto improve uffd-armed detection, and prevent unnecessary work. (Wei)
- [patch 14] Update documentation to reflect fallback-to-0 behaviorV17: https://lore.kernel.org/all/[email protected]
V16: https://lore.kernel.org/all/[email protected]
V15: https://lore.kernel.org/all/[email protected]
V14: https://lore.kernel.org/all/[email protected]
V13: https://lore.kernel.org/all/[email protected]
V12: https://lore.kernel.org/all/[email protected]
V11: https://lore.kernel.org/all/[email protected]
V10: https://lore.kernel.org/all/[email protected]
V9 : https://lore.kernel.org/all/[email protected]
V8 : https://lore.kernel.org/all/[email protected]
V7 : https://lore.kernel.org/all/[email protected]
V6 : https://lore.kernel.org/all/[email protected]
V5 : https://lore.kernel.org/all/[email protected]
V4 : https://lore.kernel.org/all/[email protected]
V3 : https://lore.kernel.org/all/[email protected]
V2 : https://lore.kernel.org/all/[email protected]
V1 : https://lore.kernel.org/all/[email protected]Baolin Wang (1):
mm/khugepaged: run khugepaged for all ordersDev Jain (1):
mm/khugepaged: generalizealloc_charge_folio()Nico Pache (12):
mm/khugepaged: generalizehugepage_vma_revalidatefor mTHP support mm/khugepaged: rework max_ptes_* handling with helper functions mm/khugepaged: generalize __collapse_huge_page_* for mTHP support mm/khugepaged: requirecollapse_huge_pageto enter/exit with the lock
dropped
mm/khugepaged: generalizecollapse_huge_pagefor mTHP collapse mm/khugepaged: skip collapsing mTHP to smaller orders mm/khugepaged: add per-order mTHP collapse failure statistics mm/khugepaged: improve tracepoints for mTHP orders mm/khugepaged: introducecollapse_allowable_ordershelper function mm/khugepaged: Introduce mTHP collapse support mm/khugepaged: avoid unnecessary mTHP collapse attempts
Documentation: mm: update the admin guide for mTHP collapseDocumentation/admin-guide/mm/transhuge.rst | 72 ++- include/linux/huge_mm.h | 5 + include/trace/events/huge_memory.h | 34 +- mm/huge_memory.c | 11 + mm/khugepaged.c | 634 ++++++++++++++++----- 5 files changed, 584 insertions(+), 172 deletions(-)
Quoted 1 line
base-commit:
6c8cb505a5634594b3ea159fd1c71bce2acf3346
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
-- Nico
Quoted 3 lines
--
2.54.0
Vlastimil Babka (SUSE)
reviewerQuoted 11 lines · Nico Pache
Quoted 7 lines · Nico Pache
include/trace/events/huge_memory.h | 34 +- mm/huge_memory.c | 11 + mm/khugepaged.c | 634 ++++++++++++++++----- 5 files changed, 584 insertions(+), 172 deletions(-)base-commit:
6c8cb505a5634594b3ea159fd1c71bce2acf3346Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Quoted 9 lines
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
-- Nico
Quoted 3 lines
--
2.54.0
Quoted 9 lines · Vlastimil Babka (SUSE)
Quoted 7 lines · Nico Pache
Quoted 6 lines · Nico Pache
include/trace/events/huge_memory.h | 34 +- mm/huge_memory.c | 11 + mm/khugepaged.c | 634 ++++++++++++++++----- 5 files changed, 584 insertions(+), 172 deletions(-)
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
base-commit:
6c8cb505a5634594b3ea159fd1c71bce2acf3346Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
That just happened to be the hotfixes tree (previously it was mm-unstable, but that seems the have moved).
Sorry...
-- Nico
Quoted 11 lines
Quoted 10 lines
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
-- Nico
Quoted 3 lines
--
2.54.0
David Hildenbrand (Arm)
maintainerQuoted 5 lines · Nico Pache
Quoted 3 lines · Vlastimil Babka (SUSE)
Quoted 1 line · Nico Pache
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
Ah, I guess this is a problem of "v17 is already in mm-unstable, so against what to base v18".
Yeah, we touched on that problem in the LSF/MM process discussion ...
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerProcess (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
[trimmed cc list to avoid noise, apologies if I excluded anybody who is interested in this!]
Quoted 12 lines · David Hildenbrand (Arm)
Quoted 11 lines · Nico Pache
Quoted 8 lines · Vlastimil Babka (SUSE)
Quoted 3 lines · Nico Pache
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Quoted 7 lines
Quoted 2 lines
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
Ah, I guess this is a problem of "v17 is already in mm-unstable, so against what to base v18".
Yeah, we touched on that problem in the LSF/MM process discussion ...
I may be misremembering but... :) [correct me if wrong]:
Wasn't the general conclusion that we maintain a stable branch (Linus's tree + stuff that's been reviewed and is locked in for next release), and have people base work against that?
This would be 'source of truth' and what we eventually send to Linus.
In that world, the maintainers perform conflict resolution, but with git rerere we need only do this once.
We'd have mm-new which would contain everything for testing.
SO my question is - would we even need an mm-unstable in that world?
What role would it perform? Surely we'd want the stable branch going to linux-next, so it's not that, it's not quite initial testing either as mm-new would perform that duty.
It would potentially make life a bit easier for somebody doing a new series to avoid merge conflicts, but that could then make life harder because there'd be an implicit dependency of their series on what's-in-mm-unstable?
If everything's based on the stable branch, things are surely clearer?
Curious what people think here.
(I also wonder if we could have branches for versions of series so we could do some kind of an easy diff between versions but maybe that'd create too much noise :)
Quoted 5 lines
--
Cheers,David
Thanks, Lorenzo
Andrew Morton
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 22 lines · On Tue, 26 May 2026 09:33:08 +0100 Lorenzo Stoakes <[email protected]> wrote:
[trimmed cc list to avoid noise, apologies if I excluded anybody who is interested in this!]
Quoted 18 lines · David Hildenbrand (Arm)
Quoted 5 lines · Nico Pache
Quoted 3 lines · Vlastimil Babka (SUSE)
Quoted 1 line · Nico Pache
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
Ah, I guess this is a problem of "v17 is already in mm-unstable, so against what to base v18".
Quoted 7 lines
Quoted 1 line
Yeah, we touched on that problem in the LSF/MM process discussion ...
I may be misremembering but... :) [correct me if wrong]:
Wasn't the general conclusion that we maintain a stable branch (Linus's tree + stuff that's been reviewed and is locked in for next release), and have people base work against that?
That was the plan when I initially set up the mm.git branches.
It turned out to be quite impractical because it takes so long to get material into mm-stable worthiness: around -rc4/-rc5.
We could address that by delaying everything by four weeks - so MM's window is out of phase with Linus's. So there's a lot of "stable" material in mm.git when Linus is at -rc1/-rc2. Problem with this is that by -rc5/-rc6 we'll have a large amount of material queued up for the next -rc cycle and it is against linux-next rules to add this to -next. And until it's had decent -next exposure we can't declare it "stable".
This needs a diagram ;)
Vlastimil Babka (SUSE)
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to Lorenzo StoakesQuoted 22 lines · Lorenzo Stoakes
[trimmed cc list to avoid noise, apologies if I excluded anybody who is interested in this!]
Quoted 18 lines · David Hildenbrand (Arm)
Quoted 5 lines · Nico Pache
Quoted 3 lines · Vlastimil Babka (SUSE)
Quoted 1 line · Nico Pache
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
Ah, I guess this is a problem of "v17 is already in mm-unstable, so against what to base v18".
Quoted 6 lines
Quoted 1 line
Yeah, we touched on that problem in the LSF/MM process discussion ...
I may be misremembering but... :) [correct me if wrong]:
Wasn't the general conclusion that we maintain a stable branch (Linus's tree + stuff that's been reviewed and is locked in for next release),
This I think basically yes.
Quoted 2 lines
and have people
base work against that?
This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those. But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
Quoted 1 line
This would be 'source of truth' and what we eventually send to Linus.
Yes.
Quoted 2 lines
In that world, the maintainers perform conflict resolution, but with git rerere we need only do this once.
I think the conflicts would arise from merging the submaintainers' branches to the mm-next tree, and if they get updated and the merges are recreated (like linux-next works) git rerere avoids resolving the same conflicts again.
Hm like Andrew said, this needs a diagram indeed :)
Quoted 27 lines
We'd have mm-new which would contain everything for testing.
SO my question is - would we even need an mm-unstable in that world?
What role would it perform? Surely we'd want the stable branch going to linux-next, so it's not that, it's not quite initial testing either as mm-new would perform that duty.
It would potentially make life a bit easier for somebody doing a new series to avoid merge conflicts, but that could then make life harder because there'd be an implicit dependency of their series on what's-in-mm-unstable?
If everything's based on the stable branch, things are surely clearer?
Curious what people think here.
(I also wonder if we could have branches for versions of series so we could do some kind of an easy diff between versions but maybe that'd create too much noise :)
Quoted 5 lines
--
Cheers,David
Thanks, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 12 lines
Quoted 3 lines
and have people
base work against that?This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those. But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
Quoted 4 lines
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
Right, most patches can be sent against the "stable branch", but cherry-picked on a submaintainers branch / topic tree.
Quoted 5 lines
Quoted 2 lines
This would be 'source of truth' and what we eventually send to Linus.
Yes.
Quoted 8 lines
Quoted 2 lines
In that world, the maintainers perform conflict resolution, but with git rerere we need only do this once.
I think the conflicts would arise from merging the submaintainers' branches to the mm-next tree, and if they get updated and the merges are recreated (like linux-next works) git rerere avoids resolving the same conflicts again.
Hm like Andrew said, this needs a diagram indeed :)
It's one of the first things we'll discuss in the upcoming meetings ... I want to talk to some other folks (in particular, TIP and KVM) to understand how they are handling that.
Hopefully I'll find some time after my inbox calmed down a bit ... jeez, 1500 mails in one week if my eyes didn't betray me.
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 12 lines · David Hildenbrand (Arm)
Quoted 12 lines
Quoted 3 lines
and have people
base work against that?This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those. But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
Quoted 7 lines
Quoted 4 lines
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
Right, most patches can be sent against the "stable branch", but cherry-picked on a submaintainers branch / topic tree.
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
I think the simplest is what I suggested in reply to Vlasta, where each submaintainer tree has their own set of changes against mm-next/mm-stable and then we merge each week.
But am open to learning about what other subsystems in the kernel do...
Quoted 14 lines
Quoted 14 lines
Quoted 4 lines
This would be 'source of truth' and what we eventually send to Linus.
Yes.
Quoted 2 lines
In that world, the maintainers perform conflict resolution, but with git rerere we need only do this once.
I think the conflicts would arise from merging the submaintainers' branches to the mm-next tree, and if they get updated and the merges are recreated (like linux-next works) git rerere avoids resolving the same conflicts again.
Quoted 5 lines
Quoted 1 line
Hm like Andrew said, this needs a diagram indeed :)
It's one of the first things we'll discuss in the upcoming meetings ... I want to talk to some other folks (in particular, TIP and KVM) to understand how they are handling that.
Yes let's definitely see what works for others and use that to figure things out.
Quoted 3 lines
Hopefully I'll find some time after my inbox calmed down a bit ... jeez, 1500 mails in one week if my eyes didn't betray me.
Yeah, it's crazy again lately...
Quoted 5 lines
--
Cheers,David
Cheers, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 16 lines · Lorenzo Stoakes
Quoted 15 lines · David Hildenbrand (Arm)
Quoted 14 lines
This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those. But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
Quoted 5 lines
Quoted 2 lines
Right, most patches can be sent against the "stable branch", but cherry-picked on a submaintainers branch / topic tree.
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
Requiring contributors to submit stuff targeted at some random trees is madness :)
Quoted 4 lines
I think the simplest is what I suggested in reply to Vlasta, where each submaintainer tree has their own set of changes against mm-next/mm-stable and then we merge each week.
Throw in hotfixes and it already starts being crazy.
Quoted 2 lines
But am open to learning about what other subsystems in the kernel do...
The TIP tree has a pretty elaborate model of dealing with topic branches, and don't require things to be sent against specific topic branches.
I'll try to understand that model.
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 17 lines · David Hildenbrand (Arm)
Quoted 16 lines · Lorenzo Stoakes
Quoted 15 lines · David Hildenbrand (Arm)
Quoted 14 lines
This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those. But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Right, most patches can be sent against the "stable branch", but cherry-picked on a submaintainers branch / topic tree.
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
Requiring contributors to submit stuff targeted at some random trees is madness :)
Err what? The 'random' tree is the MAINTAINERS entry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?
I mean, is there any meaning to separate 'trees' at all if we just have one tree with topic branches in?
Or are we going to have several parallel stable branches in one tree, and a bunch of maintainers with write access stepping on each other's toes?
That sounds a lot more crazy to me, and I just don't think it's workable.
Quoted 7 lines
Quoted 5 lines
I think the simplest is what I suggested in reply to Vlasta, where each submaintainer tree has their own set of changes against mm-next/mm-stable and then we merge each week.
Throw in hotfixes and it already starts being crazy.
Again I really don't understand this?
Hotfixes are a completely separate topic for one, I'm talking about ordinary development, but surely they're simpler aren't they?
Everything's based on Linus's tree (so no confusion as to which tree), there shouldn't (hopefully) be a huge amount of them, and submaintainers can just potentially find a way to send them direct to mm-next anyway?
Quoted 8 lines
Quoted 3 lines
But am open to learning about what other subsystems in the kernel do...
The TIP tree has a pretty elaborate model of dealing with topic branches, and don't require things to be sent against specific topic branches.
I'll try to understand that model.
OK well, interested to hear about that.
But also we should adapt what others do (which I think is very important to learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Quoted 5 lines
--
Cheers,David
Thanks, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 11 lines · Lorenzo Stoakes
Quoted 6 lines · David Hildenbrand (Arm)
Quoted 3 lines · Lorenzo Stoakes
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
Requiring contributors to submit stuff targeted at some random trees is madness :)
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?
We'll still have plenty of patch sets that touch files cross trees.
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
This is likely something we'll have to play with to understand what is workable and what not.
Quoted 6 lines
I mean, is there any meaning to separate 'trees' at all if we just have one tree with topic branches in?
Or are we going to have several parallel stable branches in one tree, and a bunch of maintainers with write access stepping on each other's toes?
All valid question to which we don't have an answer yet. :)
Quoted 8 lines
That sounds a lot more crazy to me, and I just don't think it's workable.
Quoted 6 lines
Quoted 5 lines
I think the simplest is what I suggested in reply to Vlasta, where each submaintainer tree has their own set of changes against mm-next/mm-stable and then we merge each week.
Quoted 6 lines
Quoted 1 line
Throw in hotfixes and it already starts being crazy.
Again I really don't understand this?
Hotfixes are a completely separate topic for one, I'm talking about ordinary development, but surely they're simpler aren't they?
I mean the interaction: new material that depend on hotfixes. Talking to Michal and Vlastimil last week, there are some ways to make this work based on topic branches (hotfixes being a topic branch IIUC), but I don't understand yet how that works in detail, or how that would scale to subtrees.
Quoted 14 lines
Everything's based on Linus's tree (so no confusion as to which tree), there shouldn't (hopefully) be a huge amount of them, and submaintainers can just potentially find a way to send them direct to mm-next anyway?
Quoted 8 lines
Quoted 3 lines
But am open to learning about what other subsystems in the kernel do...
The TIP tree has a pretty elaborate model of dealing with topic branches, and don't require things to be sent against specific topic branches.
I'll try to understand that model.
Quoted 7 lines
OK well, interested to hear about that.
But also we should adapt what others do (which I think is very important to learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Signature · 3 lines
Cheers, David
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 7 lines
Quoted 4 lines
learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Starting to read Documentation/process/maintainer-tip.rst, it's very interesting:
“The tip tree is both a direct development tree and and an aggregation tree for several sub-maintainer trees.”
“In general, development against the head of the tip tree master branch is fine, but for the subsystems which are maintained separately, have their own git tree and are only aggregated into the tip tree, development should take place against the relevant subsystem tree or branch.”
“Bug fixes which target mainline should always be applicable against the mainline kernel tree. Potential conflicts against changes which are already queued in the tip tree are handled by the maintainers.”
So, yeah, let me reach out to understand what works, what doesn't work, and how it works :)
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 10 lines · David Hildenbrand (Arm)
Quoted 7 lines
Quoted 4 lines
learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Starting to read
Documentation/process/maintainer-tip.rst, it's very interesting:
Quoted 7 lines
“The tip tree is both a direct development tree and and an aggregation tree for several sub-maintainer trees.”
“In general, development against the head of the tip tree master branch is fine, but for the subsystems which are maintained separately, have their own git tree and are only aggregated into the tip tree, development should take place against the relevant subsystem tree or branch.”
Yeah so they have a separate tree model also, so that's an option to learn from as well!
Quoted 8 lines
“Bug fixes which target mainline should always be applicable against the mainline kernel tree. Potential conflicts against changes which are already queued in the tip tree are handled by the maintainers.”
So, yeah, let me reach out to understand what works, what doesn't work, and how it works :)
Yes 100% :)
Quoted 5 lines
--
Cheers,David
Cheers, Lorenzo
Vlastimil Babka (SUSE)
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to David Hildenbrand (Arm)Quoted 8 lines · David Hildenbrand (Arm)
Quoted 7 lines
Quoted 4 lines
learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Quoted 6 lines
Starting to read
Documentation/process/maintainer-tip.rst, it's very interesting:“The tip tree is both a direct development tree and and an aggregation tree for several sub-maintainer trees.”
“In general, development against the head of the tip tree master branch is fine,
I don't think we'll be able to use this part as mm-next will be only an aggreggation tree and not also a direct development tree.
Quoted 3 lines
but for the subsystems which are maintained separately, have their own git tree and are only aggregated into the tip tree, development should take place against the relevant subsystem tree or branch.”
So it would have to be this.
As it might be hard for contributors to pick the right one (as Lorenzo pointed out), we might in general suggest they try developing against rc1 first (which is the common base of all subsystem trees), then either it applies to one of the subsystem trees as-is, or it applies as a topic branch (which starts also on the rc1 base) with reasonable conflict resolution during merge, or we tell them which exising subtree/branch to rebase on.
Quoted 3 lines
“Bug fixes which target mainline should always be applicable against the mainline kernel tree. Potential conflicts against changes which are already queued in the tip tree are handled by the maintainers.”
Ack.
Quoted 3 lines
So, yeah, let me reach out to understand what works, what doesn't work, and how it works :)
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 7 lines · Vlastimil Babka (SUSE)
Quoted 6 lines · David Hildenbrand (Arm)
Quoted 3 lines
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Starting to read
Documentation/process/maintainer-tip.rst, it's very interesting:
Quoted 7 lines
Quoted 4 lines
“The tip tree is both a direct development tree and and an aggregation tree for several sub-maintainer trees.”
“In general, development against the head of the tip tree master branch is fine,
I don't think we'll be able to use this part as mm-next will be only an aggreggation tree and not also a direct development tree.
Take a look at tip.git / master:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/log/
It's basically an aggregation tree.
But what yous end there will just apply to the relevant sub-branches where it can simply be cherry-picked?
Signature · 3 lines
Cheers, David
Mike Rapoport
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to Vlastimil Babka (SUSE)Quoted 23 lines · Vlastimil Babka (SUSE)
Quoted 8 lines · David Hildenbrand (Arm)
Quoted 7 lines
Quoted 4 lines
learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Quoted 6 lines
Starting to read
Documentation/process/maintainer-tip.rst, it's very interesting:“The tip tree is both a direct development tree and and an aggregation tree for several sub-maintainer trees.”
“In general, development against the head of the tip tree master branch is fine,
I don't think we'll be able to use this part as mm-next will be only an aggreggation tree and not also a direct development tree.
Quoted 3 lines
but for the subsystems which are maintained separately, have their own git tree and are only aggregated into the tip tree, development should take place against the relevant subsystem tree or branch.”
Quoted 7 lines
So it would have to be this.
As it might be hard for contributors to pick the right one (as Lorenzo pointed out), we might in general suggest they try developing against rc1 first (which is the common base of all subsystem trees), then either it applies to one of the subsystem trees as-is, or it applies as a topic branch (which starts also on the rc1 base) with reasonable conflict resolution during merge, or we tell them which exising subtree/branch to rebase on.
Unless we carry semi-baked work through merge window *, at rc1 all trees anyway restart the cycle.
So basing new work on rc1 is very reasonable choice. Once that work is merged it will be merged to a particular sub-tree. Even patchsets that touch files across the trees still will be merged to a single sub-tree. And once a patches is merged it's clear what should be the base for the work that builds on top of that patchest.
Obviously there would be conflicts when sub-trees are merged into the integration tree, but that's maintainers responsibility to resolve them IMHO.
* Supposing we keep the model of early merging for testing [Lorenzo, don't yell at me ;-)] I think it's reasonable enough to drop everything that's not going upstream at, say, rc6 and ask contributors to rinse and repeat after rc1.
Quoted 5 lines
Quoted 3 lines
“Bug fixes which target mainline should always be applicable against the mainline kernel tree. Potential conflicts against changes which are already queued in the tip tree are handled by the maintainers.”
Ack.
+1
Signature · 2 lines
Sincerely yours, Mike.
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 4 lines · Mike Rapoport
* Supposing we keep the model of early merging for testing [Lorenzo, don't yell at me ;-)] I think it's reasonable enough to drop everything that's not going upstream at, say, rc6 and ask contributors to rinse and repeat after rc1.
I won't yell :) but I really don't want us to do this, and to improve our testing locally. Because:
- We've become a bit notorious for breaking linux-next
- It makes it more difficult for us to yank things
- It blurs the line between the stable branch (which in the new model we will be updating constantly rather than right at the end) and some 'unknown state' of 'whatever we just sent to linux-next'.
Cheers, Lorenzo
Mike Rapoport
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 8 lines · Lorenzo Stoakes
Quoted 4 lines · Mike Rapoport
* Supposing we keep the model of early merging for testing [Lorenzo, don't yell at me ;-)] I think it's reasonable enough to drop everything that's not going upstream at, say, rc6 and ask contributors to rinse and repeat after rc1.
I won't yell :) but I really don't want us to do this, and to improve our testing locally. Because:
There's no contradiction between improving our local testing and allowing to merge early to expose to the wider testing.
The merge early is a part of what makes mm community welcoming as opposed to tip's policy "only 100% perfect material goes in".
Quoted 1 line
- We've become a bit notorious for breaking linux-next
I don't think only mm breaks linux-next :)
Quoted 1 line
- It makes it more difficult for us to yank things
git rebase -i
Quoted 3 lines
- It blurs the line between the stable branch (which in the new model we will be updating constantly rather than right at the end) and some 'unknown state' of 'whatever we just sent to linux-next'.
The aggregate "next" going to linux-next can include both, stable and stabilizing parts.
Or they can go as separate branches.
Quoted 1 line
Cheers, Lorenzo
Signature · 2 lines
Sincerely yours, Mike.
Mark Brown
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 5 lines · Mike Rapoport
Quoted 1 line · Lorenzo Stoakes
- It makes it more difficult for us to yank things
git rebase -i
Remembering to add signoffs if you're rebasing something someone else committed (probably the most frequent cause of missing signoffs in -next), --signoff helps there.
Mike Rapoport
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 10 lines · Mark Brown
Quoted 5 lines · Mike Rapoport
Quoted 1 line · Lorenzo Stoakes
- It makes it more difficult for us to yank things
git rebase -i
Remembering to add signoffs if you're rebasing something someone else committed (probably the most frequent cause of missing signoffs in -next), --signoff helps there.
We learn as we go :)
Signature · 2 lines
Sincerely yours, Mike.
Mark Brown
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to Lorenzo StoakesQuoted 10 lines · Lorenzo Stoakes
Quoted 4 lines · Mike Rapoport
* Supposing we keep the model of early merging for testing [Lorenzo, don't yell at me ;-)] I think it's reasonable enough to drop everything that's not going upstream at, say, rc6 and ask contributors to rinse and repeat after rc1.
I won't yell :) but I really don't want us to do this, and to improve our testing locally. Because:
- We've become a bit notorious for breaking linux-next
TBH I can't say I've registered that with either of my running linux-next or my testing hats on. Considering the scope of what ends up in the mm tree it's not particularly concerning, and it's very rare for there to be anything so catastrophically bad at runtime that it causes unreasonable disruption. Importantly when there are issues they tend to get addressed promptly with either a fix or dropping the offending code as far as I can see, that's key for -next.
If you're looking at -next you're looking to provide early testing so breakage is expected, there's a balance with making an effort to ensure that you don't make too much noise for people doing testing and especially avoiding causing too much breakage which means things don't run at all.
Of course having written the above there's a -mm build failure today.
Quoted 1 line
- It makes it more difficult for us to yank things
FWIW I can easily add extra trees to -next, and there's the option of doing something like the fs-current and fs-next branches in -next ATM where I do submerges consisting of only the various filesystem trees which are published separately so they can be used for filesystem specific testing. There's several areas where integration trees require their subtrees to be in -next directly for a bit before they get merged into the integration tree.
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to David Hildenbrand (Arm)Quoted 7 lines · David Hildenbrand (Arm)
Quoted 6 lines · Lorenzo Stoakes
Quoted 5 lines · David Hildenbrand (Arm)
Quoted 3 lines · Lorenzo Stoakes
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Requiring contributors to submit stuff targeted at some random trees is madness :)
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?We'll still have plenty of patch sets that touch files cross trees.
I'm not sure how keeping things in the same tree fixes anything though?
You are just changing the _timing_ of when the conflicts happen at the cost of making things way more difficult to manage IMO.
I mean the reductio ad absurdum argument is why isn't all of linux in a single git tree? :)
If what you're saying is true it should be without issue? But I think there would be pretty huge issues...
And the disadvantage is now we have a bunch of sub-maintainers with write access to the key mm tree who could make mistakes and break things, hundreds of topic branches all bundled together, no separation between anything, and no sense of where anything's at.
If you're saying submaintainers manage topic branches (this cycle the ONE tree would have ~400 topic branches right? More if we included versions?) and then independently merge those into the mm-stable tree I think that's going to be a disaster in terms of timing/conflicts/etc.
And you're asking for conflict between submaintainers I think - what if one person merges his thing that then causes conflict for another etc. etc.
With separate trees then decisions can be made by the mm core people as to how to integrate, rather than people unilaterally doing whatever.
And if you're saying submaintainers won't do that, then essentially you're saying no submaintainer tree management at all :) which I think is a a bad idea for a subsystem as busy as mm.
I think mm is too large now to have everything under one person or a few people.
Separate trees implies division of labour, and then the integration tree can be more of a pure integration tree.
Quoted 4 lines
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
But what does 'picked up' mean? See above re: concerns.
Quoted 3 lines
This is likely something we'll have to play with to understand what is workable and what not.
Actually, I think we have to decide early - because if you want submaintainers to test out this sub-tree or sub-branch? Or whatever thing it's very different asking them to:
- Create a new tree and do X, Y and Z to sync up with mm-next
Vs.:
- Have full write access to mm-next and create branches X, Y and Z and merge things
Quoted 9 lines
Quoted 7 lines
I mean, is there any meaning to separate 'trees' at all if we just have one tree with topic branches in?
Or are we going to have several parallel stable branches in one tree, and a bunch of maintainers with write access stepping on each other's toes?
All valid question to which we don't have an answer yet. :)
:) I mean learning from how others do it is definitely key here.
Maybe we need to grill Brauner?
Quoted 13 lines
Quoted 13 lines
That sounds a lot more crazy to me, and I just don't think it's workable.
Quoted 7 lines
Quoted 5 lines
I think the simplest is what I suggested in reply to Vlasta, where each submaintainer tree has their own set of changes against mm-next/mm-stable and then we merge each week.
Throw in hotfixes and it already starts being crazy.
Again I really don't understand this?
Quoted 7 lines
Quoted 2 lines
Hotfixes are a completely separate topic for one, I'm talking about ordinary development, but surely they're simpler aren't they?
I mean the interaction: new material that depend on hotfixes. Talking to Michal and Vlastimil last week, there are some ways to make this work based on topic branches (hotfixes being a topic branch IIUC), but I don't understand yet how that works in detail, or how that would scale to subtrees.
OK, yes we would definitely need to have the hotfixes applied effectively as if they were merged in Linus's tree I think underneath other things.
Quoted 17 lines
Quoted 17 lines
Everything's based on Linus's tree (so no confusion as to which tree), there shouldn't (hopefully) be a huge amount of them, and submaintainers can just potentially find a way to send them direct to mm-next anyway?
Quoted 8 lines
Quoted 3 lines
But am open to learning about what other subsystems in the kernel do...
The TIP tree has a pretty elaborate model of dealing with topic branches, and don't require things to be sent against specific topic branches.
I'll try to understand that model.
OK well, interested to hear about that.
Quoted 7 lines
Quoted 5 lines
But also we should adapt what others do (which I think is very important to learn from obviously) against how mm works in practice.
High review load with many overlapping changes might favour a different approach to a subsystem that looks different from that.
Yeah, but as we said, we discussed, it's all rather complicated and we should move incrementally.
Yup, but some things have to be decided early I think. We can roll back decisions, but some are more costly to roll back than others.
Quoted 5 lines
--
Cheers,David
Thanks, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 10 lines · Lorenzo Stoakes
Quoted 7 lines · David Hildenbrand (Arm)
Quoted 4 lines · Lorenzo Stoakes
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?We'll still have plenty of patch sets that touch files cross trees.
I'm not sure how keeping things in the same tree fixes anything though?
I think there is a misunderstanding. I am more thinking in terms of what the TIP tree does, where you can send patches against the integration branch, or against sub-branches that are maintained by sub-maintainers.
Terminology starts getting tricky.
Quoted 30 lines
You are just changing the _timing_ of when the conflicts happen at the cost of making things way more difficult to manage IMO.
I mean the reductio ad absurdum argument is why isn't all of linux in a single git tree? :)
If what you're saying is true it should be without issue? But I think there would be pretty huge issues...
And the disadvantage is now we have a bunch of sub-maintainers with write access to the key mm tree who could make mistakes and break things, hundreds of topic branches all bundled together, no separation between anything, and no sense of where anything's at.
If you're saying submaintainers manage topic branches (this cycle the ONE tree would have ~400 topic branches right? More if we included versions?) and then independently merge those into the mm-stable tree I think that's going to be a disaster in terms of timing/conflicts/etc.
And you're asking for conflict between submaintainers I think - what if one person merges his thing that then causes conflict for another etc. etc.
With separate trees then decisions can be made by the mm core people as to how to integrate, rather than people unilaterally doing whatever.
And if you're saying submaintainers won't do that, then essentially you're saying no submaintainer tree management at all :) which I think is a a bad idea for a subsystem as busy as mm.
Quoted 5 lines
I think mm is too large now to have everything under one person or a few people.
Separate trees implies division of labour, and then the integration tree can be more of a pure integration tree.
Just to clarify: I don't think everybody should have access to everything. I'm currently trying to figure out which options we have.
TIP has everything in one tree (with sched/ x86/ ... name space sub-branches).
Quoted 16 lines
Quoted 5 lines
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
But what does 'picked up' mean? See above re: concerns.
Quoted 3 lines
This is likely something we'll have to play with to understand what is workable and what not.
Actually, I think we have to decide early - because if you want submaintainers to test out this sub-tree or sub-branch? Or whatever thing it's very different asking them to:
Quoted 7 lines
- Create a new tree and do X, Y and Z to sync up with mm-next
Vs.:
- Have full write access to mm-next and create branches X, Y and Z and merge things
Right, let me figure what's actually possible so we can discuss if the sub-branch model even makes sense.
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
I mean, is there any meaning to separate 'trees' at all if we just have one tree with topic branches in?
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Or are we going to have several parallel stable branches in one tree, and a bunch of maintainers with write access stepping on each other's toes?
All valid question to which we don't have an answer yet. :)
:) I mean learning from how others do it is definitely key here.
Maybe we need to grill Brauner?
Yes, already reached out :)
Signature · 3 lines
Cheers, David
Vlastimil Babka (SUSE)
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to David Hildenbrand (Arm)Quoted 13 lines · David Hildenbrand (Arm)
Quoted 11 lines · Lorenzo Stoakes
Quoted 6 lines · David Hildenbrand (Arm)
Quoted 3 lines · Lorenzo Stoakes
I think life will be easier with submaintainer separate trees for this honestly :) or it could become a horrible mess in one tree I think.
Requiring contributors to submit stuff targeted at some random trees is madness :)
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?
Quoted 5 lines
We'll still have plenty of patch sets that touch files cross trees.
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
The problem is that the patches would not be applied on top of the integration tree, so it doesn't make sense to base them on it in the first place. Unless they target the next cycle, where the integration tree would first become part of rc1, which would be the new base for all the submaintainer trees.
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 13 lines · Vlastimil Babka (SUSE)
Quoted 11 lines · David Hildenbrand (Arm)
Quoted 4 lines · Lorenzo Stoakes
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?We'll still have plenty of patch sets that touch files cross trees.
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
Quoted 5 lines
The problem is that the patches would not be applied on top of the integration tree, so it doesn't make sense to base them on it in the first place. Unless they target the next cycle, where the integration tree would first become part of rc1, which would be the new base for all the submaintainer trees.
Why does that matter?
For example, the slab-next tree gets merged into the mm-next tree. Submitter will send against mm-next.
The slab maintainer will cherry-pick the patches on top of slab-next. From where they end up in mm-next.
In the rare event of conflicts, the base-commit ID is there and known. If it's too much of a mess, we could ask to resend against the slab-next tree.
Again, TIP allows that. For example, I never based any x86/mm patch on x86/mm and ... was fine? :)
Signature · 3 lines
Cheers, David
Vlastimil Babka (SUSE)
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 14 lines · David Hildenbrand (Arm)
Quoted 13 lines · Vlastimil Babka (SUSE)
Quoted 11 lines · David Hildenbrand (Arm)
Quoted 4 lines · Lorenzo Stoakes
Err what? The 'random' tree is the
MAINTAINERSentry you are targeting, it's based on the mm-next stable branch and only diverges in the work that's been done specific to the subtree, what's crazy exactly?We'll still have plenty of patch sets that touch files cross trees.
I don't see the problem of sending stuff against the integration tree from where it can just be cleanly picked up by sub-maintainers (after all, that's where all the subtrees were integrated against)? Or what exactly is the problem with that?
Quoted 6 lines
Quoted 5 lines
The problem is that the patches would not be applied on top of the integration tree, so it doesn't make sense to base them on it in the first place. Unless they target the next cycle, where the integration tree would first become part of rc1, which would be the new base for all the submaintainer trees.
Why does that matter?
Well, as longs as there are no conflicts, it probably doesn't.
Quoted 5 lines
For example, the slab-next tree gets merged into the mm-next tree. Submitter will send against mm-next.
The slab maintainer will cherry-pick the patches on top of slab-next. From where they end up in mm-next.
Note slab-next itself might be a collection of topic branches and it might be more flexible to create another topic branch (based on rc1) and merge it, than apply stuff on top of a product of merging.
(I think extreme case if vfs where almost everything is topic branch and even the PRs to Linus are many separate branches?)
Quoted 2 lines
In the rare event of conflicts, the base-commit ID is there and known. If it's too much of a mess, we could ask to resend against the slab-next tree.
Alright, I guess some conflicts might be harder to resolve when based on mm-next and then tried to rebase on slab-next only. And others harder to resolve when based on rc1 and then integrated to slab-next.
Quoted 3 lines
Again, TIP allows that. For example, I never based any x86/mm patch on x86/mm and ... was fine? :)
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 11 lines · Vlastimil Babka (SUSE)
Quoted 8 lines · David Hildenbrand (Arm)
Quoted 6 lines · Vlastimil Babka (SUSE)
The problem is that the patches would not be applied on top of the integration tree, so it doesn't make sense to base them on it in the first place. Unless they target the next cycle, where the integration tree would first become part of rc1, which would be the new base for all the submaintainer trees.
Why does that matter?
Well, as longs as there are no conflicts, it probably doesn't.
Yes.
Quoted 10 lines
Quoted 6 lines
For example, the slab-next tree gets merged into the mm-next tree. Submitter will send against mm-next.
The slab maintainer will cherry-pick the patches on top of slab-next. From where they end up in mm-next.
Note slab-next itself might be a collection of topic branches and it might be more flexible to create another topic branch (based on rc1) and merge it, than apply stuff on top of a product of merging.
Right, and I assume that the maintainer would then either try to fix it up himself, or ask the submitter to base against a specific branch. (e.g., against another topic branch etc).
I assume one can go crazy with topic branches. Fortunately, we can do that incrementally IIUC.
Quoted 3 lines
(I think extreme case if vfs where almost everything is topic branch and even the PRs to Linus are many separate branches?)
Yes, that's also one thing TBD.
Signature · 3 lines
Cheers, David
Re: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 22 lines · On Tue, 2 Jun 2026 15:16:27 +0200 "David Hildenbrand (Arm)" <[email protected]>…
Quoted 11 lines · Vlastimil Babka (SUSE)
Quoted 8 lines · David Hildenbrand (Arm)
Quoted 6 lines · Vlastimil Babka (SUSE)
The problem is that the patches would not be applied on top of the integration tree, so it doesn't make sense to base them on it in the first place. Unless they target the next cycle, where the integration tree would first become part of rc1, which would be the new base for all the submaintainer trees.
Why does that matter?
Well, as longs as there are no conflicts, it probably doesn't.
Yes.
Quoted 7 lines
Quoted 6 lines
For example, the slab-next tree gets merged into the mm-next tree. Submitter will send against mm-next.
The slab maintainer will cherry-pick the patches on top of slab-next. From where they end up in mm-next.
Quoted 7 lines
Quoted 3 lines
Note slab-next itself might be a collection of topic branches and it might be more flexible to create another topic branch (based on rc1) and merge it, than apply stuff on top of a product of merging.
Right, and I assume that the maintainer would then either try to fix it up himself, or ask the submitter to base against a specific branch. (e.g., against another topic branch etc).
So I understand we agree we will allow peoplee to base their patches on whatever makes sense. I like this flexibility. The slight difference I show is that David suggests to use mm-next as the default baseline, and later rebase on subcomponent tree if needed. Meanwhile, some subcomponent maintainers think the opposite direction make sense. Submitter use the appropriate subcomponent maintainer-suggested tree as the default, and the submaintainers handle merge conflicts of their for-mm-next branch.
I think both could work, and we will learn from trying.
But from a subcomponent maintainer's persepctive, I was thnking our process will be more like the second approach. And I still slightly feeling that will be simpler for at least a subcomponent maintainer. Why I feel so is like below.
In the first approach, as Vlastimil and David described already, there are chances of conflicts at picking mm-next based submitter's patch on subcomponent tree. How frequenct and complex the conflicts will be is questionable. But it feels like I will have to deal it with submitters. E.g., asking rebase to submitters, like David mentioned. I think some of submitters might not very familiar with git and the mm process, so I feel it might be not very simple always.
In the second appraoch, I expect less chances of conflicts when picking submitter patches on subcomponent trees. The subcomponent maintainer will still get conflicts with mm-next and have to fix it. But in this case, the subcomponent maintainer will be able to do that nearly alone. Or, they will work with the mm-next maintainer and/or other subcomponent maintainers. I pretty suree the other maintainers will be familiar with git and the process. So I expect less headaches. Also, this kind of conflict resolving between subcomponent maintainer and mm-next trees is samely required for the first approach, anyway.
mm-next maintainer's perspective might see many different things, though. I will be more than glad to be learn what I'm missing and get enlightened.
Anyway I think both approaches may work, and we can learn from others and trying on our own. I will be happy to help when there is something that I can help. :)
Thanks,
SJ
[...]
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 18 lines · SeongJae Park
Quoted 8 lines · On Tue, 2 Jun 2026 15:16:27 +0200 "David Hildenbrand (Arm)" <[email protected]>…
Quoted 2 lines · Vlastimil Babka (SUSE)
Well, as longs as there are no conflicts, it probably doesn't.
Yes.
Quoted 2 lines
Quoted 7 lines
Quoted 3 lines
Note slab-next itself might be a collection of topic branches and it might be more flexible to create another topic branch (based on rc1) and merge it, than apply stuff on top of a product of merging.
Right, and I assume that the maintainer would then either try to fix it up himself, or ask the submitter to base against a specific branch. (e.g., against another topic branch etc).
Quoted 7 lines
So I understand we agree we will allow peoplee to base their patches on whatever makes sense. I like this flexibility. The slight difference I show is that David suggests to use mm-next as the default baseline, and later rebase on subcomponent tree if needed. Meanwhile, some subcomponent maintainers think the opposite direction make sense. Submitter use the appropriate subcomponent maintainer-suggested tree as the default, and the submaintainers handle merge conflicts of their for-mm-next branch.
I assume, in practice, that people will do what they want either way (base on Linus tree, linux-next etc), and it will be our job to see if it cleanly applies, or ask for a proper resend.
I guess, as a first step, we'll document something similar to what TIP documents in that regard.
Quoted 16 lines
I think both could work, and we will learn from trying.
But from a subcomponent maintainer's persepctive, I was thnking our process will be more like the second approach. And I still slightly feeling that will be simpler for at least a subcomponent maintainer. Why I feel so is like below.
In the first approach, as Vlastimil and David described already, there are chances of conflicts at picking mm-next based submitter's patch on subcomponent tree. How frequenct and complex the conflicts will be is questionable. But it feels like I will have to deal it with submitters. E.g., asking rebase to submitters, like David mentioned. I think some of submitters might not very familiar with git and the mm process, so I feel it might be not very simple always.
Quoted 9 lines
In the second appraoch, I expect less chances of conflicts when picking submitter patches on subcomponent trees. The subcomponent maintainer will still get conflicts with mm-next and have to fix it. But in this case, the subcomponent maintainer will be able to do that nearly alone. Or, they will work with the mm-next maintainer and/or other subcomponent maintainers. I pretty suree the other maintainers will be familiar with git and the process. So I expect less headaches. Also, this kind of conflict resolving between subcomponent maintainer and mm-next trees is samely required for the first approach, anyway.
I'm sure we'll figure out how bad one approach or the other is as we move forward, we can always adjust that. Conflicts will haunt us :)
But I assume, independent of what we document, we will always have people that submit to arbitrary trees, and it will be out job to make sense of it (or ask to resend).
Documentation is good, as long as people read it ...
Quoted 7 lines
mm-next maintainer's perspective might see many different things, though. I will be more than glad to be learn what I'm missing and get enlightened.
Anyway I think both approaches may work, and we can learn from others and trying on our own. I will be happy to help when there is something that I can help. :)
That's the right spirit! :)
We'll discuss this topic in more detail as we move forward!
Signature · 3 lines
Cheers, David
Re: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 4 lines · On Fri, 5 Jun 2026 17:24:25 +0200 "David Hildenbrand (Arm)" <[email protected]>…
Quoted 3 lines · SeongJae Park
Quoted 1 line · On Tue, 2 Jun 2026 15:16:27 +0200 "David Hildenbrand (Arm)" <[email protected]>…
On 6/2/26 15:08, Vlastimil Babka (SUSE) wrote:
[...]
Quoted 2 lines
I guess, as a first step, we'll document something similar to what TIP documents in that regard.
Sounds like a good plan :)
[...]
Quoted 8 lines
I'm sure we'll figure out how bad one approach or the other is as we move forward, we can always adjust that. Conflicts will haunt us :)
But I assume, independent of what we document, we will always have people that submit to arbitrary trees, and it will be out job to make sense of it (or ask to resend).
Documentation is good, as long as people read it ...
Agreed. Nonetheless, even when people don't read it, it helps us typing less, since we can give them a link to the doc instead of repeatedly explaining the details. And thankfully some people do read it when we gie the link. At least a few contribution guides in DAMON maintainer entry document [1] helped me in the way.
Quoted 5 lines
Quoted 5 lines
mm-next maintainer's perspective might see many different things, though. I will be more than glad to be learn what I'm missing and get enlightened.
Quoted 7 lines
Quoted 3 lines
Anyway I think both approaches may work, and we can learn from others and trying on our own. I will be happy to help when there is something that I can help. :)
That's the right spirit! :)
We'll discuss this topic in more detail as we move forward!
Fully agreed, and appreciate your effort on this!
[1] https://origin.kernel.org/doc/html/latest/mm/damon/maintainer-profile.html
Thanks,
SJ
[...]
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
In reply to Vlastimil Babka (SUSE)[sorry busy with many things so took a while to get back to this]
Quoted 23 lines · Vlastimil Babka (SUSE)
Quoted 22 lines · Lorenzo Stoakes
[trimmed cc list to avoid noise, apologies if I excluded anybody who is interested in this!]
Quoted 18 lines · David Hildenbrand (Arm)
Quoted 5 lines · Nico Pache
Quoted 3 lines · Vlastimil Babka (SUSE)
Quoted 1 line · Nico Pache
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
But why? That branch is for hotfixes that would go to the current 7.1-rcX series. mm-unstable would be the correct one for this, AFAICT.
Sorry this was a misunderstanding. The goal here was to base this off the closest base commit behind where my v17 already lies in the tree.
Ah, I guess this is a problem of "v17 is already in mm-unstable, so against what to base v18".
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Yeah, we touched on that problem in the LSF/MM process discussion ...
I may be misremembering but... :) [correct me if wrong]:
Wasn't the general conclusion that we maintain a stable branch (Linus's tree + stuff that's been reviewed and is locked in for next release),
This I think basically yes.
I think it's _vital_ to have this one source of truth, and for that to be what goes to linux-next, then eventually Linus.
I think sending stuff that's still unstable to linux-next, while it gets early testing, is more problematic than helpful overall.
And us improving testing in mm-new can mean we get some meaningful testing involved (AI review bots helping also).
(Also Linus said linux-next doesn't get tested all that much anyway :P)
Quoted 6 lines
Quoted 3 lines
and have people
base work against that?This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those.
I feel like it could get hairy pretty quick, but I guess the key thing here is - maintainers resolve merge conflicts.
As long as we have a specific _solid_ basis for work.
I think actually this speaks to it being sensible for each submaintainer with a separate tree to maintain their own repos rather than branches.
We need to determine what this baseline would be for each tree though.
So perhaps each submaintainer tree has for-mm-next that's the stable branch from mm-next + any stabliised local changes.
And each week this gets merged to mm-next, and everybody resets to mm-next stable branch?
Quoted 10 lines
But it's not a good base for work targeting the same merge window, as that work would likely go to one of those submaintainer trees. But then it can't be based on the result of merge of all submaintainer trees. That could only work for patches targetting the next cycle (after the stable branch becomes part of rc1).
So either patches can be based on rc1 and applied as topic branches in a submaintainer tree and then merged, or if they really depend on something already in a submaintainer tree, then based on the respective topic branch that's part of it.
OK so topic branches = series people have submitted?
I did wonder if we could somehow maintain the separate versions too so we could diff between them easily also...
And yeah it makes sense, if your series TRULY has a dependency on another, to base that on the topic branch.
Quoted 11 lines
Quoted 2 lines
This would be 'source of truth' and what we eventually send to Linus.
Yes.
Quoted 2 lines
In that world, the maintainers perform conflict resolution, but with git rerere we need only do this once.
I think the conflicts would arise from merging the submaintainers' branches to the mm-next tree, and if they get updated and the merges are recreated (like linux-next works) git rerere avoids resolving the same conflicts again.
Yes they could arise there, and if we use the model mentioned above with each submaintainer tree having its own for-mm-next branch, then when that gets reset to mm-next it could cause conflicts for topic branches etc.
But then that would not be a repeatable resolution I suppose.
But would updates really be a thing though in general? If it's for-mm-next [submaintainer tree] -> mm-stable [mm-next] each time, then there cannot be further updates as those are the finalised commits right?
Quoted 2 lines
Hm like Andrew said, this needs a diagram indeed :)
Yes, am happy to draw/document something when we finalise things.
Cheers, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 14 lines
Quoted 5 lines
Quoted 2 lines
and have people
base work against that?This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those.
I feel like it could get hairy pretty quick, but I guess the key thing here is - maintainers resolve merge conflicts.
As long as we have a specific _solid_ basis for work.
I think actually this speaks to it being sensible for each submaintainer with a separate tree to maintain their own repos rather than branches.
Quoted 7 lines
We need to determine what this baseline would be for each tree though.
So perhaps each submaintainer tree has for-mm-next that's the stable branch from mm-next + any stabliised local changes.
And each week this gets merged to mm-next, and everybody resets to mm-next stable branch?
I think it gets way more complicated than that once we involve hotfix branches, and dependencies between hotfixes, topic branches and all of that. And in particular, if we have to drop a topic branch in some circumstances.
My first step will be to understand "how would it look like without submaintainers" when only having topic branches.
Then, add a complexity level on top with subcomonent maintainers :)
I'll probably schedule a session in 2 weeks.
Whom to invite?
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 26 lines · David Hildenbrand (Arm)
Quoted 14 lines
Quoted 5 lines
Quoted 2 lines
and have people
base work against that?This I'm not so sure how it would work. Assuming we have submaintainers with their trees and branches, the final "stable branch" is merged from those.
I feel like it could get hairy pretty quick, but I guess the key thing here is - maintainers resolve merge conflicts.
As long as we have a specific _solid_ basis for work.
I think actually this speaks to it being sensible for each submaintainer with a separate tree to maintain their own repos rather than branches.
Quoted 7 lines
We need to determine what this baseline would be for each tree though.
So perhaps each submaintainer tree has for-mm-next that's the stable branch from mm-next + any stabliised local changes.
And each week this gets merged to mm-next, and everybody resets to mm-next stable branch?
I think it gets way more complicated than that once we involve hotfix branches, and dependencies between hotfixes, topic branches and all of that. And in particular, if we have to drop a topic branch in some circumstances.
Quoted 8 lines
My first step will be to understand "how would it look like without submaintainers" when only having topic branches.
Then, add a complexity level on top with subcomonent maintainers :)
I'll probably schedule a session in 2 weeks.
Whom to invite?
I guess can look at the list of current, active, involved submaintainers?
Can also send a general mail to linux-mm about it too?
Quoted 5 lines
--
Cheers,David
Cheers, Lorenzo
David Hildenbrand (Arm)
maintainerRe: Process (was Re: [PATCH mm-hotfixes-unstable v18 00/14] khugepaged: add mTHP) collapse support
Quoted 27 lines · Lorenzo Stoakes
Quoted 26 lines · David Hildenbrand (Arm)
Quoted 9 lines
I feel like it could get hairy pretty quick, but I guess the key thing here is - maintainers resolve merge conflicts.
As long as we have a specific _solid_ basis for work.
I think actually this speaks to it being sensible for each submaintainer with a separate tree to maintain their own repos rather than branches.
Quoted 7 lines
We need to determine what this baseline would be for each tree though.
So perhaps each submaintainer tree has for-mm-next that's the stable branch from mm-next + any stabliised local changes.
And each week this gets merged to mm-next, and everybody resets to mm-next stable branch?
I think it gets way more complicated than that once we involve hotfix branches, and dependencies between hotfixes, topic branches and all of that. And in particular, if we have to drop a topic branch in some circumstances.
My first step will be to understand "how would it look like without submaintainers" when only having topic branches.
Then, add a complexity level on top with subcomonent maintainers :)
Quoted 7 lines
Quoted 3 lines
I'll probably schedule a session in 2 weeks.
Whom to invite?
I guess can look at the list of current, active, involved submaintainers?
Can also send a general mail to linux-mm about it too?
Yes, let me do that.
Signature · 3 lines
Cheers, David
Lorenzo Stoakes
reviewerQuoted 4 lines · Nico Pache
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
It's not ok, this isn't suitable for a hotfix in any way shape or form?
As you know, because we told you :) May has been difficult because of conferences, holidays (and in my case burnout recovery).
And unfortunately the series seems to have needed quite a bit of review again (my suggestion to you would be to ensure you don't make major changes, only small incremental ones on the basis of review feedback).
So this isn't viable for 7.2, and we'll have to target 7.3. Therefore there was no rush.
Also please don't spring a respin on this series on us without discussion first, with people away and (frankly) the amount of work involved here, you're going to have to accept the pace that workload/availability permits.
Adding spurious hotfixes tags doesn't help anything :) please don't do that again.
Thanks, Lorenzo
Quoted 19 lines · Lorenzo Stoakes
Quoted 4 lines · Nico Pache
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
It's not ok, this isn't suitable for a hotfix in any way shape or form?
As you know, because we told you :) May has been difficult because of conferences, holidays (and in my case burnout recovery).
And unfortunately the series seems to have needed quite a bit of review again (my suggestion to you would be to ensure you don't make major changes, only small incremental ones on the basis of review feedback).
So this isn't viable for 7.2, and we'll have to target 7.3. Therefore there was no rush.
Quoted 6 lines
Also please don't spring a respin on this series on us without discussion first, with people away and (frankly) the amount of work involved here, you're going to have to accept the pace that workload/availability permits.
Adding spurious hotfixes tags doesn't help anything :) please don't do that again.
Hi,
Sorry for the confusion but Andrew and I spoke about this before I sent it, and he confirmed that I should send it against this tree to prevent merge conflicts.
Because Zi's series depends on this, and this is already in the mm tree, choosing a candidate before my commits was best to prevent merge conflicts.
The intent wasn't that this is a hotfix, just that this was the closest base before the v17 that is already in the tree.
Sorry for the confusion, hopefully Andrew can still apply it to the correct tree.
-- Nico
Quoted 3 lines
Thanks, Lorenzo
Lorenzo Stoakes
reviewerQuoted 29 lines · Nico Pache
Quoted 19 lines · Lorenzo Stoakes
Quoted 4 lines · Nico Pache
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
It's not ok, this isn't suitable for a hotfix in any way shape or form?
As you know, because we told you :) May has been difficult because of conferences, holidays (and in my case burnout recovery).
And unfortunately the series seems to have needed quite a bit of review again (my suggestion to you would be to ensure you don't make major changes, only small incremental ones on the basis of review feedback).
So this isn't viable for 7.2, and we'll have to target 7.3. Therefore there was no rush.
Quoted 6 lines
Also please don't spring a respin on this series on us without discussion first, with people away and (frankly) the amount of work involved here, you're going to have to accept the pace that workload/availability permits.
Adding spurious hotfixes tags doesn't help anything :) please don't do that again.
Hi,
Quoted 7 lines
Sorry for the confusion but Andrew and I spoke about this before I sent it, and he confirmed that I should send it against this tree to prevent merge conflicts.
Because Zi's series depends on this, and this is already in the mm tree, choosing a candidate before my commits was best to prevent merge conflicts.
There's some kind of confusion here.
This series isn't suited for 7.2.
Sorry but Zi's series, unless it depends on functionality here, will have to be rebased.
People have been at conferences, people have been on leave, I've had to pace myself for health reasons and it seems there's been more than simply review comment-based changes happening here.
(Again I strongly encourage, at this stage, to ONLY be making changes based on review, not adding ANYTHING else or changing ANYTHING else to avoid delays :)
Also - shouldn't mm-unstable already have mm-hotfixes-unstable in it?
I think in mm-next we will have an stable branch, that everything is based on, where things go once review is complete and things are mergeable.
And a separate hotfixes branch based on Linus's tree.
That would avoid issues like this :)
Quoted 3 lines
The intent wasn't that this is a hotfix, just that this was the closest base before the v17 that is already in the tree.
The convention is that [PATCH ... <branch>] indicates the target of the changes. Putting the hotfixes branch there implies it's a hotfix.
So please be careful with that in future :)
Quoted 3 lines
Sorry for the confusion, hopefully Andrew can still apply it to the correct tree.
I'm not even sure what's best for that at this stage given we have conflicts and this has to be delayed until 7.3.
I wonder if given that we should not have this in mm-unstable at all and just wait it out until the next cycle begins? Review can happen concurrently.
Quoted 7 lines
-- Nico
Quoted 3 lines
Thanks, Lorenzo
Thanks, Lorenzo
Quoted 46 lines · Lorenzo Stoakes
Quoted 29 lines · Nico Pache
Quoted 19 lines · Lorenzo Stoakes
Quoted 4 lines · Nico Pache
Whoops I manually changed the coverletter subject to reflect that this in on mm-hotfixes-unstable but never updated the others...
Hopefully that is ok. Just a small mistake. Base commit is referenced here.
It's not ok, this isn't suitable for a hotfix in any way shape or form?
As you know, because we told you :) May has been difficult because of conferences, holidays (and in my case burnout recovery).
And unfortunately the series seems to have needed quite a bit of review again (my suggestion to you would be to ensure you don't make major changes, only small incremental ones on the basis of review feedback).
So this isn't viable for 7.2, and we'll have to target 7.3. Therefore there was no rush.
Quoted 6 lines
Also please don't spring a respin on this series on us without discussion first, with people away and (frankly) the amount of work involved here, you're going to have to accept the pace that workload/availability permits.
Adding spurious hotfixes tags doesn't help anything :) please don't do that again.
Hi,
Quoted 7 lines
Sorry for the confusion but Andrew and I spoke about this before I sent it, and he confirmed that I should send it against this tree to prevent merge conflicts.
Because Zi's series depends on this, and this is already in the mm tree, choosing a candidate before my commits was best to prevent merge conflicts.
There's some kind of confusion here.
This series isn't suited for 7.2.
Sorry but Zi's series, unless it depends on functionality here, will have to be rebased.
Quoted 7 lines
People have been at conferences, people have been on leave, I've had to pace myself for health reasons and it seems there's been more than simply review comment-based changes happening here.
(Again I strongly encourage, at this stage, to ONLY be making changes based on review, not adding ANYTHING else or changing ANYTHING else to avoid delays :)
All the changes are based on review points. Very small changes in this version; the largest being the one that you specifically argeed too.
Quoted 9 lines
Also - shouldn't mm-unstable already have mm-hotfixes-unstable in it?
I think in mm-next we will have an stable branch, that everything is based on, where things go once review is complete and things are mergeable.
And a separate hotfixes branch based on Linus's tree.
That would avoid issues like this :)
Im sorry im new to this, but I really dont think this tiny error, and something that I'd confirmed with Andrew beforehand deserves NAKing and defering it. Ive worked through my PTO to clean up some of these review nits just to get it in 7.2. I even through this through my rounds of testing today before resending.
Quoted 7 lines
Quoted 4 lines
The intent wasn't that this is a hotfix, just that this was the closest base before the v17 that is already in the tree.
The convention is that [PATCH ... <branch>] indicates the target of the changes. Putting the hotfixes branch there implies it's a hotfix.
Sorry I thought the <branch> was what base you used.
Quoted 2 lines
So please be careful with that in future :)
Yes will do for sure.
Quoted 11 lines
Quoted 4 lines
Sorry for the confusion, hopefully Andrew can still apply it to the correct tree.
I'm not even sure what's best for that at this stage given we have conflicts and this has to be delayed until 7.3.
I wonder if given that we should not have this in mm-unstable at all and just wait it out until the next cycle begins? Review can happen concurrently.
I still dont see why this has to be deferred, I was working with Andrew to prevent merge headaches.
-- Nico
Quoted 11 lines
Quoted 8 lines
-- Nico
Quoted 3 lines
Thanks, Lorenzo
Thanks, Lorenzo
Lorenzo Stoakes
reviewerQuoted 12 lines · Nico Pache
Quoted 11 lines · Lorenzo Stoakes
There's some kind of confusion here.
This series isn't suited for 7.2.
Sorry but Zi's series, unless it depends on functionality here, will have to be rebased.
People have been at conferences, people have been on leave, I've had to pace myself for health reasons and it seems there's been more than simply review comment-based changes happening here.
Quoted 6 lines
Quoted 3 lines
(Again I strongly encourage, at this stage, to ONLY be making changes based on review, not adding ANYTHING else or changing ANYTHING else to avoid delays :)
All the changes are based on review points. Very small changes in this version; the largest being the one that you specifically argeed too.
16->17
Documentation/admin-guide/mm/transhuge.rst | 24 +++++------------- include/linux/khugepaged.h | 7 ++--- include/trace/events/huge_memory.h | 3 ++- mm/huge_memory.c | 2 +- mm/khugepaged.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------ mm/vma.c | 6 ++--- tools/testing/vma/include/stubs.h | 3 ++- 7 files changed, 103 insertions(+), 110 deletions(-)
17->18
Documentation/admin-guide/mm/transhuge.rst | 5 +++-- include/trace/events/huge_memory.h | 3 +-- mm/khugepaged.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------- 3 files changed, 66 insertions(+), 63 deletions(-)
These are not small 'very small changes'.
We're nearly at rc-5, and this is a major, invasive, dangerous change that we have to get right.
You've also made changes unrelated to review, repeatedly, throughout this process, which as I've told you, is causing delays.
You've also throughout the review of this series done stuff like make MAJOR changes to things and _kept review tags_.
You're forcing us to use git range-diff etc. to forensically check that the series is what is claimed.
Dude I mean you switched to using // comment style which is not used in mm anywhere for instance? Don't do things like that and complain about delays. Honestly.
Also, again, LSF happened. Other confeerences happened. Bandwidth is reduced.
So again, I'm sorry, but you've been hit with some bad luck here.
I really wanted this in for 7.2, and I feel bad that we couldn't make it, but you're also doing thing that's making it difficult for us.
I've spent double-digits hours on your series, and I've also had work pushed out becasue of that leading me to work evenings and weekends as a result.
And I'm not even going to get any credit for it :))
So while I sypmathise, really, please have empathy and realise it goes both ways, please.
I'm not being mean for the sake of it, I'm pushing back because I feel this is not at a stage where I'd feel confident in this being merged at this time.
And it's very much a regret, as I _really_ wanted us to have it in this time. But life and circumstances and the issues mentioned above have intervened, sadly.
Quoted 9 lines
Quoted 9 lines
Also - shouldn't mm-unstable already have mm-hotfixes-unstable in it?
I think in mm-next we will have an stable branch, that everything is based on, where things go once review is complete and things are mergeable.
And a separate hotfixes branch based on Linus's tree.
Quoted 7 lines
Quoted 1 line
That would avoid issues like this :)
Im sorry im new to this, but I really dont think this tiny error, and something that I'd confirmed with Andrew beforehand deserves NAKing and defering it. Ive worked through my PTO to clean up some of these review nits just to get it in 7.2. I even through this through my rounds of testing today before resending.
The issue wasn't the error (though it wasn't tiny...!), it's the state of review. There was fresh review comments from a few days ago, and there's big diffs between revisions.
You've also made unrelated changes as you have done throughout the series.
As I said above, I'm sorry that you spent time in your PTO on this, but we cannot rush this in when things are not clearly ready yet, and I am not confident in this being ready at this stage.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
The intent wasn't that this is a hotfix, just that this was the closest base before the v17 that is already in the tree.
The convention is that [PATCH ... <branch>] indicates the target of the changes. Putting the hotfixes branch there implies it's a hotfix.
Sorry I thought the <branch> was what base you used.
I mean, sure there's clearly confusion here as you sent [PATCH 7.2 v16 ...] (against an unreleased kernel version) then a branch specifier then the hotfixes one...
Anyway sure, it's fine, I've made vastly more dumb mistakes than that myself, nobody minds, but it's concerning as by convention [PATCH ... <mm->hotfixes<whatever>] generally is taken to mean 'please rush this to hotfixes!' :)
So be careful with that please!
Quoted 5 lines
Quoted 3 lines
So please be careful with that in future :)
Yes will do for sure.
Thanks!
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Sorry for the confusion, hopefully Andrew can still apply it to the correct tree.
I'm not even sure what's best for that at this stage given we have conflicts and this has to be delayed until 7.3.
Quoted 6 lines
Quoted 3 lines
I wonder if given that we should not have this in mm-unstable at all and just wait it out until the next cycle begins? Review can happen concurrently.
I still dont see why this has to be deferred, I was working with Andrew to prevent merge headaches.
I've explained the why above, and David and I co-maintain THP so I feel that ultimately given the blood, sweat and tears we've put into THP review we ought to have some input on this :)
Thanks, Lorenzo
Lorenzo Stoakes
reviewerNico,
While I stand by the below, and we very well might wish to delay this until the next cycle, I will try to take some time to go through this myself as soon as I am able.
If David's happy with it for this cycle, and I don't find anything too crazy, then it's not impossible we could still move forward with it now.
My only aim here is to avoid rushing something in that might have unexpected changes or issues in it, given how late in the cycle we are :)
Cheers, Lorenzo
Quoted 159 lines · Lorenzo Stoakes
Quoted 12 lines · Nico Pache
Quoted 11 lines · Lorenzo Stoakes
There's some kind of confusion here.
This series isn't suited for 7.2.
Sorry but Zi's series, unless it depends on functionality here, will have to be rebased.
People have been at conferences, people have been on leave, I've had to pace myself for health reasons and it seems there's been more than simply review comment-based changes happening here.
Quoted 6 lines
Quoted 3 lines
(Again I strongly encourage, at this stage, to ONLY be making changes based on review, not adding ANYTHING else or changing ANYTHING else to avoid delays :)
All the changes are based on review points. Very small changes in this version; the largest being the one that you specifically argeed too.
16->17
Documentation/admin-guide/mm/transhuge.rst | 24 +++++------------- include/linux/khugepaged.h | 7 ++--- include/trace/events/huge_memory.h | 3 ++- mm/huge_memory.c | 2 +- mm/khugepaged.c | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------ mm/vma.c | 6 ++--- tools/testing/vma/include/stubs.h | 3 ++- 7 files changed, 103 insertions(+), 110 deletions(-)17->18
Documentation/admin-guide/mm/transhuge.rst | 5 +++-- include/trace/events/huge_memory.h | 3 +-- mm/khugepaged.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------- 3 files changed, 66 insertions(+), 63 deletions(-)These are not small 'very small changes'.
We're nearly at rc-5, and this is a major, invasive, dangerous change that we have to get right.
You've also made changes unrelated to review, repeatedly, throughout this process, which as I've told you, is causing delays.
You've also throughout the review of this series done stuff like make MAJOR changes to things and
_keptreviewtags_.You're forcing us to use git range-diff etc. to forensically check that the series is what is claimed.
Dude I mean you switched to using // comment style which is not used in mm anywhere for instance? Don't do things like that and complain about delays. Honestly.
Also, again, LSF happened. Other confeerences happened. Bandwidth is reduced.
So again, I'm sorry, but you've been hit with some bad luck here.
I really wanted this in for 7.2, and I feel bad that we couldn't make it, but you're also doing thing that's making it difficult for us.
I've spent double-digits hours on your series, and I've also had work pushed out becasue of that leading me to work evenings and weekends as a result.
And I'm not even going to get any credit for it :))
So while I sypmathise, really, please have empathy and realise it goes both ways, please.
I'm not being mean for the sake of it, I'm pushing back because I feel this is not at a stage where I'd feel confident in this being merged at this time.
And it's very much a regret, as I _really_ wanted us to have it in this time. But life and circumstances and the issues mentioned above have intervened, sadly.
Quoted 9 lines
Quoted 9 lines
Also - shouldn't mm-unstable already have mm-hotfixes-unstable in it?
I think in mm-next we will have an stable branch, that everything is based on, where things go once review is complete and things are mergeable.
And a separate hotfixes branch based on Linus's tree.
Quoted 7 lines
Quoted 1 line
That would avoid issues like this :)
Im sorry im new to this, but I really dont think this tiny error, and something that I'd confirmed with Andrew beforehand deserves NAKing and defering it. Ive worked through my PTO to clean up some of these review nits just to get it in 7.2. I even through this through my rounds of testing today before resending.
The issue wasn't the error (though it wasn't tiny...!), it's the state of review. There was fresh review comments from a few days ago, and there's big diffs between revisions.
You've also made unrelated changes as you have done throughout the series.
As I said above, I'm sorry that you spent time in your PTO on this, but we cannot rush this in when things are not clearly ready yet, and I am not confident in this being ready at this stage.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
The intent wasn't that this is a hotfix, just that this was the closest base before the v17 that is already in the tree.
The convention is that [PATCH ... <branch>] indicates the target of the changes. Putting the hotfixes branch there implies it's a hotfix.
Sorry I thought the <branch> was what base you used.
I mean, sure there's clearly confusion here as you sent [PATCH 7.2 v16 ...] (against an unreleased kernel version) then a branch specifier then the hotfixes one...
Anyway sure, it's fine, I've made vastly more dumb mistakes than that myself, nobody minds, but it's concerning as by convention [PATCH ... <mm->hotfixes<whatever>] generally is taken to mean 'please rush this to hotfixes!' :)
So be careful with that please!
Quoted 5 lines
Quoted 3 lines
So please be careful with that in future :)
Yes will do for sure.
Thanks!
Quoted 9 lines
Quoted 9 lines
Quoted 5 lines
Sorry for the confusion, hopefully Andrew can still apply it to the correct tree.
I'm not even sure what's best for that at this stage given we have conflicts and this has to be delayed until 7.3.
Quoted 6 lines
Quoted 3 lines
I wonder if given that we should not have this in mm-unstable at all and just wait it out until the next cycle begins? Review can happen concurrently.
I still dont see why this has to be deferred, I was working with Andrew to prevent merge headaches.
I've explained the why above, and David and I co-maintain THP so I feel that ultimately given the blood, sweat and tears we've put into THP review we ought to have some input on this :)
Thanks, Lorenzo
NAK.
This is not a hotfixes candidate Nico. Don't send a massive series like this with that tag please.
Thanks, Lorenzo
Andrew Morton
maintainerQuoted 2 lines · On Fri, 22 May 2026 08:59:55 -0600 Nico Pache <[email protected]> wrote:
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
Thanks, I've update mm.git's mm-unstable branch to this version.
It sounds like I might be dropping it soon, haven't started looking at that yet. But let's at least eyeball the latest version at this time.
Sashiko was able to apply this, so the base-it-on-hotfixes thing worked well, thanks. The AI checking made a few allegations:
https://sashiko.dev/#/patchset/[email protected]
Quoted 14 lines
V18 Changes:
- Added RBs/Acks
- [patch 02] Guardcount_memcg_folio_eventswithis_pmd_order()to keepTHP_COLLAPSE_ALLOCPMD-only (Usama, Lance)
- [patch 03] Convert C++ comments to C-style; fix "none-page" terminology to "empty PTEs or PTEs mapping the shared zeropage"; drop unnecessary userfaultfd comment; add const to local max_ptes_* variables; fix "repect" typo (Lance, David)
- [patch 04]collapse_max_ptes_none()now returns 0 instead of-EINVALfor unsupported values; removeSCAN_INVALID_PTES_NONE; change return type from int to unsigned int and propagate to all callers; add comment above__collapse_huge_page_swapinexplaining mTHP swap bail-out (David, Lorenzo, Lance, Wei Yang, Usama)
- [patch 05] Rewritecollapse_huge_pagelock comment to David's suggested
Quoted 9 lines
wording (David)
- [patch 11] Propagate unsigned int return type formax_ptes_none; remove the now-unnecessary negative return check (consequence of patch 04); Add optimization to thenext_ordergoto that will prevent unnecessary iterations if there are no lower orders enabled (Vernon); update locking comment; pass VMA tomthp_collapseto improve uffd-armed detection, and prevent unnecessary work. (Wei)
- [patch 14] Update documentation to reflect fallback-to-0 behavior
Below is how v18 altered mm.git.
Quite a lot of it seems to be replacement of "//"-style comments. It's unfortunate that this work isn't separated from the substantive changes. We could have done that with a few followup fixes rather than a wholesale replacement of the series.
Documentation/admin-guide/mm/transhuge.rst | 5 include/trace/events/huge_memory.h | 3 mm/khugepaged.c | 121 +++++++++---------- 3 files changed, 66 insertions(+), 63 deletions(-)
Documentation/admin-guide/mm/transhuge.rst renamed from Documentation/admin-guide/mm/transhuge.rst~b +3 -2
@@ -312,8 +312,9 @@ when collapsing a group of small pages i For PMD-sized THP collapse, this directly limits the number of empty pages allowed in the 2MB region. -For mTHP collapse, only 0 or (HPAGE_PMD_NR - 1) are supported. Any other value -will emit a warning and no mTHP collapse will be attempted. +For mTHP collapse, only 0 or (HPAGE_PMD_NR - 1) are supported. At +HPAGE_PMD_NR - 1, we collapse to the highest possible order. Any intermediate +value will emit a warning and mTHP collapse will default to max_ptes_none=0. A higher value allows more empty pages, potentially leading to more memory usage but better THP performance. A lower value is more conservative and
include/trace/events/huge_memory.h renamed from include/trace/events/huge_memory.h~b +1 -2
@@ -39,8 +39,7 @@ EM( SCAN_STORE_FAILED, "store_failed") \ EM( SCAN_COPY_MC, "copy_poisoned_page") \ EM( SCAN_PAGE_FILLED, "page_filled") \ - EM(SCAN_PAGE_DIRTY_OR_WRITEBACK, "page_dirty_or_writeback") \ - EMe(SCAN_INVALID_PTES_NONE, "invalid_ptes_none") + EMe(SCAN_PAGE_DIRTY_OR_WRITEBACK, "page_dirty_or_writeback")#undef EM#undef EMe
mm/khugepaged.c renamed from mm/khugepaged.c~b +62 -59
244 lines not on this page · raw message
_
Alexander Gordeev
maintainerOn Fri, May 22, 2026 at 01:47:24PM -0700, Andrew Morton wrote:
Hi Andrew et al,
Quoted 5 lines · On Fri, 22 May 2026 08:59:55 -0600 Nico Pache <[email protected]> wrote:
Quoted 3 lines
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
Quoted 7 lines
Thanks, I've update mm.git's mm-unstable branch to this version.
It sounds like I might be dropping it soon, haven't started looking at that yet. But let's at least eyeball the latest version at this time.
Sashiko was able to apply this, so the base-it-on-hotfixes thing worked well, thanks. The AI checking made a few allegations:
This series appears to cause hangs on s390 in linux-next. The issue is not easily reproducible, so it is not yet confirmed. Any ideas for a reliable reproducer that exercises the code path below?
[ 2749.385719] sysrq: Show Blocked State
[ 2749.385730] task:khugepaged state:D stack:0 pid:209 tgid:209 ppid:2 task_flags:0x200040 flags:0x00000000
[ 2749.385735] Call Trace:
[ 2749.385736] [<0000017f63c8b226>] __schedule+0x316/0x890
[ 2749.385740] [<0000017f63c8b7dc>] schedule+0x3c/0xc0
[ 2749.385743] [<0000017f63c8b888>] schedule_preempt_disabled+0x28/0x40
[ 2749.385746] [<0000017f63c902ea>] rwsem_down_write_slowpath+0x2fa/0x8b0
[ 2749.385749] [<0000017f63c90910>] down_write+0x70/0x80
[ 2749.385752] [<0000017f6313407a>] collapse_huge_page+0x2ea/0x9e0
[ 2749.385755] [<0000017f6313491e>] mthp_collapse+0x1ae/0x1f0
[ 2749.385757] [<0000017f63134fda>] collapse_scan_pmd+0x67a/0x8f0
[ 2749.385760] [<0000017f6313751a>] collapse_single_pmd+0x15a/0x260
[ 2749.385762] [<0000017f6313792c>] collapse_scan_mm_slot.constprop.0+0x30c/0x470
[ 2749.385765] [<0000017f63137cb6>] khugepaged+0x226/0x240
[ 2749.385768] [<0000017f62db3128>] kthread+0x148/0x170
[ 2749.385770] [<0000017f62d2c238>] __ret_from_fork+0x48/0x220
[ 2749.385772] [<0000017f63c95d0a>] ret_from_fork+0xa/0x30Thanks!
Quoted 15 lines · Alexander Gordeev
On Fri, May 22, 2026 at 01:47:24PM -0700, Andrew Morton wrote:
Hi Andrew et al,
Quoted 10 lines · On Fri, 22 May 2026 08:59:55 -0600 Nico Pache <[email protected]> wrote:
Quoted 3 lines
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
Thanks, I've update mm.git's mm-unstable branch to this version.
It sounds like I might be dropping it soon, haven't started looking at that yet. But let's at least eyeball the latest version at this time.
Quoted 6 lines
Quoted 2 lines
Sashiko was able to apply this, so the base-it-on-hotfixes thing worked well, thanks. The AI checking made a few allegations:
This series appears to cause hangs on s390 in linux-next. The issue is not easily reproducible, so it is not yet confirmed. Any ideas for a reliable reproducer that exercises the code path below?
Hi,
Thanks for the report!
was this caught by syzbot? If so, can you provide a link?
Also can you provide whether any of the mTHP sysfs settings were enabled?
Based on the report, it looks like we are either dealing with more lock contention (due to holding the write lock longer). We could switch to a trylock but that might cause us to lose some collapse attempts (which will be retried later, so probably fine). I'm ok with that approach if it prevents these potential regressions.
Cheers,
-- Nico
Quoted 21 lines
[ 2749.385719] sysrq: Show Blocked State [ 2749.385730] task:khugepaged state:D stack:0 pid:209 tgid:209 ppid:2 task_flags:0x200040 flags:0x00000000 [ 2749.385735] Call Trace: [ 2749.385736] [<0000017f63c8b226>] __schedule+0x316/0x890 [ 2749.385740] [<0000017f63c8b7dc>] schedule+0x3c/0xc0 [ 2749.385743] [<0000017f63c8b888>] schedule_preempt_disabled+0x28/0x40 [ 2749.385746] [<0000017f63c902ea>] rwsem_down_write_slowpath+0x2fa/0x8b0 [ 2749.385749] [<0000017f63c90910>] down_write+0x70/0x80 [ 2749.385752] [<0000017f6313407a>] collapse_huge_page+0x2ea/0x9e0 [ 2749.385755] [<0000017f6313491e>] mthp_collapse+0x1ae/0x1f0 [ 2749.385757] [<0000017f63134fda>] collapse_scan_pmd+0x67a/0x8f0 [ 2749.385760] [<0000017f6313751a>] collapse_single_pmd+0x15a/0x260 [ 2749.385762] [<0000017f6313792c>] collapse_scan_mm_slot.constprop.0+0x30c/0x470 [ 2749.385765] [<0000017f63137cb6>] khugepaged+0x226/0x240 [ 2749.385768] [<0000017f62db3128>] kthread+0x148/0x170 [ 2749.385770] [<0000017f62d2c238>] __ret_from_fork+0x48/0x220 [ 2749.385772] [<0000017f63c95d0a>] ret_from_fork+0xa/0x30Thanks!
Lorenzo Stoakes
reviewerQuoted 39 lines · Alexander Gordeev
On Fri, May 22, 2026 at 01:47:24PM -0700, Andrew Morton wrote:
Hi Andrew et al,
Quoted 5 lines · On Fri, 22 May 2026 08:59:55 -0600 Nico Pache <[email protected]> wrote:
Quoted 3 lines
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
Quoted 7 lines
Thanks, I've update mm.git's mm-unstable branch to this version.
It sounds like I might be dropping it soon, haven't started looking at that yet. But let's at least eyeball the latest version at this time.
Sashiko was able to apply this, so the base-it-on-hotfixes thing worked well, thanks. The AI checking made a few allegations:
This series appears to cause hangs on s390 in linux-next. The issue is not easily reproducible, so it is not yet confirmed. Any ideas for a reliable reproducer that exercises the code path below?
[ 2749.385719] sysrq: Show Blocked State [ 2749.385730] task:khugepaged state:D stack:0 pid:209 tgid:209 ppid:2 task_flags:0x200040 flags:0x00000000 [ 2749.385735] Call Trace: [ 2749.385736] [<0000017f63c8b226>] __schedule+0x316/0x890 [ 2749.385740] [<0000017f63c8b7dc>] schedule+0x3c/0xc0 [ 2749.385743] [<0000017f63c8b888>] schedule_preempt_disabled+0x28/0x40 [ 2749.385746] [<0000017f63c902ea>] rwsem_down_write_slowpath+0x2fa/0x8b0 [ 2749.385749] [<0000017f63c90910>] down_write+0x70/0x80 [ 2749.385752] [<0000017f6313407a>] collapse_huge_page+0x2ea/0x9e0 [ 2749.385755] [<0000017f6313491e>] mthp_collapse+0x1ae/0x1f0 [ 2749.385757] [<0000017f63134fda>] collapse_scan_pmd+0x67a/0x8f0 [ 2749.385760] [<0000017f6313751a>] collapse_single_pmd+0x15a/0x260 [ 2749.385762] [<0000017f6313792c>] collapse_scan_mm_slot.constprop.0+0x30c/0x470 [ 2749.385765] [<0000017f63137cb6>] khugepaged+0x226/0x240 [ 2749.385768] [<0000017f62db3128>] kthread+0x148/0x170 [ 2749.385770] [<0000017f62d2c238>] __ret_from_fork+0x48/0x220 [ 2749.385772] [<0000017f63c95d0a>] ret_from_fork+0xa/0x30
Quoted 1 line
Thanks!
Hi Alexander,
Thanks for the report.
It's a pity it's non-repro, I had Claude have a look at it and it couldn't find a definite issue with the code at v18, all the locks seem balanced internally.
Things it highlighted FWIW:
- Far more mmap_write_lock()'s being taken - the stack-based approach calls colapse_huge_page() multiple times per-PMD each of which entails an mmap read lock/unlock and mmap write lock.
- anon_vma write lock held for a much longer period over partial collapse.
So maybe these are triggering issues rather than being the cause of them per-se?
If you happen to see it again could you give the output for:
'echo t > /proc/sysrq-trigger' so we can track who holds the contended lock and get more details on it?
Also the .config would be useful.
I'm guessing you've also not enabled mTHP in any way on the system?
Repro-wise you could also:
# echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs # echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs
To get khugepaged going a more aggressively:
$ for f in /sys/kernel/mm/transparent_hugepage/hugepages-*; do echo always | sudo tee $f/enabled; done
Then maybe some stress-ng like sudo stress-ng --vm 4 --vm-bytes 2G --vm-method all --timeout 5m (or maybe something more refined :)?
Maybe some of this will help repro more reliably?
Cheers, Lorenzo
Lance Yang
reviewerQuoted 73 lines · Lorenzo Stoakes
Quoted 39 lines · Alexander Gordeev
On Fri, May 22, 2026 at 01:47:24PM -0700, Andrew Morton wrote:
Hi Andrew et al,
Quoted 5 lines · On Fri, 22 May 2026 08:59:55 -0600 Nico Pache <[email protected]> wrote:
Quoted 3 lines
The following series provides khugepaged with the capability to collapse anonymous memory regions to mTHPs.
Quoted 7 lines
Thanks, I've update mm.git's mm-unstable branch to this version.
It sounds like I might be dropping it soon, haven't started looking at that yet. But let's at least eyeball the latest version at this time.
Sashiko was able to apply this, so the base-it-on-hotfixes thing worked well, thanks. The AI checking made a few allegations:
This series appears to cause hangs on s390 in linux-next. The issue is not easily reproducible, so it is not yet confirmed. Any ideas for a reliable reproducer that exercises the code path below?
[ 2749.385719] sysrq: Show Blocked State [ 2749.385730] task:khugepaged state:D stack:0 pid:209 tgid:209 ppid:2 task_flags:0x200040 flags:0x00000000 [ 2749.385735] Call Trace: [ 2749.385736] [<0000017f63c8b226>] __schedule+0x316/0x890 [ 2749.385740] [<0000017f63c8b7dc>] schedule+0x3c/0xc0 [ 2749.385743] [<0000017f63c8b888>] schedule_preempt_disabled+0x28/0x40 [ 2749.385746] [<0000017f63c902ea>] rwsem_down_write_slowpath+0x2fa/0x8b0 [ 2749.385749] [<0000017f63c90910>] down_write+0x70/0x80 [ 2749.385752] [<0000017f6313407a>] collapse_huge_page+0x2ea/0x9e0 [ 2749.385755] [<0000017f6313491e>] mthp_collapse+0x1ae/0x1f0 [ 2749.385757] [<0000017f63134fda>] collapse_scan_pmd+0x67a/0x8f0 [ 2749.385760] [<0000017f6313751a>] collapse_single_pmd+0x15a/0x260 [ 2749.385762] [<0000017f6313792c>] collapse_scan_mm_slot.constprop.0+0x30c/0x470 [ 2749.385765] [<0000017f63137cb6>] khugepaged+0x226/0x240 [ 2749.385768] [<0000017f62db3128>] kthread+0x148/0x170 [ 2749.385770] [<0000017f62d2c238>] __ret_from_fork+0x48/0x220 [ 2749.385772] [<0000017f63c95d0a>] ret_from_fork+0xa/0x30Quoted 1 line
Thanks!
Hi Alexander,
Thanks for the report.
It's a pity it's non-repro, I had Claude have a look at it and it couldn't find a definite issue with the code at v18, all the locks seem balanced internally.
Things it highlighted FWIW:
- Far more mmap_write_lock()'s being taken - the stack-based approach calls
colapse_huge_page()multiple times per-PMD each of which entails an mmap read lock/unlock and mmap write lock.-
anon_vmawrite lock held for a much longer period over partial collapse.So maybe these are triggering issues rather than being the cause of them per-se?
If you happen to see it again could you give the output for:
'echo t >
/proc/sysrq-trigger' so we can track who holds the contended lock and get more details on it?Also the .config would be useful.
I'm guessing you've also not enabled mTHP in any way on the system?
Repro-wise you could also:
# echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs # echo 1 > /sys/kernel/mm/transparent_hugepage/khugepaged/alloc_sleep_millisecs
Quoted 9 lines
To get khugepaged going a more aggressively:
$ for f in /sys/kernel/mm/transparent_hugepage/hugepages-*; do echo always | sudo tee $f/enabled; doneThen maybe some stress-ng like sudo stress-ng --vm 4 --vm-bytes 2G --vm-method all --timeout 5m (or maybe something more refined :)?
Maybe some of this will help repro more reliably?
Cool!
Maybe also worth trying with CONFIG_DETECT_HUNG_TASK=y and CONFIG_DETECT_HUNG_TASK_BLOCKER=y.
# detect after 10s in D state instead of default 120s echo 10 > /proc/sys/kernel/hung_task_timeout_secs
# optional: check more often; 0 means same as timeout echo 0 > /proc/sys/kernel/hung_task_check_interval_secs
With that enabled, the kernel should hopefully tell us which task likely owns the rwsem. If it is writer-owned, I would expect that to be fairly reliable.
Cheers, Lance
Lorenzo Stoakes
reviewerNot sure if already addressed for v19 but I just tried building a kernel in mm-unstable and saw this (clang 22.1.6):
mm/khugepaged.c:1357:6: warning: variable 'pte' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1357 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~mm/khugepaged.c:1357:2: note: remove the 'if' if its condition is always false
1357 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1358 | goto out_up_write;
| ~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1352:6: warning: variable 'pte' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
1352 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~mm/khugepaged.c:1458:6: note: uninitialized use occurs here
1458 | if (pte)
| ^~~mm/khugepaged.c:1352:2: note: remove the 'if' if its condition is always false
1352 | if (result != SCAN_SUCCEED)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
1353 | goto out_up_write;
| ~~~~~~~~~~~~~~~~~
mm/khugepaged.c:1296:12: note: initialize the variable 'pte' to silence this warning
1296 | pte_t *pte;
| ^
| = NULL2 warnings generated.
Is this already addressed in v19/review here? If not could you please address it.
Thanks, Lorenzo