Skip to content

Commit

Permalink
padata: upgrade smp_mb__after_atomic to smp_mb in padata_do_serial
Browse files Browse the repository at this point in the history
A 5.7 kernel hangs during a tcrypt test of padata that waits for an AEAD
request to finish.  This is only seen on large machines running many
concurrent requests.

The issue is that padata never serializes the request.  The removal of
the reorder_objects atomic missed that the memory barrier in
padata_do_serial() depends on it.

Upgrade the barrier from smp_mb__after_atomic to smp_mb to get correct
ordering again.

Fixes: 3facced ("padata: remove reorder_objects")
Signed-off-by: Daniel Jordan <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: [email protected]
Cc: <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
danieljordan10 authored and herbertx committed Jun 18, 2020
1 parent 34c86f4 commit e04ec0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/padata.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static void padata_reorder(struct parallel_data *pd)
*
* Ensure reorder queue is read after pd->lock is dropped so we see
* new objects from another task in padata_do_serial. Pairs with
* smp_mb__after_atomic in padata_do_serial.
* smp_mb in padata_do_serial.
*/
smp_mb();

Expand Down Expand Up @@ -418,7 +418,7 @@ void padata_do_serial(struct padata_priv *padata)
* with the trylock of pd->lock in padata_reorder. Pairs with smp_mb
* in padata_reorder.
*/
smp_mb__after_atomic();
smp_mb();

padata_reorder(pd);
}
Expand Down

0 comments on commit e04ec0d

Please sign in to comment.