[Devel] [PATCH rh7] sched_show_task: call task_ve_name() under RCU lock

Andrey Ryabinin aryabinin at virtuozzo.com
Wed Feb 8 01:36:28 PST 2017


task_ve_name() requires rcu_read_lock() held

===============================
[ INFO: suspicious RCU usage. ]
3.10.0-514.6.1.vz7.28.5.debug #1 Not tainted
-------------------------------
kernel/ve/ve.c:165 suspicious rcu_dereference_check() usage!

Call Trace:
 <IRQ>  [<ffffffff82559001>] dump_stack+0x1e/0x20
 [<ffffffff81339a25>] lockdep_rcu_suspicious+0x165/0x1c0
 [<ffffffff8132a973>] task_ve_name+0xe3/0x130
 [<ffffffff8126a044>] sched_show_task+0x1c4/0x320
 [<ffffffff81278d08>] dump_cpu_task+0x78/0xe0
 [<ffffffff814179e8>] rcu_dump_cpu_stacks+0x1d8/0x2a0
 [<ffffffff81424b00>] rcu_check_callbacks+0x12e0/0x1f60
 [<ffffffff811cc68d>] update_process_times+0x4d/0xc0
 [<ffffffff8130643a>] tick_sched_handle.isra.13+0x5a/0x100
 [<ffffffff8130826b>] tick_sched_timer+0x7b/0x130
 [<ffffffff8122bcfd>] __hrtimer_run_queues+0x38d/0xe40
 [<ffffffff813081f0>] ? tick_sched_do_timer+0x1e0/0x1e0
 [<ffffffff8122b970>] ? hrtimer_start+0x40/0x40
 [<ffffffff812f2f80>] ? ktime_get_update_offsets_now+0x1b0/0x2a0
 [<ffffffff8122d3e0>] hrtimer_interrupt+0x180/0x420
 [<ffffffff810fb036>] local_apic_timer_interrupt+0x76/0xf0
 [<ffffffff8258dbfd>] smp_apic_timer_interrupt+0x7d/0xa0
 [<ffffffff8258c072>] apic_timer_interrupt+0x72/0x80

https://jira.sw.ru/browse/PSBM-60139
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 kernel/sched/core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index cfd4bac..71eeb07 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -5795,11 +5795,10 @@ void sched_show_task(struct task_struct *p)
 #endif
 	rcu_read_lock();
 	ppid = task_pid_nr(rcu_dereference(p->real_parent));
-	rcu_read_unlock();
 	printk(KERN_CONT "%5lu %5d %6d %4s 0x%08lx\n", free,
 		task_pid_nr(p), ppid,
 		task_ve_name(p), (unsigned long)task_thread_info(p)->flags);
-
+	rcu_read_unlock();
 	print_worker_info(KERN_INFO, p);
 	show_stack(p, NULL);
 }
-- 
2.10.2



More information about the Devel mailing list