Skip to content

Commit c069445

Browse files
committed
Merge tag 'mm-hotfixes-stable-2025-06-22-18-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "20 hotfixes. 7 are cc:stable and the remainder address post-6.15 issues or aren't considered necessary for -stable kernels. Only 4 are for MM. - The series `Revert "bcache: update min_heap_callbacks to use default builtin swap"' from Kuan-Wei Chiu backs out the author's recent min_heap changes due to a performance regression. A fix for this regression has been developed but we felt it best to go back to the known-good version to give the new code more bake time. - A lot of MAINTAINERS maintenance. I like to get these changes upstreamed promptly because they can't break things and more accurate/complete MAINTAINERS info hopefully improves the speed and accuracy of our responses to submitters and reporters" * tag 'mm-hotfixes-stable-2025-06-22-18-52' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: MAINTAINERS: add additional mmap-related files to mmap section MAINTAINERS: add memfd, shmem quota files to shmem section MAINTAINERS: add stray rmap file to mm rmap section MAINTAINERS: add hugetlb_cgroup.c to hugetlb section MAINTAINERS: add further init files to mm init block MAINTAINERS: update maintainers for HugeTLB maple_tree: fix MA_STATE_PREALLOC flag in mas_preallocate() MAINTAINERS: add missing test files to mm gup section MAINTAINERS: add missing mm/workingset.c file to mm reclaim section selftests/mm: skip uprobe vma merge test if uprobes are not enabled bcache: remove unnecessary select MIN_HEAP Revert "bcache: remove heap-related macros and switch to generic min_heap" Revert "bcache: update min_heap_callbacks to use default builtin swap" selftests/mm: add configs to fix testcase failure kho: initialize tail pages for higher order folios properly MAINTAINERS: add linux-mm@ list to Kexec Handover mm: userfaultfd: fix race of userfaultfd_move and swap cache mm/gup: revert "mm: gup: fix infinite loop within __get_longterm_locked" selftests/mm: increase timeout from 180 to 900 seconds mm/shmem, swap: fix softlockup with mTHP swapin
2 parents 86731a2 + c742d12 commit c069445

File tree

23 files changed

+333
-277
lines changed

23 files changed

+333
-277
lines changed

MAINTAINERS

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11155,7 +11155,8 @@ F: include/linux/platform_data/huawei-gaokun-ec.h
1115511155

1115611156
HUGETLB SUBSYSTEM
1115711157
M: Muchun Song <[email protected]>
11158-
R: Oscar Salvador <[email protected]>
11158+
M: Oscar Salvador <[email protected]>
11159+
R: David Hildenbrand <[email protected]>
1115911160
1116011161
S: Maintained
1116111162
F: Documentation/ABI/testing/sysfs-kernel-mm-hugepages
@@ -11166,6 +11167,7 @@ F: fs/hugetlbfs/
1116611167
F: include/linux/hugetlb.h
1116711168
F: include/trace/events/hugetlbfs.h
1116811169
F: mm/hugetlb.c
11170+
F: mm/hugetlb_cgroup.c
1116911171
F: mm/hugetlb_cma.c
1117011172
F: mm/hugetlb_cma.h
1117111173
F: mm/hugetlb_vmemmap.c
@@ -13345,6 +13347,7 @@ M: Alexander Graf <[email protected]>
1334513347
M: Mike Rapoport <[email protected]>
1334613348
M: Changyuan Lyu <[email protected]>
1334713349
13350+
1334813351
S: Maintained
1334913352
F: Documentation/admin-guide/mm/kho.rst
1335013353
F: Documentation/core-api/kho/*
@@ -15676,8 +15679,11 @@ S: Maintained
1567615679
F: Documentation/core-api/boot-time-mm.rst
1567715680
F: Documentation/core-api/kho/bindings/memblock/*
1567815681
F: include/linux/memblock.h
15682+
F: mm/bootmem_info.c
1567915683
F: mm/memblock.c
15684+
F: mm/memtest.c
1568015685
F: mm/mm_init.c
15686+
F: mm/rodata_test.c
1568115687
F: tools/testing/memblock/
1568215688

1568315689
MEMORY ALLOCATION PROFILING
@@ -15732,7 +15738,6 @@ F: Documentation/admin-guide/mm/
1573215738
F: Documentation/mm/
1573315739
F: include/linux/gfp.h
1573415740
F: include/linux/gfp_types.h
15735-
F: include/linux/memfd.h
1573615741
F: include/linux/memory_hotplug.h
1573715742
F: include/linux/memory-tiers.h
1573815743
F: include/linux/mempolicy.h
@@ -15792,6 +15797,10 @@ S: Maintained
1579215797
W: http://www.linux-mm.org
1579315798
T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
1579415799
F: mm/gup.c
15800+
F: mm/gup_test.c
15801+
F: mm/gup_test.h
15802+
F: tools/testing/selftests/mm/gup_longterm.c
15803+
F: tools/testing/selftests/mm/gup_test.c
1579515804

1579615805
MEMORY MANAGEMENT - KSM (Kernel Samepage Merging)
1579715806
M: Andrew Morton <[email protected]>
@@ -15868,6 +15877,7 @@ L: [email protected]
1586815877
S: Maintained
1586915878
F: mm/pt_reclaim.c
1587015879
F: mm/vmscan.c
15880+
F: mm/workingset.c
1587115881

1587215882
MEMORY MANAGEMENT - RMAP (REVERSE MAPPING)
1587315883
M: Andrew Morton <[email protected]>
@@ -15880,6 +15890,7 @@ R: Harry Yoo <[email protected]>
1588015890
1588115891
S: Maintained
1588215892
F: include/linux/rmap.h
15893+
F: mm/page_vma_mapped.c
1588315894
F: mm/rmap.c
1588415895

1588515896
MEMORY MANAGEMENT - SECRETMEM
@@ -15972,11 +15983,14 @@ S: Maintained
1597215983
W: http://www.linux-mm.org
1597315984
T: git git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
1597415985
F: include/trace/events/mmap.h
15986+
F: mm/mincore.c
1597515987
F: mm/mlock.c
1597615988
F: mm/mmap.c
1597715989
F: mm/mprotect.c
1597815990
F: mm/mremap.c
1597915991
F: mm/mseal.c
15992+
F: mm/msync.c
15993+
F: mm/nommu.c
1598015994
F: mm/vma.c
1598115995
F: mm/vma.h
1598215996
F: mm/vma_exec.c
@@ -25027,8 +25041,11 @@ M: Hugh Dickins <[email protected]>
2502725041
R: Baolin Wang <[email protected]>
2502825042
2502925043
S: Maintained
25044+
F: include/linux/memfd.h
2503025045
F: include/linux/shmem_fs.h
25046+
F: mm/memfd.c
2503125047
F: mm/shmem.c
25048+
F: mm/shmem_quota.c
2503225049

2503325050
TOMOYO SECURITY MODULE
2503425051
M: Kentaro Takeda <[email protected]>

drivers/md/bcache/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ config BCACHE
55
select BLOCK_HOLDER_DEPRECATED if SYSFS
66
select CRC64
77
select CLOSURES
8-
select MIN_HEAP
98
help
109
Allows a block device to be used as cache for other devices; uses
1110
a btree for indexing and the layout is optimized for SSDs.

drivers/md/bcache/alloc.c

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -164,61 +164,40 @@ static void bch_invalidate_one_bucket(struct cache *ca, struct bucket *b)
164164
* prio is worth 1/8th of what INITIAL_PRIO is worth.
165165
*/
166166

167-
static inline unsigned int new_bucket_prio(struct cache *ca, struct bucket *b)
168-
{
169-
unsigned int min_prio = (INITIAL_PRIO - ca->set->min_prio) / 8;
170-
171-
return (b->prio - ca->set->min_prio + min_prio) * GC_SECTORS_USED(b);
172-
}
173-
174-
static inline bool new_bucket_max_cmp(const void *l, const void *r, void *args)
175-
{
176-
struct bucket **lhs = (struct bucket **)l;
177-
struct bucket **rhs = (struct bucket **)r;
178-
struct cache *ca = args;
179-
180-
return new_bucket_prio(ca, *lhs) > new_bucket_prio(ca, *rhs);
181-
}
182-
183-
static inline bool new_bucket_min_cmp(const void *l, const void *r, void *args)
184-
{
185-
struct bucket **lhs = (struct bucket **)l;
186-
struct bucket **rhs = (struct bucket **)r;
187-
struct cache *ca = args;
167+
#define bucket_prio(b) \
168+
({ \
169+
unsigned int min_prio = (INITIAL_PRIO - ca->set->min_prio) / 8; \
170+
\
171+
(b->prio - ca->set->min_prio + min_prio) * GC_SECTORS_USED(b); \
172+
})
188173

189-
return new_bucket_prio(ca, *lhs) < new_bucket_prio(ca, *rhs);
190-
}
174+
#define bucket_max_cmp(l, r) (bucket_prio(l) < bucket_prio(r))
175+
#define bucket_min_cmp(l, r) (bucket_prio(l) > bucket_prio(r))
191176

192177
static void invalidate_buckets_lru(struct cache *ca)
193178
{
194179
struct bucket *b;
195-
const struct min_heap_callbacks bucket_max_cmp_callback = {
196-
.less = new_bucket_max_cmp,
197-
.swp = NULL,
198-
};
199-
const struct min_heap_callbacks bucket_min_cmp_callback = {
200-
.less = new_bucket_min_cmp,
201-
.swp = NULL,
202-
};
180+
ssize_t i;
203181

204-
ca->heap.nr = 0;
182+
ca->heap.used = 0;
205183

206184
for_each_bucket(b, ca) {
207185
if (!bch_can_invalidate_bucket(ca, b))
208186
continue;
209187

210-
if (!min_heap_full(&ca->heap))
211-
min_heap_push(&ca->heap, &b, &bucket_max_cmp_callback, ca);
212-
else if (!new_bucket_max_cmp(&b, min_heap_peek(&ca->heap), ca)) {
188+
if (!heap_full(&ca->heap))
189+
heap_add(&ca->heap, b, bucket_max_cmp);
190+
else if (bucket_max_cmp(b, heap_peek(&ca->heap))) {
213191
ca->heap.data[0] = b;
214-
min_heap_sift_down(&ca->heap, 0, &bucket_max_cmp_callback, ca);
192+
heap_sift(&ca->heap, 0, bucket_max_cmp);
215193
}
216194
}
217195

218-
min_heapify_all(&ca->heap, &bucket_min_cmp_callback, ca);
196+
for (i = ca->heap.used / 2 - 1; i >= 0; --i)
197+
heap_sift(&ca->heap, i, bucket_min_cmp);
219198

220199
while (!fifo_full(&ca->free_inc)) {
221-
if (!ca->heap.nr) {
200+
if (!heap_pop(&ca->heap, b, bucket_min_cmp)) {
222201
/*
223202
* We don't want to be calling invalidate_buckets()
224203
* multiple times when it can't do anything
@@ -227,8 +206,6 @@ static void invalidate_buckets_lru(struct cache *ca)
227206
wake_up_gc(ca->set);
228207
return;
229208
}
230-
b = min_heap_peek(&ca->heap)[0];
231-
min_heap_pop(&ca->heap, &bucket_min_cmp_callback, ca);
232209

233210
bch_invalidate_one_bucket(ca, b);
234211
}

drivers/md/bcache/bcache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ struct cache {
458458
/* Allocation stuff: */
459459
struct bucket *buckets;
460460

461-
DEFINE_MIN_HEAP(struct bucket *, cache_heap) heap;
461+
DECLARE_HEAP(struct bucket *, heap);
462462

463463
/*
464464
* If nonzero, we know we aren't going to find any buckets to invalidate

0 commit comments

Comments
 (0)