summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2011-07-17 20:46:52 +0200
committerClark Williams <williams@redhat.com>2011-11-14 11:01:51 -0600
commit5fcd2c8066fa561e863a4e2b39a752c4dd21fee4 (patch)
tree5ab0fa1efa6b29879bafefdbf9b61e74791317f9
parentc1517bc5de86605c6e7c7910aa41272abd949ee7 (diff)
sched-no-work-when-pi-blocked.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--include/linux/sched.h8
-rw-r--r--kernel/sched.c5
2 files changed, 12 insertions, 1 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 38469d32e353..58a2fa3e80cb 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2092,12 +2092,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);
diff --git a/kernel/sched.c b/kernel/sched.c
index 5161c64f64f1..d7d24bf8d662 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4461,7 +4461,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;
/*
@@ -4481,6 +4481,9 @@ static inline void sched_submit_work(struct task_struct *tsk)
static inline void sched_update_worker(struct task_struct *tsk)
{
+ if (tsk_is_pi_blocked(tsk))
+ return;
+
if (tsk->flags & PF_WQ_WORKER)
wq_worker_running(tsk);
}