From: Kirill Tkhai <ktkhai@odin.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Kirill Tkhai <ktkhai@parallels.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs
Date: Thu, 10 Sep 2015 16:31:15 +0300 [thread overview]
Message-ID: <55F18623.4080402@odin.com> (raw)
In-Reply-To: <20150910130750.GA20055@redhat.com>
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 <oleg@redhat.com>
Reviewed-by: Kirill Tkhai <ktkhai@odin.com>
> ---
> 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 {
>
next prev parent reply other threads:[~2015-09-10 13:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-10 13:07 [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need to disable irqs Oleg Nesterov
2015-09-10 13:31 ` Kirill Tkhai [this message]
2015-09-11 10:24 ` Srikar Dronamraju
2015-09-13 10:56 ` [tip:sched/core] cpu/hotplug: Read_lock(tasklist_lock) doesn' t " tip-bot for Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55F18623.4080402@odin.com \
--to=ktkhai@odin.com \
--cc=ktkhai@parallels.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=srikar@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox