* + khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch added to mm-new branch
@ 2025-07-04 0:59 Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2025-07-04 0:59 UTC (permalink / raw)
To: mm-commits, zokeefe, ziy, willy, will, wangkefeng.wang,
vishal.moola, usamaarif642, tiwai, thomas.hellstrom, surenb,
sunnanyong, ryan.roberts, rostedt, rientjes, rdunlap, raquini,
peterx, mhocko, mhiramat, mathieu.desnoyers, lorenzo.stoakes,
liam.howlett, kirill.shutemov, jack, hannes, dev.jain, david,
corbet, cl, catalin.marinas, baolin.wang, baohua, bagasdotme,
anshuman.khandual, aarcange, npache, akpm
The patch titled
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
has been added to the -mm mm-new branch. Its filename is
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Nico Pache <npache@redhat.com>
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
Date: Tue, 1 Jul 2025 23:57:36 -0600
There are cases where, if an attempted collapse fails, all subsequent
orders are guaranteed to also fail. Avoid these collapse attempts by
bailing out early.
Link: https://lkml.kernel.org/r/20250702055742.102808-10-npache@redhat.com
Signed-off-by: Nico Pache <npache@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Lameter (Ampere) <cl@gentwo.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Rafael Aquini <raquini@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Reported-by:Takashi Iwai <tiwai@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/mm/khugepaged.c~khugepaged-avoid-unnecessary-mthp-collapse-attempts
+++ a/mm/khugepaged.c
@@ -1358,6 +1358,23 @@ static int khugepaged_scan_bitmap(struct
collapsed += (1 << order);
continue;
}
+ /*
+ * Some ret values indicate all lower order will also
+ * fail, dont trying to collapse smaller orders
+ */
+ if (ret == SCAN_EXCEED_NONE_PTE ||
+ ret == SCAN_EXCEED_SWAP_PTE ||
+ ret == SCAN_EXCEED_SHARED_PTE ||
+ ret == SCAN_PTE_NON_PRESENT ||
+ ret == SCAN_PTE_UFFD_WP ||
+ ret == SCAN_ALLOC_HUGE_PAGE_FAIL ||
+ ret == SCAN_CGROUP_CHARGE_FAIL ||
+ ret == SCAN_COPY_MC ||
+ ret == SCAN_PAGE_LOCK ||
+ ret == SCAN_PAGE_COUNT)
+ goto next;
+ else
+ break;
}
next:
_
Patches currently in -mm which might be from npache@redhat.com are
khugepaged-rename-hpage_collapse_-to-khugepaged_.patch
introduce-khugepaged_collapse_single_pmd-to-unify-khugepaged-and-madvise_collapse.patch
khugepaged-generalize-hugepage_vma_revalidate-for-mthp-support.patch
khugepaged-generalize-__collapse_huge_page_-for-mthp-support.patch
khugepaged-introduce-khugepaged_scan_bitmap-for-mthp-support.patch
khugepaged-add-mthp-support.patch
khugepaged-skip-collapsing-mthp-to-smaller-orders.patch
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
khugepaged-allow-madvise_collapse-to-check-all-anonymous-mthp-orders.patch
khugepaged-improve-tracepoints-for-mthp-orders.patch
khugepaged-add-per-order-mthp-khugepaged-stats.patch
documentation-mm-update-the-admin-guide-for-mthp-collapse.patch
^ permalink raw reply [flat|nested] 3+ messages in thread* + khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch added to mm-new branch
@ 2025-04-28 19:01 Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2025-04-28 19:01 UTC (permalink / raw)
To: mm-commits, zokeefe, ziy, yang, willy, will, wangkefeng.wang,
vishal.moola, usamaarif642, tiwai, thomas.hellstrom, surenb,
sunnanyong, shuah, ryan.roberts, rostedt, rientjes, rdunlap,
raquini, peterx, mhocko, mhiramat, mathieu.desnoyers,
lorenzo.stoakes, liam.howlett, kirill.shutemov, jack, hannes,
dev.jain, david, corbet, cl, catalin.marinas, baolin.wang, baohua,
bagasdotme, anshuman.khandual, aarcange, npache, akpm
The patch titled
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
has been added to the -mm mm-new branch. Its filename is
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Note, mm-new is a provisional staging ground for work-in-progress
patches, and acceptance into mm-new is a notification for others take
notice and to finish up reviews. Please do not hesitate to respond to
review feedback and post updated versions to replace or incrementally
fixup patches in mm-new.
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Nico Pache <npache@redhat.com>
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
Date: Mon, 28 Apr 2025 12:12:15 -0600
There are cases where, if an attempted collapse fails, all subsequent
orders are guaranteed to also fail. Avoid these collapse attempts by
bailing out early.
Link: https://lkml.kernel.org/r/20250428181218.85925-10-npache@redhat.com
Signed-off-by: Nico Pache <npache@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Bagas Sanjaya <bagasdotme@gmail.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Lameter (Ampere) <cl@gentwo.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Rafael Aquini <raquini@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Reported-by:Takashi Iwai <tiwai@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yang Shi <yang@os.amperecomputing.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/mm/khugepaged.c~khugepaged-avoid-unnecessary-mthp-collapse-attempts
+++ a/mm/khugepaged.c
@@ -1365,6 +1365,23 @@ static int khugepaged_scan_bitmap(struct
collapsed += (1 << order);
continue;
}
+ /*
+ * Some ret values indicate all lower order will also
+ * fail, dont trying to collapse smaller orders
+ */
+ if (ret == SCAN_EXCEED_NONE_PTE ||
+ ret == SCAN_EXCEED_SWAP_PTE ||
+ ret == SCAN_EXCEED_SHARED_PTE ||
+ ret == SCAN_PTE_NON_PRESENT ||
+ ret == SCAN_PTE_UFFD_WP ||
+ ret == SCAN_ALLOC_HUGE_PAGE_FAIL ||
+ ret == SCAN_CGROUP_CHARGE_FAIL ||
+ ret == SCAN_COPY_MC ||
+ ret == SCAN_PAGE_LOCK ||
+ ret == SCAN_PAGE_COUNT)
+ goto next;
+ else
+ break;
}
next:
_
Patches currently in -mm which might be from npache@redhat.com are
khugepaged-rename-hpage_collapse_-to-khugepaged_.patch
introduce-khugepaged_collapse_single_pmd-to-unify-khugepaged-and-madvise_collapse.patch
khugepaged-generalize-hugepage_vma_revalidate-for-mthp-support.patch
khugepaged-generalize-__collapse_huge_page_-for-mthp-support.patch
khugepaged-introduce-khugepaged_scan_bitmap-for-mthp-support.patch
khugepaged-add-mthp-support.patch
khugepaged-skip-collapsing-mthp-to-smaller-orders.patch
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
khugepaged-improve-tracepoints-for-mthp-orders.patch
khugepaged-add-per-order-mthp-khugepaged-stats.patch
documentation-mm-update-the-admin-guide-for-mthp-collapse.patch
mm-defer-thp-insertion-to-khugepaged.patch
mm-document-mthp-defer-usage.patch
khugepaged-add-defer-option-to-mthp-options.patch
selftests-mm-add-defer-to-thp-setting-parser.patch
^ permalink raw reply [flat|nested] 3+ messages in thread* + khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch added to mm-new branch
@ 2025-04-17 23:22 Andrew Morton
0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2025-04-17 23:22 UTC (permalink / raw)
To: mm-commits, zokeefe, ziy, yang, willy, will, wangkefeng.wang,
vishal.moola, usamaarif642, tiwai, thomas.hellstrom, surenb,
sunnanyong, shuah, ryan.roberts, rostedt, rientjes, rdunlap,
raquini, peterx, mhocko, mhiramat, mathieu.desnoyers,
kirill.shutemov, jack, hannes, dev.jain, david, corbet, cl,
catalin.marinas, baolin.wang, baohua, anshuman.khandual, aarcange,
npache, akpm
The patch titled
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
has been added to the -mm mm-new branch. Its filename is
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will shortly appear at
https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
This patch will later appear in the mm-new branch at
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next via the mm-everything
branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
and is updated there every 2-3 working days
------------------------------------------------------
From: Nico Pache <npache@redhat.com>
Subject: khugepaged: avoid unnecessary mTHP collapse attempts
Date: Wed, 16 Apr 2025 18:02:35 -0600
There are cases where, if an attempted collapse fails, all subsequent
orders are guaranteed to also fail. Avoid these collapse attempts by
bailing out early.
Link: https://lkml.kernel.org/r/20250417000238.74567-10-npache@redhat.com
Signed-off-by: Nico Pache <npache@redhat.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Christoph Lameter (Ampere) <cl@gentwo.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Kirill A. Shuemov <kirill.shutemov@linux.intel.com>
Cc: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nanyong Sun <sunnanyong@huawei.com>
Cc: Peter Xu <peterx@redhat.com>
Cc: Rafael Aquini <raquini@redhat.com>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: Reported-by:Takashi Iwai <tiwai@suse.de>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Thomas Hellstrom <thomas.hellstrom@linux.intel.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Cc: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Cc: Will Deacon <will@kernel.org>
Cc: Yang Shi <yang@os.amperecomputing.com>
Cc: Zach O'Keefe <zokeefe@google.com>
Cc: Zi Yan <ziy@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/khugepaged.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
--- a/mm/khugepaged.c~khugepaged-avoid-unnecessary-mthp-collapse-attempts
+++ a/mm/khugepaged.c
@@ -1366,6 +1366,23 @@ static int khugepaged_scan_bitmap(struct
collapsed += (1 << order);
continue;
}
+ /*
+ * Some ret values indicate all lower order will also
+ * fail, dont trying to collapse smaller orders
+ */
+ if (ret == SCAN_EXCEED_NONE_PTE ||
+ ret == SCAN_EXCEED_SWAP_PTE ||
+ ret == SCAN_EXCEED_SHARED_PTE ||
+ ret == SCAN_PTE_NON_PRESENT ||
+ ret == SCAN_PTE_UFFD_WP ||
+ ret == SCAN_ALLOC_HUGE_PAGE_FAIL ||
+ ret == SCAN_CGROUP_CHARGE_FAIL ||
+ ret == SCAN_COPY_MC ||
+ ret == SCAN_PAGE_LOCK ||
+ ret == SCAN_PAGE_COUNT)
+ goto next;
+ else
+ break;
}
next:
_
Patches currently in -mm which might be from npache@redhat.com are
introduce-khugepaged_collapse_single_pmd-to-unify-khugepaged-and-madvise_collapse.patch
khugepaged-rename-hpage_collapse_-to-khugepaged_.patch
khugepaged-generalize-hugepage_vma_revalidate-for-mthp-support.patch
khugepaged-generalize-__collapse_huge_page_-for-mthp-support.patch
khugepaged-introduce-khugepaged_scan_bitmap-for-mthp-support.patch
khugepaged-add-mthp-support.patch
khugepaged-skip-collapsing-mthp-to-smaller-orders.patch
khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch
khugepaged-improve-tracepoints-for-mthp-orders.patch
khugepaged-add-per-order-mthp-khugepaged-stats.patch
documentation-mm-update-the-admin-guide-for-mthp-collapse.patch
mm-defer-thp-insertion-to-khugepaged.patch
mm-document-mthp-defer-usage.patch
khugepaged-add-defer-option-to-mthp-options.patch
selftests-mm-add-defer-to-thp-setting-parser.patch
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-07-04 0:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04 0:59 + khugepaged-avoid-unnecessary-mthp-collapse-attempts.patch added to mm-new branch Andrew Morton
-- strict thread matches above, loose matches on Subject: below --
2025-04-28 19:01 Andrew Morton
2025-04-17 23:22 Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.