[RFC 16/18] limits: track RLIMIT_NICE actual max
From: Topi Miettinen
Date: Mon Jun 13 2016 - 15:49:20 EST
Track maximum nice priority, presented in /proc/self/limits.
Signed-off-by: Topi Miettinen <toiwoton@xxxxxxxxx>
---
kernel/sched/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 017d539..817d720 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -3692,6 +3692,8 @@ void set_user_nice(struct task_struct *p, long nice)
if (delta < 0 || (delta > 0 && task_running(rq, p)))
resched_curr(rq);
}
+ task_bump_rlimit(p, RLIMIT_NICE, nice_to_rlimit(nice));
+
out_unlock:
task_rq_unlock(rq, p, &rf);
}
--
2.8.1