linux/debian/patches/features/all/rt/0150-sched-no-work-when-pi-...

63 lines
1.7 KiB
Diff

From dd97a1f5ab811d126ed8fff8fd9dc43dbbb845ee Mon Sep 17 00:00:00 2001
From: Thomas Gleixner <tglx@linutronix.de>
Date: Sun, 17 Jul 2011 20:46:52 +0200
Subject: [PATCH 150/267] sched-no-work-when-pi-blocked.patch
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
---
include/linux/sched.h | 8 ++++++++
kernel/sched.c | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 38d78dc..99e7f8b 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2095,12 +2095,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 af3883b..5b871cb 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);
}
--
1.7.10