lkml.org 
[lkml]   [2019]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 8/9] padata: unbind parallel jobs from specific CPUs
From
Date
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.

\
 
 \ /
  Last update: 2019-08-23 00:14    [W:0.057 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site