lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 10 Sep 2015 16:31:15 +0300
From:	Kirill Tkhai <ktkhai@...n.com>
To:	Oleg Nesterov <oleg@...hat.com>
CC:	Ingo Molnar <mingo@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Kirill Tkhai <ktkhai@...allels.com>,
	Srikar Dronamraju <srikar@...ux.vnet.ibm.com>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] check_for_tasks: read_lock(tasklist_lock) doesn't need
 to disable irqs



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@...hat.com>

Reviewed-by: Kirill Tkhai <ktkhai@...n.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 {
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ