Linux-Crypto Archive on lore.kernel.org
 help / color / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>,
	Lai Jiangshan <jiangshanlai@gmail.com>,
	Peter Zijlstra <peterz@infradead.org>, Tejun Heo <tj@kernel.org>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 8/9] padata: unbind parallel jobs from specific CPUs
Date: Thu, 22 Aug 2019 14:13:40 +1000
Message-ID: <20190822041340.GA590@gondor.apana.org.au> (raw)
In-Reply-To: <20190813005224.30779-9-daniel.m.jordan@oracle.com>

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@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13  0:52 [PATCH 0/9] padata: use unbound workqueues for parallel jobs Daniel Jordan
2019-08-13  0:52 ` [PATCH 1/9] padata: allocate workqueue internally Daniel Jordan
2019-08-13  0:52 ` [PATCH 2/9] workqueue: unconfine alloc/apply/free_workqueue_attrs() Daniel Jordan
2019-08-13  0:52 ` [PATCH 3/9] workqueue: require CPU hotplug read exclusion for apply_workqueue_attrs Daniel Jordan
2019-08-13  0:52 ` [PATCH 4/9] padata: make padata_do_parallel find alternate callback CPU Daniel Jordan
2019-08-13  0:52 ` [PATCH 5/9] pcrypt: remove padata cpumask notifier Daniel Jordan
2019-08-13  0:52 ` [PATCH 6/9] padata, pcrypt: take CPU hotplug lock internally in padata_alloc_possible Daniel Jordan
2019-08-13  0:52 ` [PATCH 7/9] padata: use separate workqueues for parallel and serial work Daniel Jordan
2019-08-13  0:52 ` [PATCH 8/9] padata: unbind parallel jobs from specific CPUs Daniel Jordan
2019-08-22  4:13   ` Herbert Xu [this message]
2019-08-22 22:13     ` Daniel Jordan
2019-08-13  0:52 ` [PATCH 9/9] padata: remove cpu_index from the parallel_queue Daniel Jordan
2019-08-20  6:07 ` [PATCH 0/9] padata: use unbound workqueues for parallel jobs Steffen Klassert
2019-08-21  4:15   ` Daniel Jordan

Reply instructions:

You may reply publically 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=20190822041340.GA590@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=daniel.m.jordan@oracle.com \
    --cc=jiangshanlai@gmail.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=steffen.klassert@secunet.com \
    --cc=tj@kernel.org \
    /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

Linux-Crypto Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-crypto/0 linux-crypto/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-crypto linux-crypto/ https://lore.kernel.org/linux-crypto \
		linux-crypto@vger.kernel.org linux-crypto@archiver.kernel.org
	public-inbox-index linux-crypto

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-crypto


AGPL code for this site: git clone https://public-inbox.org/ public-inbox