From d80d5e62f999e221359c5167298bfae47e28ba41 Mon Sep 17 00:00:00 2001 From: Peter Zijlstra Date: Fri, 3 Jul 2009 08:29:20 -0500 Subject: [PATCH] sched: Rename rt_mutex_setprio to task_setprio commit 6e17f3fcca399785c4850fce0b5000a9cf1a9157 in tip. In RT we have multiple non-mutex users of this function. Rename it. Signed-off-by: Peter Zijlstra Signed-off-by: Ingo Molnar Signed-off-by: Thomas Gleixner Signed-off-by: Paul Gortmaker --- include/linux/sched.h | 7 ++++++- kernel/sched.c | 12 +++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index 2b7b81d..53e6ffe 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1904,9 +1904,14 @@ int sched_rt_handler(struct ctl_table *table, int write, extern unsigned int sysctl_sched_compat_yield; +extern void task_setprio(struct task_struct *p, int prio); + #ifdef CONFIG_RT_MUTEXES extern int rt_mutex_getprio(struct task_struct *p); -extern void rt_mutex_setprio(struct task_struct *p, int prio); +static inline void rt_mutex_setprio(struct task_struct *p, int prio) +{ + task_setprio(p, prio); +} extern void rt_mutex_adjust_pi(struct task_struct *p); #else static inline int rt_mutex_getprio(struct task_struct *p) diff --git a/kernel/sched.c b/kernel/sched.c index 3c2a54f..07ab8fd 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4254,19 +4254,19 @@ long __sched sleep_on_timeout(wait_queue_head_t *q, long timeout) } EXPORT_SYMBOL(sleep_on_timeout); -#ifdef CONFIG_RT_MUTEXES - /* - * rt_mutex_setprio - set the current priority of a task + * task_setprio - set the current priority of a task * @p: task * @prio: prio value (kernel-internal form) * * This function changes the 'effective' priority of a task. It does * not touch ->normal_prio like __setscheduler(). * - * Used by the rt_mutex code to implement priority inheritance logic. + * Used by the rt_mutex code to implement priority inheritance logic + * and by rcupreempt-boost to boost priorities of tasks sleeping + * with rcu locks. */ -void rt_mutex_setprio(struct task_struct *p, int prio) +void task_setprio(struct task_struct *p, int prio) { unsigned long flags; int oldprio, on_rq, running; @@ -4304,8 +4304,6 @@ void rt_mutex_setprio(struct task_struct *p, int prio) task_rq_unlock(rq, &flags); } -#endif - void set_user_nice(struct task_struct *p, long nice) { int old_prio, delta, on_rq; -- 1.7.0.4