From: Thomas Gleixner Date: Wed, 19 Nov 2025 17:26:49 +0000 (+0100) Subject: sched/mmcid: Cacheline align MM CID storage X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be4463fa2c7185823d2989562162d578b45a89ae;p=thirdparty%2Fkernel%2Flinux.git sched/mmcid: Cacheline align MM CID storage Both the per CPU storage and the data in mm_struct are heavily used in context switch. As they can end up next to other frequently modified data, they are subject to false sharing. Make them cache line aligned. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Mathieu Desnoyers Link: https://patch.msgid.link/20251119172549.194111661@linutronix.de --- diff --git a/include/linux/rseq_types.h b/include/linux/rseq_types.h index e444dd267c7aa..d7e8071b626a4 100644 --- a/include/linux/rseq_types.h +++ b/include/linux/rseq_types.h @@ -112,7 +112,7 @@ struct sched_mm_cid { */ struct mm_cid_pcpu { unsigned int cid; -}; +}____cacheline_aligned_in_smp; /** * struct mm_mm_cid - Storage for per MM CID data @@ -126,7 +126,7 @@ struct mm_mm_cid { struct mm_cid_pcpu __percpu *pcpu; unsigned int nr_cpus_allowed; raw_spinlock_t lock; -}; +}____cacheline_aligned_in_smp; #else /* CONFIG_SCHED_MM_CID */ struct mm_mm_cid { }; struct sched_mm_cid { };