Commit e04ec0de authored by Daniel Jordan's avatar Daniel Jordan Committed by Herbert Xu

padata: upgrade smp_mb__after_atomic to smp_mb in padata_do_serial

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: 3facced7 ("padata: remove reorder_objects")
Signed-off-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
Cc: Steffen Klassert <steffen.klassert@secunet.com>
Cc: linux-kernel@vger.kernel.org
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 34c86f4c
...@@ -335,7 +335,7 @@ static void padata_reorder(struct parallel_data *pd) ...@@ -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 * Ensure reorder queue is read after pd->lock is dropped so we see
* new objects from another task in padata_do_serial. Pairs with * 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(); smp_mb();
...@@ -418,7 +418,7 @@ void padata_do_serial(struct padata_priv *padata) ...@@ -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 * with the trylock of pd->lock in padata_reorder. Pairs with smp_mb
* in padata_reorder. * in padata_reorder.
*/ */
smp_mb__after_atomic(); smp_mb();
padata_reorder(pd); padata_reorder(pd);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment