From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753548AbbIMK6z (ORCPT ); Sun, 13 Sep 2015 06:58:55 -0400 Received: from terminus.zytor.com ([198.137.202.10]:43294 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752331AbbIMK6x (ORCPT ); Sun, 13 Sep 2015 06:58:53 -0400 Date: Sun, 13 Sep 2015 03:56:47 -0700 From: tip-bot for Oleg Nesterov Message-ID: Cc: peterz@infradead.org, ktkhai@parallels.com, srikar@linux.vnet.ibm.com, ktkhai@odin.com, tglx@linutronix.de, mingo@kernel.org, oleg@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org Reply-To: hpa@zytor.com, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, oleg@redhat.com, mingo@kernel.org, tglx@linutronix.de, ktkhai@odin.com, srikar@linux.vnet.ibm.com, ktkhai@parallels.com, peterz@infradead.org In-Reply-To: <20150910130750.GA20055@redhat.com> References: <20150910130750.GA20055@redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn' t need to disable irqs Git-Commit-ID: a75a6068dac25d4022ebcd82192ed6345407843c X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a75a6068dac25d4022ebcd82192ed6345407843c Gitweb: http://git.kernel.org/tip/a75a6068dac25d4022ebcd82192ed6345407843c Author: Oleg Nesterov AuthorDate: Thu, 10 Sep 2015 15:07:50 +0200 Committer: Ingo Molnar 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/. Signed-off-by: Oleg Nesterov Reviewed-by: Kirill Tkhai Reviewed-by: Srikar Dronamraju Cc: Kirill Tkhai Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20150910130750.GA20055@redhat.com Signed-off-by: Ingo Molnar --- kernel/cpu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 82cf9df..050c634 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -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 {