Skip to contentSkip to conversation

mm-madvise-add-madv_collapse-to-process_madvise.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Sep 12, 2022

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/madvise: add MADV_COLLAPSE to process_madvise()
has been removed from the -mm tree. Its filename was
mm-madvise-add-madv_collapse-to-process_madvise.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: "Zach O'Keefe" <[email protected]>
Subject: mm/madvise: add MADV_COLLAPSE to process_madvise()
Date: Wed, 6 Jul 2022 16:59:30 -0700

Allow MADV_COLLAPSE behavior for process_madvise(2) if caller has CAP_SYS_ADMIN or is requesting collapse of it's own memory.

This is useful for the development of userspace agents that seek to optimize THP utilization system-wide by using userspace signals to prioritize what memory is most deserving of being THP-backed.

[[email protected]: remove CAP_SYS_ADMIN requirement for process_madvise(MADV_COLLAPSE)]
Cc Alex Shi <[email protected]>
Cc Andrea Arcangeli <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Axel Rasmussen <[email protected]>
Cc Chris Kennelly <[email protected]>
Cc Chris Zankel <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Helge Deller <[email protected]>
Cc Hugh Dickins <[email protected]>
Cc Ivan Kokshaysky <[email protected]>
Cc James Bottomley <[email protected]>
Cc Jens Axboe <[email protected]>
Cc "Kirill A. Shutemov" <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Matt Turner <[email protected]>
Cc Max Filippov <[email protected]>
Cc Miaohe Lin <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Minchan Kim <[email protected]>
Cc Pasha Tatashin <[email protected]>
Cc Pavel Begunkov <[email protected]>
Cc Peter Xu <[email protected]>
Cc Rongwei Wang <[email protected]>
Cc SeongJae Park <[email protected]>
Cc Song Liu <[email protected]>
Cc Thomas Bogendoerfer <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Yang Shi <[email protected]>
Cc Zi Yan <[email protected]>
Cc Dan Carpenter <[email protected]>
Cc "Souptick Joarder (HPE)" <[email protected]>

---

 mm/madvise.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
mm/madvise.c renamed from mm/madvise.c~mm-madvise-add-madv_collapse-to-process_madvise +2 -2
@@ -1170,13 +1170,13 @@ madvise_behavior_valid(int behavior)
 	}
 }
 
-static bool
-process_madvise_behavior_valid(int behavior)
+static bool process_madvise_behavior_valid(int behavior)
 {
 	switch (behavior) {
 	case MADV_COLD:
 	case MADV_PAGEOUT:
 	case MADV_WILLNEED:
+	case MADV_COLLAPSE:
 		return true;
 	default:
 		return false;

_

Patches currently in -mm which might be from [email protected] are

mm-shmem-add-flag-to-enforce-shmem-thp-in-hugepage_vma_check.patch mm-khugepaged-attempt-to-map-file-shmem-backed-pte-mapped-thps-by-pmds.patch mm-madvise-add-file-and-shmem-support-to-madv_collapse.patch mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file.patch selftests-vm-dedup-thp-helpers.patch selftests-vm-modularize-thp-collapse-memory-operations.patch selftests-vm-add-thp-collapse-file-and-tmpfs-testing.patch selftests-vm-add-thp-collapse-shmem-testing.patch selftests-vm-add-file-shmem-madv_collapse-selftest-for-cleared-pmd.patch selftests-vm-add-selftest-for-madv_collapse-of-uffd-minor-memory.patch