Lines Matching defs:nice
19 static inline int __normal_prio(int policy, int rt_prio, int nice)
28 prio = NICE_TO_PRIO(nice);
65 void set_user_nice(struct task_struct *p, long nice)
71 if (task_nice(p) == nice || nice < MIN_NICE || nice > MAX_NICE)
84 * allow the 'normal' nice value to be set - but as expected
89 p->static_prio = NICE_TO_PRIO(nice);
100 p->static_prio = NICE_TO_PRIO(nice);
119 * is_nice_reduction - check if nice value is an actual reduction
124 * @nice: nice value
126 static bool is_nice_reduction(const struct task_struct *p, const int nice)
128 /* Convert nice value [19,-20] to rlimit style value [1,40]: */
129 int nice_rlim = nice_to_rlimit(nice);
135 * can_nice - check if a task can reduce its nice value
137 * @nice: nice value
139 int can_nice(const struct task_struct *p, const int nice)
141 return is_nice_reduction(p, nice) || capable(CAP_SYS_NICE);
153 SYSCALL_DEFINE1(nice, int, increment)
155 long nice, retval;
163 nice = task_nice(current) + increment;
165 nice = clamp_val(nice, MIN_NICE, MAX_NICE);
166 if (increment < 0 && !can_nice(current, nice))
169 retval = security_task_setnice(current, nice);
173 set_user_nice(current, nice);
185 * sched policy return value kernel prio user prio/nice
491 * Treat SCHED_IDLE as nice 20. Only allow a switch to
864 void sched_set_normal(struct task_struct *p, int nice)
868 .sched_nice = nice,
899 /* Zero the full structure, so that a short copy will be nice: */
1403 * If you want to use yield() to be 'nice' for others, use cond_resched().