Implement a prctl() so that tasks can enable the time slice extension mechanism. This fails, when time slice extensions are disabled at compile time or on the kernel command line and when no rseq pointer is registered in the kernel. That allows to implement a single trivial check in the exit to user mode hotpath, to decide whether the whole mechanism needs to be invoked.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -386,4 +386,14 @@ struct prctl_mm_map { · 385 unmodified lines | ||
| 386 | 386 | # define PR_FUTEX_HASH_SET_SLOTS 1 |
| 387 | 387 | # define PR_FUTEX_HASH_GET_SLOTS 2 |
| 388 | 388 | |
| 389 | +/* RSEQ time slice extensions */ | |
| 390 | +#define PR_RSEQ_SLICE_EXTENSION 79 | |
| 391 | +# define PR_RSEQ_SLICE_EXTENSION_GET 1 | |
| 392 | +# define PR_RSEQ_SLICE_EXTENSION_SET 2 | |
| 393 | +/* | |
| 394 | + * Bits for RSEQ_SLICE_EXTENSION_GET/SET | |
| 395 | + * PR_RSEQ_SLICE_EXT_ENABLE: Enable | |
| 396 | + */ | |
| 397 | +# define PR_RSEQ_SLICE_EXT_ENABLE 0x01 | |
| 398 | + | |
| 389 | 399 | #endif /* _LINUX_PRCTL_H */ |