summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMathias Krause <minipli@googlemail.com>2017-09-08 20:57:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-05-27 16:40:23 +0200
commitf4fb6f1523d43cd2b56f99559ba4b86b83901a25 (patch)
tree300c3fed427804c0b6e9cfc75e866f9ec20ac2fe /include
parenta46bec632371dfdd5372842c13ce3842f72d6972 (diff)
padata: ensure the reorder timer callback runs on the correct CPU
commit cf5868c8a22dc2854b96e9569064bb92365549ca upstream. The reorder timer function runs on the CPU where the timer interrupt was handled which is not necessarily one of the CPUs of the 'pcpu' CPU mask set. Ensure the padata_reorder() callback runs on the correct CPU, which is one in the 'pcpu' CPU mask set and, preferrably, the next expected one. Do so by comparing the current CPU with the expected target CPU. If they match, call padata_reorder() right away. If they differ, schedule a work item on the target CPU that does the padata_reorder() call for us. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/padata.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 438694650471..963e69ff4659 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -85,6 +85,7 @@ struct padata_serial_queue {
* @swork: work struct for serialization.
* @pd: Backpointer to the internal control structure.
* @work: work struct for parallelization.
+ * @reorder_work: work struct for reordering.
* @num_obj: Number of objects that are processed by this cpu.
* @cpu_index: Index of the cpu.
*/
@@ -93,6 +94,7 @@ struct padata_parallel_queue {
struct padata_list reorder;
struct parallel_data *pd;
struct work_struct work;
+ struct work_struct reorder_work;
atomic_t num_obj;
int cpu_index;
};