sched: fix: don't take a mutex from interrupt context
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 25 Jan 2008 20:08:34 +0000 (21:08 +0100)
committerIngo Molnar <mingo@elte.hu>
Fri, 25 Jan 2008 20:08:34 +0000 (21:08 +0100)
print_cfs_stats is callable from interrupt context (sysrq), hence it should
not take mutexes. Change it to use RCU since the task group data is RCU
freed anyway.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/sched_fair.c

index 1b3b40a..45ff4e9 100644 (file)
@@ -1434,9 +1434,9 @@ static void print_cfs_stats(struct seq_file *m, int cpu)
 #ifdef CONFIG_FAIR_GROUP_SCHED
        print_cfs_rq(m, cpu, &cpu_rq(cpu)->cfs);
 #endif
-       lock_task_group_list();
+       rcu_read_lock();
        for_each_leaf_cfs_rq(cpu_rq(cpu), cfs_rq)
                print_cfs_rq(m, cpu, cfs_rq);
-       unlock_task_group_list();
+       rcu_read_unlock();
 }
 #endif