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:	Wed, 6 Feb 2013 10:47:49 -0800
From:	Tejun Heo <tj@...nel.org>
To:	Hillf Danton <dhillf@...il.com>
Cc:	Rusty Russell <rusty@...tcorp.com.au>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ingo Molnar <mingo@...e.hu>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/3] stop_machine: dequeue work before signal completion

On Wed, Feb 06, 2013 at 08:38:43PM +0800, Hillf Danton wrote:
> As handled by the kernel thread, work is dequeued first for further actions.

Ditto as the previous patch.

> Signed-off-by: Hillf Danton <dhillf@...il.com>
> ---
> 
> --- a/kernel/stop_machine.c	Wed Feb  6 19:57:12 2013
> +++ b/kernel/stop_machine.c	Wed Feb  6 20:02:12 2013
> @@ -334,23 +334,24 @@ static int __cpuinit cpu_stop_cpu_callba
>  #ifdef CONFIG_HOTPLUG_CPU
>  	case CPU_UP_CANCELED:
>  	case CPU_POST_DEAD:
> -	{
> -		struct cpu_stop_work *work;
> -
>  		sched_set_stop_task(cpu, NULL);
>  		/* kill the stopper */
>  		kthread_stop(stopper->thread);
>  		/* drain remaining works */
>  		spin_lock_irq(&stopper->lock);
> -		list_for_each_entry(work, &stopper->works, list)
> +		while (!list_empty(&stopper->works)) {
> +			struct cpu_stop_work *work;
> +			work = list_first_entry(&stopper->works,
> +					struct cpu_stop_work, list);
> +			list_del_init(&work->list);
>  			cpu_stop_signal_done(work->done, false, 0);
> +		}
>  		stopper->enabled = false;
>  		spin_unlock_irq(&stopper->lock);

Why does this matter?  It's inside spinlock.  What's being made better
by this change?

-- 
tejun
--
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