Skip to content

Commit 3f31a80

Browse files
committed
Merge tag 'mm-hotfixes-stable-2025-07-11-16-16' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
Pull misc fixes from Andrew Morton: "19 hotfixes. A whopping 16 are cc:stable and the remainder address post-6.15 issues or aren't considered necessary for -stable kernels. 14 are for MM. Three gdb-script fixes and a kallsyms build fix" * tag 'mm-hotfixes-stable-2025-07-11-16-16' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: Revert "sched/numa: add statistics of numa balance task" mm: fix the inaccurate memory statistics issue for users mm/damon: fix divide by zero in damon_get_intervals_score() samples/damon: fix damon sample mtier for start failure samples/damon: fix damon sample wsse for start failure samples/damon: fix damon sample prcl for start failure kasan: remove kasan_find_vm_area() to prevent possible deadlock scripts: gdb: vfs: support external dentry names mm/migrate: fix do_pages_stat in compat mode mm/damon/core: handle damon_call_control as normal under kdmond deactivation mm/rmap: fix potential out-of-bounds page table access during batched unmap mm/hugetlb: don't crash when allocating a folio if there are no resv scripts/gdb: de-reference per-CPU MCE interrupts scripts/gdb: fix interrupts.py after maple tree conversion maple_tree: fix mt_destroy_walk() on root leaf node mm/vmalloc: leave lazy MMU mode on PTE mapping error scripts/gdb: fix interrupts display after MCP on x86 lib/alloc_tag: do not acquire non-existent lock in alloc_tag_top_users() kallsyms: fix build without execinfo
2 parents 3b428e1 + db6cc3f commit 3f31a80

File tree

26 files changed

+399
-130
lines changed

26 files changed

+399
-130
lines changed

Documentation/admin-guide/cgroup-v2.rst

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,12 +1732,6 @@ The following nested keys are defined.
17321732
numa_hint_faults (npn)
17331733
Number of NUMA hinting faults.
17341734

1735-
numa_task_migrated (npn)
1736-
Number of task migration by NUMA balancing.
1737-
1738-
numa_task_swapped (npn)
1739-
Number of task swap by NUMA balancing.
1740-
17411735
pgdemote_kswapd
17421736
Number of pages demoted by kswapd.
17431737

fs/proc/task_mmu.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
3636
unsigned long text, lib, swap, anon, file, shmem;
3737
unsigned long hiwater_vm, total_vm, hiwater_rss, total_rss;
3838

39-
anon = get_mm_counter(mm, MM_ANONPAGES);
40-
file = get_mm_counter(mm, MM_FILEPAGES);
41-
shmem = get_mm_counter(mm, MM_SHMEMPAGES);
39+
anon = get_mm_counter_sum(mm, MM_ANONPAGES);
40+
file = get_mm_counter_sum(mm, MM_FILEPAGES);
41+
shmem = get_mm_counter_sum(mm, MM_SHMEMPAGES);
4242

4343
/*
4444
* Note: to minimize their overhead, mm maintains hiwater_vm and
@@ -59,7 +59,7 @@ void task_mem(struct seq_file *m, struct mm_struct *mm)
5959
text = min(text, mm->exec_vm << PAGE_SHIFT);
6060
lib = (mm->exec_vm << PAGE_SHIFT) - text;
6161

62-
swap = get_mm_counter(mm, MM_SWAPENTS);
62+
swap = get_mm_counter_sum(mm, MM_SWAPENTS);
6363
SEQ_PUT_DEC("VmPeak:\t", hiwater_vm);
6464
SEQ_PUT_DEC(" kB\nVmSize:\t", total_vm);
6565
SEQ_PUT_DEC(" kB\nVmLck:\t", mm->locked_vm);
@@ -92,12 +92,12 @@ unsigned long task_statm(struct mm_struct *mm,
9292
unsigned long *shared, unsigned long *text,
9393
unsigned long *data, unsigned long *resident)
9494
{
95-
*shared = get_mm_counter(mm, MM_FILEPAGES) +
96-
get_mm_counter(mm, MM_SHMEMPAGES);
95+
*shared = get_mm_counter_sum(mm, MM_FILEPAGES) +
96+
get_mm_counter_sum(mm, MM_SHMEMPAGES);
9797
*text = (PAGE_ALIGN(mm->end_code) - (mm->start_code & PAGE_MASK))
9898
>> PAGE_SHIFT;
9999
*data = mm->data_vm + mm->stack_vm;
100-
*resident = *shared + get_mm_counter(mm, MM_ANONPAGES);
100+
*resident = *shared + get_mm_counter_sum(mm, MM_ANONPAGES);
101101
return mm->total_vm;
102102
}
103103

include/linux/mm.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,6 +2568,11 @@ static inline unsigned long get_mm_counter(struct mm_struct *mm, int member)
25682568
return percpu_counter_read_positive(&mm->rss_stat[member]);
25692569
}
25702570

2571+
static inline unsigned long get_mm_counter_sum(struct mm_struct *mm, int member)
2572+
{
2573+
return percpu_counter_sum_positive(&mm->rss_stat[member]);
2574+
}
2575+
25712576
void mm_trace_rss_stat(struct mm_struct *mm, int member);
25722577

25732578
static inline void add_mm_counter(struct mm_struct *mm, int member, long value)

include/linux/sched.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,10 +548,6 @@ struct sched_statistics {
548548
u64 nr_failed_migrations_running;
549549
u64 nr_failed_migrations_hot;
550550
u64 nr_forced_migrations;
551-
#ifdef CONFIG_NUMA_BALANCING
552-
u64 numa_task_migrated;
553-
u64 numa_task_swapped;
554-
#endif
555551

556552
u64 nr_wakeups;
557553
u64 nr_wakeups_sync;

include/linux/vm_event_item.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
6666
NUMA_HINT_FAULTS,
6767
NUMA_HINT_FAULTS_LOCAL,
6868
NUMA_PAGE_MIGRATE,
69-
NUMA_TASK_MIGRATE,
70-
NUMA_TASK_SWAP,
7169
#endif
7270
#ifdef CONFIG_MIGRATION
7371
PGMIGRATE_SUCCESS, PGMIGRATE_FAIL,

kernel/sched/core.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3362,10 +3362,6 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
33623362
#ifdef CONFIG_NUMA_BALANCING
33633363
static void __migrate_swap_task(struct task_struct *p, int cpu)
33643364
{
3365-
__schedstat_inc(p->stats.numa_task_swapped);
3366-
count_vm_numa_event(NUMA_TASK_SWAP);
3367-
count_memcg_event_mm(p->mm, NUMA_TASK_SWAP);
3368-
33693365
if (task_on_rq_queued(p)) {
33703366
struct rq *src_rq, *dst_rq;
33713367
struct rq_flags srf, drf;
@@ -7939,9 +7935,8 @@ int migrate_task_to(struct task_struct *p, int target_cpu)
79397935
if (!cpumask_test_cpu(target_cpu, p->cpus_ptr))
79407936
return -EINVAL;
79417937

7942-
__schedstat_inc(p->stats.numa_task_migrated);
7943-
count_vm_numa_event(NUMA_TASK_MIGRATE);
7944-
count_memcg_event_mm(p->mm, NUMA_TASK_MIGRATE);
7938+
/* TODO: This is not properly updating schedstats */
7939+
79457940
trace_sched_move_numa(p, curr_cpu, target_cpu);
79467941
return stop_one_cpu(curr_cpu, migration_cpu_stop, &arg);
79477942
}

kernel/sched/debug.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,10 +1210,6 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
12101210
P_SCHEDSTAT(nr_failed_migrations_running);
12111211
P_SCHEDSTAT(nr_failed_migrations_hot);
12121212
P_SCHEDSTAT(nr_forced_migrations);
1213-
#ifdef CONFIG_NUMA_BALANCING
1214-
P_SCHEDSTAT(numa_task_migrated);
1215-
P_SCHEDSTAT(numa_task_swapped);
1216-
#endif
12171213
P_SCHEDSTAT(nr_wakeups);
12181214
P_SCHEDSTAT(nr_wakeups_sync);
12191215
P_SCHEDSTAT(nr_wakeups_migrate);

lib/alloc_tag.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ size_t alloc_tag_top_users(struct codetag_bytes *tags, size_t count, bool can_sl
135135
struct codetag_bytes n;
136136
unsigned int i, nr = 0;
137137

138+
if (IS_ERR_OR_NULL(alloc_tag_cttype))
139+
return 0;
140+
138141
if (can_sleep)
139142
codetag_lock_module_list(alloc_tag_cttype, true);
140143
else if (!codetag_trylock_module_list(alloc_tag_cttype))

lib/maple_tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5319,6 +5319,7 @@ static void mt_destroy_walk(struct maple_enode *enode, struct maple_tree *mt,
53195319
struct maple_enode *start;
53205320

53215321
if (mte_is_leaf(enode)) {
5322+
mte_set_node_dead(enode);
53225323
node->type = mte_node_type(enode);
53235324
goto free_leaf;
53245325
}

mm/damon/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,6 +1449,7 @@ static unsigned long damon_get_intervals_score(struct damon_ctx *c)
14491449
}
14501450
}
14511451
target_access_events = max_access_events * goal_bp / 10000;
1452+
target_access_events = target_access_events ? : 1;
14521453
return access_events * 10000 / target_access_events;
14531454
}
14541455

@@ -2355,9 +2356,8 @@ static void kdamond_usleep(unsigned long usecs)
23552356
*
23562357
* If there is a &struct damon_call_control request that registered via
23572358
* &damon_call() on @ctx, do or cancel the invocation of the function depending
2358-
* on @cancel. @cancel is set when the kdamond is deactivated by DAMOS
2359-
* watermarks, or the kdamond is already out of the main loop and therefore
2360-
* will be terminated.
2359+
* on @cancel. @cancel is set when the kdamond is already out of the main loop
2360+
* and therefore will be terminated.
23612361
*/
23622362
static void kdamond_call(struct damon_ctx *ctx, bool cancel)
23632363
{
@@ -2405,7 +2405,7 @@ static int kdamond_wait_activation(struct damon_ctx *ctx)
24052405
if (ctx->callback.after_wmarks_check &&
24062406
ctx->callback.after_wmarks_check(ctx))
24072407
break;
2408-
kdamond_call(ctx, true);
2408+
kdamond_call(ctx, false);
24092409
damos_walk_cancel(ctx);
24102410
}
24112411
return -EBUSY;

0 commit comments

Comments
 (0)