]> git.karo-electronics.de Git - linux-beck.git/commitdiff
sched/rt: Do not submit new work when PI-blocked
authorThomas Gleixner <tglx@linutronix.de>
Sun, 17 Jul 2011 18:46:52 +0000 (20:46 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 1 Mar 2012 09:46:54 +0000 (10:46 +0100)
When we are PI-blocked then we want to get things done ASAP.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/n/tip-vw8et3445km5b8mpihf4trae@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@elte.hu>
include/linux/sched.h
kernel/sched/core.c

index 03dd224d066748266a00dbac9aeefa6f04320a66..c628a91514378b19796547a3b46f0adc17ba4539 100644 (file)
@@ -2082,12 +2082,20 @@ extern unsigned int sysctl_sched_cfs_bandwidth_slice;
 extern int rt_mutex_getprio(struct task_struct *p);
 extern void rt_mutex_setprio(struct task_struct *p, int prio);
 extern void rt_mutex_adjust_pi(struct task_struct *p);
+static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
+{
+       return tsk->pi_blocked_on != NULL;
+}
 #else
 static inline int rt_mutex_getprio(struct task_struct *p)
 {
        return p->normal_prio;
 }
 # define rt_mutex_adjust_pi(p)         do { } while (0)
+static inline bool tsk_is_pi_blocked(struct task_struct *tsk)
+{
+       return false;
+}
 #endif
 
 extern bool yield_to(struct task_struct *p, bool preempt);
index c2bbdecaa27dae171df8bb00049510871ebdd9e6..25e06a5e048b9d24a5fb9bd5b49a29d60294504a 100644 (file)
@@ -3227,7 +3227,7 @@ need_resched:
 
 static inline void sched_submit_work(struct task_struct *tsk)
 {
-       if (!tsk->state)
+       if (!tsk->state || tsk_is_pi_blocked(tsk))
                return;
        /*
         * If we are going to sleep and we have plugged IO queued,