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.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -139,6 +139,15 @@ struct rseq { · 138 unmodified lines | ||
| 139 | 139 | */ |
| 140 | 140 | __u32 node_id; |
| 141 | 141 | |
| 142 | + /* | |
| 143 | + * Restartable sequences mm_cid field. Updated by the kernel. Read by | |
| 144 | + * user-space with single-copy atomicity semantics. This field should | |
| 145 | + * only be read by the thread which registered this data structure. | |
| 146 | + * Aligned on 32-bit. Contains the current thread's concurrency ID | |
| 147 | + * (allocated uniquely within a memory map). | |
| 148 | + */ | |
| 149 | + __u32 mm_cid; | |
| 150 | + | |
| 142 | 151 | /* |
| 143 | 152 | * Flexible array member at end of structure, after last feature field. |
| 144 | 153 | */ |