aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 03:02:35 -0400
commit1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch)
tree47da3feee8e263e8c9352c85cf518e624be3c211 /kernel/sched/core.c
parent750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff)
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 18a6966567da..d17c5da523a0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5166,6 +5166,28 @@ void sched_show_task(struct task_struct *p)
5166 put_task_stack(p); 5166 put_task_stack(p);
5167} 5167}
5168 5168
5169static inline bool
5170state_filter_match(unsigned long state_filter, struct task_struct *p)
5171{
5172 /* no filter, everything matches */
5173 if (!state_filter)
5174 return true;
5175
5176 /* filter, but doesn't match */
5177 if (!(p->state & state_filter))
5178 return false;
5179
5180 /*
5181 * When looking for TASK_UNINTERRUPTIBLE skip TASK_IDLE (allows
5182 * TASK_KILLABLE).
5183 */
5184 if (state_filter == TASK_UNINTERRUPTIBLE && p->state == TASK_IDLE)
5185 return false;
5186
5187 return true;
5188}
5189
5190
5169void show_state_filter(unsigned long state_filter) 5191void show_state_filter(unsigned long state_filter)
5170{ 5192{
5171 struct task_struct *g, *p; 5193 struct task_struct *g, *p;
@@ -5188,7 +5210,7 @@ void show_state_filter(unsigned long state_filter)
5188 */ 5210 */
5189 touch_nmi_watchdog(); 5211 touch_nmi_watchdog();
5190 touch_all_softlockup_watchdogs(); 5212 touch_all_softlockup_watchdogs();
5191 if (!state_filter || (p->state & state_filter)) 5213 if (state_filter_match(state_filter, p))
5192 sched_show_task(p); 5214 sched_show_task(p);
5193 } 5215 }
5194 5216