From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754493AbbIJNbk (ORCPT ); Thu, 10 Sep 2015 09:31:40 -0400 Received: from mx2.parallels.com ([199.115.105.18]:43744 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752558AbbIJNbi (ORCPT ); Thu, 10 Sep 2015 09:31:38 -0400 Message-ID: <55F18623.4080402@odin.com> Date: Thu, 10 Sep 2015 16:31:15 +0300 From: Kirill Tkhai User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 MIME-Version: 1.0 To: Oleg Nesterov CC: Ingo Molnar , Peter Zijlstra , Kirill Tkhai , Srikar Dronamraju , Subject: Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs References: <20150910130750.GA20055@redhat.com> In-Reply-To: <20150910130750.GA20055@redhat.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: US-EXCH.sw.swsoft.com (10.255.249.47) To US-EXCH.sw.swsoft.com (10.255.249.47) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10.09.2015 16:07, Oleg Nesterov wrote: > 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 > --- > kernel/cpu.c | 8 ++++---- > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 94bbe46..24551f2 100644 > --- a/kernel/cpu.c > +++ b/kernel/cpu.c > @@ -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 { >