Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'mm-hotfixes-stable-2025-04-19-21-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

Pull misc hotfixes from Andrew Morton:
"16 hotfixes. 2 are cc:stable and the remainder address post-6.14
issues or aren't considered necessary for -stable kernels.

All patches are basically for MM although five are alterations to
MAINTAINERS"

[ Basic counting skills are clearly not a strictly necessary requirement
for kernel maintainers. - Linus ]

* tag 'mm-hotfixes-stable-2025-04-19-21-24' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
MAINTAINERS: add section for locking of mm's and VMAs
mm: vmscan: fix kswapd exit condition in defrag_mode
mm: vmscan: restore high-cpu watermark safety in kswapd
MAINTAINERS: add Pedro as reviewer to the MEMORY MAPPING section
mm/memory: move sanity checks in do_wp_page() after mapcount vs. refcount stabilization
mm, hugetlb: increment the number of pages to be reset on HVO
writeback: fix false warning in inode_to_wb()
docs: ABI: replace mcroce@microsoft.com with new Meta address
mm/gup: fix wrongly calculated returned value in fault_in_safe_writeable()
MAINTAINERS: add memory advice section
MAINTAINERS: add mmap trace events to MEMORY MAPPING
mm: memcontrol: fix swap counter leak from offline cgroup
MAINTAINERS: add MM subsection for the page allocator
MAINTAINERS: update SLAB ALLOCATOR maintainers
fs/dax: fix folio splitting issue by resetting old folio order + _nr_pages
mm/page_alloc: fix deadlock on cpu_hotplug_lock in __accept_page()

+141 -35
+4
CREDITS
··· 2071 2071 S: Santa Clara, CA 95051 2072 2072 S: USA 2073 2073 2074 + N: Joonsoo Kim 2075 + E: iamjoonsoo.kim@lge.com 2076 + D: Slab allocators 2077 + 2074 2078 N: Kukjin Kim 2075 2079 E: kgene@kernel.org 2076 2080 D: Samsung S3C, S5P and Exynos ARM architectures
+1 -1
Documentation/ABI/stable/sysfs-block
··· 77 77 78 78 What: /sys/block/<disk>/diskseq 79 79 Date: February 2021 80 - Contact: Matteo Croce <mcroce@microsoft.com> 80 + Contact: Matteo Croce <teknoraver@meta.com> 81 81 Description: 82 82 The /sys/block/<disk>/diskseq files reports the disk 83 83 sequence number, which is a monotonically increasing
+5 -5
Documentation/ABI/testing/sysfs-kernel-reboot
··· 1 1 What: /sys/kernel/reboot 2 2 Date: November 2020 3 3 KernelVersion: 5.11 4 - Contact: Matteo Croce <mcroce@microsoft.com> 4 + Contact: Matteo Croce <teknoraver@meta.com> 5 5 Description: Interface to set the kernel reboot behavior, similarly to 6 6 what can be done via the reboot= cmdline option. 7 7 (see Documentation/admin-guide/kernel-parameters.txt) ··· 9 9 What: /sys/kernel/reboot/mode 10 10 Date: November 2020 11 11 KernelVersion: 5.11 12 - Contact: Matteo Croce <mcroce@microsoft.com> 12 + Contact: Matteo Croce <teknoraver@meta.com> 13 13 Description: Reboot mode. Valid values are: cold warm hard soft gpio 14 14 15 15 What: /sys/kernel/reboot/type 16 16 Date: November 2020 17 17 KernelVersion: 5.11 18 - Contact: Matteo Croce <mcroce@microsoft.com> 18 + Contact: Matteo Croce <teknoraver@meta.com> 19 19 Description: Reboot type. Valid values are: bios acpi kbd triple efi pci 20 20 21 21 What: /sys/kernel/reboot/cpu 22 22 Date: November 2020 23 23 KernelVersion: 5.11 24 - Contact: Matteo Croce <mcroce@microsoft.com> 24 + Contact: Matteo Croce <teknoraver@meta.com> 25 25 Description: CPU number to use to reboot. 26 26 27 27 What: /sys/kernel/reboot/force 28 28 Date: November 2020 29 29 KernelVersion: 5.11 30 - Contact: Matteo Croce <mcroce@microsoft.com> 30 + Contact: Matteo Croce <teknoraver@meta.com> 31 31 Description: Don't wait for any other CPUs on reboot and 32 32 avoid anything that could hang. 33 33
+47 -2
MAINTAINERS
··· 15517 15517 F: mm/numa_emulation.c 15518 15518 F: mm/numa_memblks.c 15519 15519 15520 + MEMORY MANAGEMENT - PAGE ALLOCATOR 15521 + M: Andrew Morton <akpm@linux-foundation.org> 15522 + R: Vlastimil Babka <vbabka@suse.cz> 15523 + R: Suren Baghdasaryan <surenb@google.com> 15524 + R: Michal Hocko <mhocko@suse.com> 15525 + R: Brendan Jackman <jackmanb@google.com> 15526 + R: Johannes Weiner <hannes@cmpxchg.org> 15527 + R: Zi Yan <ziy@nvidia.com> 15528 + L: linux-mm@kvack.org 15529 + S: Maintained 15530 + F: mm/compaction.c 15531 + F: mm/page_alloc.c 15532 + F: include/linux/gfp.h 15533 + F: include/linux/compaction.h 15534 + 15520 15535 MEMORY MANAGEMENT - SECRETMEM 15521 15536 M: Andrew Morton <akpm@linux-foundation.org> 15522 15537 M: Mike Rapoport <rppt@kernel.org> ··· 15559 15544 M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> 15560 15545 R: Vlastimil Babka <vbabka@suse.cz> 15561 15546 R: Jann Horn <jannh@google.com> 15547 + R: Pedro Falcato <pfalcato@suse.de> 15562 15548 L: linux-mm@kvack.org 15563 15549 S: Maintained 15564 15550 W: http://www.linux-mm.org 15565 15551 T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 15552 + F: include/trace/events/mmap.h 15566 15553 F: mm/mlock.c 15567 15554 F: mm/mmap.c 15568 15555 F: mm/mprotect.c ··· 15574 15557 F: mm/vma.h 15575 15558 F: mm/vma_internal.h 15576 15559 F: tools/testing/vma/ 15560 + 15561 + MEMORY MAPPING - LOCKING 15562 + M: Andrew Morton <akpm@linux-foundation.org> 15563 + M: Suren Baghdasaryan <surenb@google.com> 15564 + M: Liam R. Howlett <Liam.Howlett@oracle.com> 15565 + M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> 15566 + R: Vlastimil Babka <vbabka@suse.cz> 15567 + R: Shakeel Butt <shakeel.butt@linux.dev> 15568 + L: linux-mm@kvack.org 15569 + S: Maintained 15570 + W: http://www.linux-mm.org 15571 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 15572 + F: Documentation/mm/process_addrs.rst 15573 + F: include/linux/mmap_lock.h 15574 + F: include/trace/events/mmap_lock.h 15575 + F: mm/mmap_lock.c 15576 + 15577 + MEMORY MAPPING - MADVISE (MEMORY ADVICE) 15578 + M: Andrew Morton <akpm@linux-foundation.org> 15579 + M: Liam R. Howlett <Liam.Howlett@oracle.com> 15580 + M: Lorenzo Stoakes <lorenzo.stoakes@oracle.com> 15581 + M: David Hildenbrand <david@redhat.com> 15582 + R: Vlastimil Babka <vbabka@suse.cz> 15583 + R: Jann Horn <jannh@google.com> 15584 + L: linux-mm@kvack.org 15585 + S: Maintained 15586 + W: http://www.linux-mm.org 15587 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm 15588 + F: include/uapi/asm-generic/mman-common.h 15589 + F: mm/madvise.c 15577 15590 15578 15591 MEMORY TECHNOLOGY DEVICES (MTD) 15579 15592 M: Miquel Raynal <miquel.raynal@bootlin.com> ··· 22297 22250 22298 22251 SLAB ALLOCATOR 22299 22252 M: Christoph Lameter <cl@linux.com> 22300 - M: Pekka Enberg <penberg@kernel.org> 22301 22253 M: David Rientjes <rientjes@google.com> 22302 - M: Joonsoo Kim <iamjoonsoo.kim@lge.com> 22303 22254 M: Andrew Morton <akpm@linux-foundation.org> 22304 22255 M: Vlastimil Babka <vbabka@suse.cz> 22305 22256 R: Roman Gushchin <roman.gushchin@linux.dev>
+1
fs/dax.c
··· 396 396 order = folio_order(folio); 397 397 if (!order) 398 398 return 0; 399 + folio_reset_order(folio); 399 400 400 401 for (i = 0; i < (1UL << order); i++) { 401 402 struct dev_pagemap *pgmap = page_pgmap(&folio->page);
+1
include/linux/backing-dev.h
··· 249 249 { 250 250 #ifdef CONFIG_LOCKDEP 251 251 WARN_ON_ONCE(debug_locks && 252 + (inode->i_sb->s_iflags & SB_I_CGROUPWB) && 252 253 (!lockdep_is_held(&inode->i_lock) && 253 254 !lockdep_is_held(&inode->i_mapping->i_pages.xa_lock) && 254 255 !lockdep_is_held(&inode->i_wb->list_lock)));
+17
include/linux/mm.h
··· 1218 1218 return folio_large_order(folio); 1219 1219 } 1220 1220 1221 + /** 1222 + * folio_reset_order - Reset the folio order and derived _nr_pages 1223 + * @folio: The folio. 1224 + * 1225 + * Reset the order and derived _nr_pages to 0. Must only be used in the 1226 + * process of splitting large folios. 1227 + */ 1228 + static inline void folio_reset_order(struct folio *folio) 1229 + { 1230 + if (WARN_ON_ONCE(!folio_test_large(folio))) 1231 + return; 1232 + folio->_flags_1 &= ~0xffUL; 1233 + #ifdef NR_PAGES_IN_LARGE_FOLIO 1234 + folio->_nr_pages = 0; 1235 + #endif 1236 + } 1237 + 1221 1238 #include <linux/huge_mm.h> 1222 1239 1223 1240 /*
+3 -2
include/linux/mmzone.h
··· 967 967 #ifdef CONFIG_UNACCEPTED_MEMORY 968 968 /* Pages to be accepted. All pages on the list are MAX_PAGE_ORDER */ 969 969 struct list_head unaccepted_pages; 970 + 971 + /* To be called once the last page in the zone is accepted */ 972 + struct work_struct unaccepted_cleanup; 970 973 #endif 971 974 972 975 /* zone flags, see below */ ··· 1502 1499 bool zone_watermark_ok(struct zone *z, unsigned int order, 1503 1500 unsigned long mark, int highest_zoneidx, 1504 1501 unsigned int alloc_flags); 1505 - bool zone_watermark_ok_safe(struct zone *z, unsigned int order, 1506 - unsigned long mark, int highest_zoneidx); 1507 1502 /* 1508 1503 * Memory initialization context, use to differentiate memory added by 1509 1504 * the platform statically or via memory hotplug interface.
+2 -2
mm/gup.c
··· 2207 2207 } while (start != end); 2208 2208 mmap_read_unlock(mm); 2209 2209 2210 - if (size > (unsigned long)uaddr - start) 2211 - return size - ((unsigned long)uaddr - start); 2210 + if (size > start - (unsigned long)uaddr) 2211 + return size - (start - (unsigned long)uaddr); 2212 2212 return 0; 2213 2213 } 2214 2214 EXPORT_SYMBOL(fault_in_safe_writeable);
+3 -3
mm/hugetlb_vmemmap.c
··· 238 238 * struct page, the special metadata (e.g. page->flags or page->mapping) 239 239 * cannot copy to the tail struct page structs. The invalid value will be 240 240 * checked in the free_tail_page_prepare(). In order to avoid the message 241 - * of "corrupted mapping in tail page". We need to reset at least 3 (one 242 - * head struct page struct and two tail struct page structs) struct page 241 + * of "corrupted mapping in tail page". We need to reset at least 4 (one 242 + * head struct page struct and three tail struct page structs) struct page 243 243 * structs. 244 244 */ 245 - #define NR_RESET_STRUCT_PAGE 3 245 + #define NR_RESET_STRUCT_PAGE 4 246 246 247 247 static inline void reset_struct_pages(struct page *start) 248 248 {
+1
mm/internal.h
··· 1595 1595 1596 1596 #ifdef CONFIG_UNACCEPTED_MEMORY 1597 1597 void accept_page(struct page *page); 1598 + void unaccepted_cleanup_work(struct work_struct *work); 1598 1599 #else /* CONFIG_UNACCEPTED_MEMORY */ 1599 1600 static inline void accept_page(struct page *page) 1600 1601 {
+1 -1
mm/memcontrol-v1.c
··· 620 620 mem_cgroup_id_get_many(swap_memcg, nr_entries - 1); 621 621 mod_memcg_state(swap_memcg, MEMCG_SWAP, nr_entries); 622 622 623 - swap_cgroup_record(folio, mem_cgroup_id(memcg), entry); 623 + swap_cgroup_record(folio, mem_cgroup_id(swap_memcg), entry); 624 624 625 625 folio_unqueue_deferred_split(folio); 626 626 folio->memcg_data = 0;
+2 -2
mm/memory.c
··· 3734 3734 return false; 3735 3735 3736 3736 VM_WARN_ON_ONCE(folio_test_ksm(folio)); 3737 - VM_WARN_ON_ONCE(folio_mapcount(folio) > folio_nr_pages(folio)); 3738 - VM_WARN_ON_ONCE(folio_entire_mapcount(folio)); 3739 3737 3740 3738 if (unlikely(folio_test_swapcache(folio))) { 3741 3739 /* ··· 3758 3760 if (folio_large_mapcount(folio) != folio_ref_count(folio)) 3759 3761 goto unlock; 3760 3762 3763 + VM_WARN_ON_ONCE_FOLIO(folio_large_mapcount(folio) > folio_nr_pages(folio), folio); 3764 + VM_WARN_ON_ONCE_FOLIO(folio_entire_mapcount(folio), folio); 3761 3765 VM_WARN_ON_ONCE(folio_mm_id(folio, 0) != vma->vm_mm->mm_id && 3762 3766 folio_mm_id(folio, 1) != vma->vm_mm->mm_id); 3763 3767
+1
mm/mm_init.c
··· 1441 1441 1442 1442 #ifdef CONFIG_UNACCEPTED_MEMORY 1443 1443 INIT_LIST_HEAD(&zone->unaccepted_pages); 1444 + INIT_WORK(&zone->unaccepted_cleanup, unaccepted_cleanup_work); 1444 1445 #endif 1445 1446 } 1446 1447
+26 -14
mm/page_alloc.c
··· 3470 3470 return false; 3471 3471 } 3472 3472 3473 - bool zone_watermark_ok_safe(struct zone *z, unsigned int order, 3474 - unsigned long mark, int highest_zoneidx) 3475 - { 3476 - long free_pages = zone_page_state(z, NR_FREE_PAGES); 3477 - 3478 - if (z->percpu_drift_mark && free_pages < z->percpu_drift_mark) 3479 - free_pages = zone_page_state_snapshot(z, NR_FREE_PAGES); 3480 - 3481 - return __zone_watermark_ok(z, order, mark, highest_zoneidx, 0, 3482 - free_pages); 3483 - } 3484 - 3485 3473 #ifdef CONFIG_NUMA 3486 3474 int __read_mostly node_reclaim_distance = RECLAIM_DISTANCE; 3487 3475 ··· 7179 7191 7180 7192 static bool lazy_accept = true; 7181 7193 7194 + void unaccepted_cleanup_work(struct work_struct *work) 7195 + { 7196 + static_branch_dec(&zones_with_unaccepted_pages); 7197 + } 7198 + 7182 7199 static int __init accept_memory_parse(char *p) 7183 7200 { 7184 7201 if (!strcmp(p, "lazy")) { ··· 7222 7229 7223 7230 __free_pages_ok(page, MAX_PAGE_ORDER, FPI_TO_TAIL); 7224 7231 7225 - if (last) 7226 - static_branch_dec(&zones_with_unaccepted_pages); 7232 + if (last) { 7233 + /* 7234 + * There are two corner cases: 7235 + * 7236 + * - If allocation occurs during the CPU bring up, 7237 + * static_branch_dec() cannot be used directly as 7238 + * it causes a deadlock on cpu_hotplug_lock. 7239 + * 7240 + * Instead, use schedule_work() to prevent deadlock. 7241 + * 7242 + * - If allocation occurs before workqueues are initialized, 7243 + * static_branch_dec() should be called directly. 7244 + * 7245 + * Workqueues are initialized before CPU bring up, so this 7246 + * will not conflict with the first scenario. 7247 + */ 7248 + if (system_wq) 7249 + schedule_work(&zone->unaccepted_cleanup); 7250 + else 7251 + unaccepted_cleanup_work(&zone->unaccepted_cleanup); 7252 + } 7227 7253 } 7228 7254 7229 7255 void accept_page(struct page *page)
+26 -3
mm/vmscan.c
··· 6736 6736 * meet watermarks. 6737 6737 */ 6738 6738 for_each_managed_zone_pgdat(zone, pgdat, i, highest_zoneidx) { 6739 + enum zone_stat_item item; 6739 6740 unsigned long free_pages; 6740 6741 6741 6742 if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING) ··· 6747 6746 /* 6748 6747 * In defrag_mode, watermarks must be met in whole 6749 6748 * blocks to avoid polluting allocator fallbacks. 6749 + * 6750 + * However, kswapd usually cannot accomplish this on 6751 + * its own and needs kcompactd support. Once it's 6752 + * reclaimed a compaction gap, and kswapd_shrink_node 6753 + * has dropped order, simply ensure there are enough 6754 + * base pages for compaction, wake kcompactd & sleep. 6750 6755 */ 6751 - if (defrag_mode) 6752 - free_pages = zone_page_state(zone, NR_FREE_PAGES_BLOCKS); 6756 + if (defrag_mode && order) 6757 + item = NR_FREE_PAGES_BLOCKS; 6753 6758 else 6754 - free_pages = zone_page_state(zone, NR_FREE_PAGES); 6759 + item = NR_FREE_PAGES; 6760 + 6761 + /* 6762 + * When there is a high number of CPUs in the system, 6763 + * the cumulative error from the vmstat per-cpu cache 6764 + * can blur the line between the watermarks. In that 6765 + * case, be safe and get an accurate snapshot. 6766 + * 6767 + * TODO: NR_FREE_PAGES_BLOCKS moves in steps of 6768 + * pageblock_nr_pages, while the vmstat pcp threshold 6769 + * is limited to 125. On many configurations that 6770 + * counter won't actually be per-cpu cached. But keep 6771 + * things simple for now; revisit when somebody cares. 6772 + */ 6773 + free_pages = zone_page_state(zone, item); 6774 + if (zone->percpu_drift_mark && free_pages < zone->percpu_drift_mark) 6775 + free_pages = zone_page_state_snapshot(zone, item); 6755 6776 6756 6777 if (__zone_watermark_ok(zone, order, mark, highest_zoneidx, 6757 6778 0, free_pages))