diff options
| author | Paul E. McKenney <paulmck@kernel.org> | 2026-05-07 09:57:16 -0700 |
|---|---|---|
| committer | Uladzislau Rezki (Sony) <urezki@gmail.com> | 2026-05-24 09:38:47 +0200 |
| commit | 59cf5dbcc95f11a6b03fad9fe9723ff31149459b (patch) | |
| tree | 4c7cfde7f863c10feb5923a80089a67ac93ee8dc /include/linux | |
| parent | aa61e8b4fb2c9c5315228d0c830b5b2ae4df5cca (diff) | |
torture: Add torture_sched_set_normal() for user-specified nice values
This new torture_sched_set_normal() function clamps the nice value at
the MIN_NICE..MAX_NICE limits, splatting it these limits are exceeded.
It then invokes sched_set_normal() to set the new value. This prevents
more difficult-to-debug failures within the scheduler.
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/torture.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/torture.h b/include/linux/torture.h index 1b59056c3b18..c9b47d138302 100644 --- a/include/linux/torture.h +++ b/include/linux/torture.h @@ -129,6 +129,7 @@ void _torture_stop_kthread(char *m, struct task_struct **tp); #else #define torture_preempt_schedule() do { } while (0) #endif +void torture_sched_set_normal(struct task_struct *t, int nice); #if IS_ENABLED(CONFIG_RCU_TORTURE_TEST) || IS_MODULE(CONFIG_RCU_TORTURE_TEST) || IS_ENABLED(CONFIG_LOCK_TORTURE_TEST) || IS_MODULE(CONFIG_LOCK_TORTURE_TEST) long torture_sched_setaffinity(pid_t pid, const struct cpumask *in_mask, bool dowarn); |
