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: <20190822041340.GA590@gondor.apana.org.au>
Date:   Thu, 22 Aug 2019 14:13:40 +1000
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Daniel Jordan <daniel.m.jordan@...cle.com>
Cc:     Steffen Klassert <steffen.klassert@...unet.com>,
        Lai Jiangshan <jiangshanlai@...il.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Tejun Heo <tj@...nel.org>, linux-crypto@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 8/9] padata: unbind parallel jobs from specific CPUs

On Mon, Aug 12, 2019 at 08:52:23PM -0400, Daniel Jordan wrote:
>
> @@ -191,22 +184,25 @@ static struct padata_priv *padata_get_next(struct parallel_data *pd)
>  		padata = list_entry(reorder->list.next,
>  				    struct padata_priv, list);
>  
> -		list_del_init(&padata->list);
> -		atomic_dec(&pd->reorder_objects);
> +		/*
> +		 * The check fails in the unlikely event that two or more
> +		 * parallel jobs have hashed to the same CPU and one of the
> +		 * later ones finishes first.
> +		 */
> +		if (padata->seq_nr == pd->processed) {
> +			list_del_init(&padata->list);
> +			atomic_dec(&pd->reorder_objects);

Now that you've changed the test for whether there is work to be
done you also need to update the code at the end of padata_reorder
that checks whether there is work to do.  Otherwise we can end up
in a busy loop that just wastes CPU cycles.

Cheers,
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ