summaryrefslogtreecommitdiff
path: root/include/uapi/linux/rseq.h
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2022-11-22 23:39:10 +0300
committerPeter Zijlstra <peterz@infradead.org>2022-12-27 14:52:12 +0300
commitf7b01bb0b57f994a44ea6368536b59062b796381 (patch)
treeb5e315e3661c3c74156b4136d6133dae3b741e8d /include/uapi/linux/rseq.h
parentaf7f588d8f7355bc4298dd1962d7826358fc95f0 (diff)
downloadlinux-f7b01bb0b57f994a44ea6368536b59062b796381.tar.xz
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
Diffstat (limited to 'include/uapi/linux/rseq.h')
-rw-r--r--include/uapi/linux/rseq.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h
index 1cb90a435c5c..c233aae5eac9 100644
--- a/include/uapi/linux/rseq.h
+++ b/include/uapi/linux/rseq.h
@@ -140,6 +140,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.
*/
char end[];