rseq: Extend struct rseq with per-memory-map concurrency ID
If a memory map has fewer threads than there are cores on the system, or is limited to run on few cores concurrently through sched affinity or cgroup cpusets, the concurrency IDs will be values close to 0, thus allowing efficient use of user-space memory for per-cpu data structures. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20221122203932.231377-9-mathieu.desnoyers@efficios.com
This commit is contained in:
committed by
Peter Zijlstra
parent
af7f588d8f
commit
f7b01bb0b5
@@ -139,6 +139,15 @@ struct rseq {
|
||||
*/
|
||||
__u32 node_id;
|
||||
|
||||
/*
|
||||
* Restartable sequences mm_cid field. Updated by the kernel. Read by
|
||||
* user-space with single-copy atomicity semantics. This field should
|
||||
* only be read by the thread which registered this data structure.
|
||||
* Aligned on 32-bit. Contains the current thread's concurrency ID
|
||||
* (allocated uniquely within a memory map).
|
||||
*/
|
||||
__u32 mm_cid;
|
||||
|
||||
/*
|
||||
* Flexible array member at end of structure, after last feature field.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user