Skip to content

Commit be4463f

Browse files
KAGA-KOKOPeter Zijlstra
authored andcommitted
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 <tglx@linutronix.de> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Link: https://patch.msgid.link/20251119172549.194111661@linutronix.de
1 parent 8cea569 commit be4463f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/linux/rseq_types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ struct sched_mm_cid {
112112
*/
113113
struct mm_cid_pcpu {
114114
unsigned int cid;
115-
};
115+
}____cacheline_aligned_in_smp;
116116

117117
/**
118118
* struct mm_mm_cid - Storage for per MM CID data
@@ -126,7 +126,7 @@ struct mm_mm_cid {
126126
struct mm_cid_pcpu __percpu *pcpu;
127127
unsigned int nr_cpus_allowed;
128128
raw_spinlock_t lock;
129-
};
129+
}____cacheline_aligned_in_smp;
130130
#else /* CONFIG_SCHED_MM_CID */
131131
struct mm_mm_cid { };
132132
struct sched_mm_cid { };

0 commit comments

Comments
 (0)