padata: ensure padata_do_serial() runs on the correct CPU
authorMathias Krause <minipli@googlemail.com>
Fri, 8 Sep 2017 18:57:11 +0000 (20:57 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 7 Oct 2017 04:10:32 +0000 (12:10 +0800)
commit350ef88e7e922354f82a931897ad4a4ce6c686ff
tree1a4e182954c15959d059660ba124117c172fe5a3
parentcf5868c8a22dc2854b96e9569064bb92365549ca
padata: ensure padata_do_serial() runs on the correct CPU

If the algorithm we're parallelizing is asynchronous we might change
CPUs between padata_do_parallel() and padata_do_serial(). However, we
don't expect this to happen as we need to enqueue the padata object into
the per-cpu reorder queue we took it from, i.e. the same-cpu's parallel
queue.

Ensure we're not switching CPUs for a given padata object by tracking
the CPU within the padata object. If the serial callback gets called on
the wrong CPU, defer invoking padata_reorder() via a kernel worker on
the CPU we're expected to run on.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
include/linux/padata.h
kernel/padata.c