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.

sched/mmcid: Move initialization out of line

It's getting bigger soon, so just move it out of line to the rest of the
code.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/20251119172549.769636491@linutronix.de

+15 -14
+1 -14
include/linux/mm_types.h
··· 1351 1351 return (unsigned long *)cid_bitmap; 1352 1352 } 1353 1353 1354 - static inline void mm_init_cid(struct mm_struct *mm, struct task_struct *p) 1355 - { 1356 - int i; 1357 - 1358 - for_each_possible_cpu(i) { 1359 - struct mm_cid_pcpu *pcpu = per_cpu_ptr(mm->mm_cid.pcpu, i); 1360 - 1361 - pcpu->cid = MM_CID_UNSET; 1362 - } 1363 - mm->mm_cid.nr_cpus_allowed = p->nr_cpus_allowed; 1364 - raw_spin_lock_init(&mm->mm_cid.lock); 1365 - cpumask_copy(mm_cpus_allowed(mm), &p->cpus_mask); 1366 - bitmap_zero(mm_cidmask(mm), num_possible_cpus()); 1367 - } 1354 + void mm_init_cid(struct mm_struct *mm, struct task_struct *p); 1368 1355 1369 1356 static inline int mm_alloc_cid_noprof(struct mm_struct *mm, struct task_struct *p) 1370 1357 {
+14
kernel/sched/core.c
··· 10431 10431 WARN_ON_ONCE(!t->mm || t->mm_cid.cid != MM_CID_UNSET); 10432 10432 t->mm_cid.active = 1; 10433 10433 } 10434 + 10435 + void mm_init_cid(struct mm_struct *mm, struct task_struct *p) 10436 + { 10437 + struct mm_cid_pcpu __percpu *pcpu = mm->mm_cid.pcpu; 10438 + int cpu; 10439 + 10440 + for_each_possible_cpu(cpu) 10441 + per_cpu_ptr(pcpu, cpu)->cid = MM_CID_UNSET; 10442 + 10443 + mm->mm_cid.nr_cpus_allowed = p->nr_cpus_allowed; 10444 + raw_spin_lock_init(&mm->mm_cid.lock); 10445 + cpumask_copy(mm_cpus_allowed(mm), &p->cpus_mask); 10446 + bitmap_zero(mm_cidmask(mm), num_possible_cpus()); 10447 + } 10434 10448 #else /* CONFIG_SCHED_MM_CID */ 10435 10449 static inline void mm_update_cpus_allowed(struct mm_struct *mm, const struct cpumask *affmsk) { } 10436 10450 #endif /* !CONFIG_SCHED_MM_CID */