aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/padata.h
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2010-07-07 09:32:39 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2010-07-14 08:29:30 -0400
commit5f1a8c1bc724498ff32acbd59ed5263275676b9d (patch)
tree0aa917ae98ebf20ec865930b75d0b16841b0b28f /include/linux/padata.h
parent83f619f3c8abb82cac9158cf23c656ec5c184607 (diff)
padata: simplify serialization mechanism
We count the number of processed objects on a percpu basis, so we need to go through all the percpu reorder queues to calculate the sequence number of the next object that needs serialization. This patch changes this to count the number of processed objects global. So we can calculate the sequence number and the percpu reorder queue of the next object that needs serialization without searching through the percpu reorder queues. This avoids some accesses to memory of foreign cpus. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/padata.h')
-rw-r--r--include/linux/padata.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h
index e4c17f9b7c9e..8844b851191e 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -67,7 +67,6 @@ struct padata_list {
67 * @pwork: work struct for parallelization. 67 * @pwork: work struct for parallelization.
68 * @swork: work struct for serialization. 68 * @swork: work struct for serialization.
69 * @pd: Backpointer to the internal control structure. 69 * @pd: Backpointer to the internal control structure.
70 * @num_obj: Number of objects that are processed by this cpu.
71 * @cpu_index: Index of the cpu. 70 * @cpu_index: Index of the cpu.
72 */ 71 */
73struct padata_queue { 72struct padata_queue {
@@ -77,7 +76,6 @@ struct padata_queue {
77 struct work_struct pwork; 76 struct work_struct pwork;
78 struct work_struct swork; 77 struct work_struct swork;
79 struct parallel_data *pd; 78 struct parallel_data *pd;
80 atomic_t num_obj;
81 int cpu_index; 79 int cpu_index;
82}; 80};
83 81
@@ -93,6 +91,7 @@ struct padata_queue {
93 * @max_seq_nr: Maximal used sequence number. 91 * @max_seq_nr: Maximal used sequence number.
94 * @cpumask: cpumask in use. 92 * @cpumask: cpumask in use.
95 * @lock: Reorder lock. 93 * @lock: Reorder lock.
94 * @processed: Number of already processed objects.
96 * @timer: Reorder timer. 95 * @timer: Reorder timer.
97 */ 96 */
98struct parallel_data { 97struct parallel_data {
@@ -103,7 +102,8 @@ struct parallel_data {
103 atomic_t refcnt; 102 atomic_t refcnt;
104 unsigned int max_seq_nr; 103 unsigned int max_seq_nr;
105 cpumask_var_t cpumask; 104 cpumask_var_t cpumask;
106 spinlock_t lock; 105 spinlock_t lock ____cacheline_aligned;
106 unsigned int processed;
107 struct timer_list timer; 107 struct timer_list timer;
108}; 108};
109 109