check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
PATCH 1/1 check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
check_for_tasks() doesn't need to disable irqs, recursive read_lock() from interrupt is fine.
While at it, s/do_each_thread/for_each_process_thread/.
--- kernel/cpu.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
kernel/cpu.c +4 -4
@@ -302,8 +302,8 @@ static inline void check_for_tasks(int dead_cpu) {struct task_struct *g, *p; -read_lock_irq (&tasklist_lock); - do_each_thread(g, p) { +read_lock (&tasklist_lock); +for_each_process_thread (g, p) {if (!p->on_rq)continue ;/*
@@ -318,8 +318,8 @@ static inline void check_for_tasks(int dead_cpu)pr_warn ("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n" , p->comm,task_pid_nr (p), dead_cpu, p->state, p->flags); - }while_each_thread (g, p); -read_unlock_irq (&tasklist_lock); + } +read_unlock (&tasklist_lock); }struct take_cpu_down_param {
Signature · 1 line
1.5.5.1
Quoted 6 lines · Oleg Nesterov
check_for_tasks()doesn't need to disable irqs, recursiveread_lock()from interrupt is fine.While at it, s/do_each_thread/for_each_process_thread/.
Signed-off-by Oleg Nesterov <[email protected]>
Quoted 31 lines
--- kernel/cpu.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)kernel/cpu.c +4
-4@@ -302,8 +302,8 @@ static inline void check_for_tasks(int dead_cpu) {struct task_struct *g, *p; -read_lock_irq (&tasklist_lock); - do_each_thread(g, p) { +read_lock (&tasklist_lock); +for_each_process_thread (g, p) {if (!p->on_rq)continue ;/* @@ -318,8 +318,8 @@ static inline void check_for_tasks(int dead_cpu)pr_warn ("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n" , p->comm,task_pid_nr (p), dead_cpu, p->state, p->flags); - }while_each_thread (g, p); -read_unlock_irq (&tasklist_lock); + } +read_unlock (&tasklist_lock); }struct take_cpu_down_param {
Quoted 6 lines · Oleg Nesterov
check_for_tasks()doesn't need to disable irqs, recursiveread_lock()from interrupt is fine.While at it, s/do_each_thread/for_each_process_thread/.
Signed-off-by Oleg Nesterov <[email protected]>
Looks good to me.
Quoted 4 lines
--- kernel/cpu.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
Signature · 2 lines
Thanks and Regards Srikar Dronamraju
tip-bot for Oleg Nesterov
merge bot[tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn' t need to disable irqs
In reply to Oleg Nesterovcpu/hotplug: Read_lock(tasklist_lock) doesn't need to disable irqs
Commit-ID: a75a6068dac25d4022ebcd82192ed6345407843c Gitweb: http://git.kernel.org/tip/a75a6068dac25d4022ebcd82192ed6345407843c Author: Oleg Nesterov <[email protected]> AuthorDate: Thu, 10 Sep 2015 15:07:50 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 12 Sep 2015 11:54:27 +0200
cpu/hotplug: Read_lock(tasklist_lock) doesn't need to disable irqs
check_for_tasks() doesn't need to disable irqs, recursive read_lock() from interrupt is fine.
While at it, s/do_each_thread/for_each_process_thread/.
--- kernel/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kernel/cpu.c +4 -4
@@ -304,8 +304,8 @@ static inline void check_for_tasks(int dead_cpu) {struct task_struct *g, *p; -read_lock_irq (&tasklist_lock); - do_each_thread(g, p) { +read_lock (&tasklist_lock); +for_each_process_thread (g, p) {if (!p->on_rq)continue ;/*
@@ -320,8 +320,8 @@ static inline void check_for_tasks(int dead_cpu)pr_warn ("Task %s (pid=%d) is on cpu %d (state=%ld, flags=%x)\n" , p->comm,task_pid_nr (p), dead_cpu, p->state, p->flags); - }while_each_thread (g, p); -read_unlock_irq (&tasklist_lock); + } +read_unlock (&tasklist_lock); }struct take_cpu_down_param {