mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Jordan <daniel.m.jordan@oracle.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
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 18:13:15 -0400	[thread overview]
Message-ID: <dd31ec02-4a52-995d-801a-95bec39f4944@oracle.com> (raw)
In-Reply-To: <20190822041340.GA590@gondor.apana.org.au>

On 8/22/19 12:13 AM, Herbert Xu wrote:
> 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.

So we can, thanks for catching that.

  reply	other threads:[~2019-08-22 22:13 UTC|newest]

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
2019-08-22 22:13     ` Daniel Jordan [this message]
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 publicly 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=dd31ec02-4a52-995d-801a-95bec39f4944@oracle.com \
    --to=daniel.m.jordan@oracle.com \
    --cc=herbert@gondor.apana.org.au \
    --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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®