summaryrefslogtreecommitdiff
path: root/kernel/padata.c
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2019-09-02 21:56:43 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-09-02 21:56:43 -0700
commit4910099d3ab28deb4f7c2fd88ef5eef5362e26df (patch)
tree4de7fc2634214ae72d7453183884b6b8b6e654be /kernel/padata.c
parent2a61e30d4462de293371173af5c153e0ea195f0e (diff)
parent7b0c4ab61ef1dc4eaa00ee0d9b4c50ca0193ad75 (diff)
Merge "Merge android-4.4.188 (886d085) into msm-4.4"
Diffstat (limited to 'kernel/padata.c')
-rw-r--r--kernel/padata.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/padata.c b/kernel/padata.c
index ecc7b3f452c7..282b489a286d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -273,7 +273,12 @@ static void padata_reorder(struct parallel_data *pd)
* The next object that needs serialization might have arrived to
* the reorder queues in the meantime, we will be called again
* from the timer function if no one else cares for it.
+ *
+ * Ensure reorder_objects is read after pd->lock is dropped so we see
+ * an increment from another task in padata_do_serial. Pairs with
+ * smp_mb__after_atomic in padata_do_serial.
*/
+ smp_mb();
if (atomic_read(&pd->reorder_objects)
&& !(pinst->flags & PADATA_RESET))
mod_timer(&pd->timer, jiffies + HZ);
@@ -342,6 +347,13 @@ void padata_do_serial(struct padata_priv *padata)
list_add_tail(&padata->list, &pqueue->reorder.list);
spin_unlock(&pqueue->reorder.lock);
+ /*
+ * Ensure the atomic_inc of reorder_objects above is ordered correctly
+ * with the trylock of pd->lock in padata_reorder. Pairs with smp_mb
+ * in padata_reorder.
+ */
+ smp_mb__after_atomic();
+
put_cpu();
padata_reorder(pd);