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]
Message-ID: <20180627071527.hvrndkz436yeqwpq@linutronix.de>
Date:   Wed, 27 Jun 2018 09:15:28 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     "Isaac J. Manjarres" <isaacm@...eaurora.org>
Cc:     peterz@...radead.org, matt@...eblueprint.co.uk, mingo@...nel.org,
        tglx@...utronix.de, gregkh@...uxfoundation.org,
        linux-kernel@...r.kernel.org, psodagud@...eaurora.org
Subject: Re: [PATCH] stop_machine: Remove cpu swap from stop_two_cpus

On 2018-06-26 14:28:26 [-0700], Isaac J. Manjarres wrote:
> Remove CPU ID swapping in stop_two_cpus() so that the
> source CPU's stopper thread is added to the wake queue last,
> so that the source CPU's stopper thread is woken up last,
> ensuring that all other threads that it depends on are woken
> up before it runs.

You can't do that because you could deadlock while locking the stoper
lock.
Couldn't you swap cpu1+cpu2 and work1+work2?

> diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
> index f89014a..d10d633 100644
> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -307,8 +307,6 @@ int stop_two_cpus(unsigned int cpu1, unsigned int cpu2, cpu_stop_fn_t fn, void *
>  	cpu_stop_init_done(&done, 2);
>  	set_state(&msdata, MULTI_STOP_PREPARE);
>  
> -	if (cpu1 > cpu2)
> -		swap(cpu1, cpu2);
>  	if (cpu_stop_queue_two_works(cpu1, &work1, cpu2, &work2))
>  		return -ENOENT;
>  

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ