[GIT pull] scheduler fixes for 4.9

From: Thomas Gleixner
Date: Sat Nov 05 2016 - 12:15:59 EST


Linus,

please pull the latest sched-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git sched-urgent-for-linus

Two small patches related to sched_show_task():

- Make sure to hold a reference on the task stack while accessing it

- Remove the thread_saved_pc printout


Thanks,

tglx

------------------>
Linus Torvalds (1):
sched/core: Remove pointless printout in sched_show_task()

Tetsuo Handa (1):
sched/core: Fix oops in sched_show_task()


kernel/sched/core.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 42d4027f9e26..154fd689fe02 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5192,21 +5192,14 @@ void sched_show_task(struct task_struct *p)
int ppid;
unsigned long state = p->state;

+ if (!try_get_task_stack(p))
+ return;
if (state)
state = __ffs(state) + 1;
printk(KERN_INFO "%-15.15s %c", p->comm,
state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
-#if BITS_PER_LONG == 32
- if (state == TASK_RUNNING)
- printk(KERN_CONT " running ");
- else
- printk(KERN_CONT " %08lx ", thread_saved_pc(p));
-#else
if (state == TASK_RUNNING)
printk(KERN_CONT " running task ");
- else
- printk(KERN_CONT " %016lx ", thread_saved_pc(p));
-#endif
#ifdef CONFIG_DEBUG_STACK_USAGE
free = stack_not_used(p);
#endif
@@ -5221,6 +5214,7 @@ void sched_show_task(struct task_struct *p)

print_worker_info(KERN_INFO, p);
show_stack(p, NULL);
+ put_task_stack(p);
}

void show_state_filter(unsigned long state_filter)