aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Klassert <steffen.klassert@secunet.com>2010-07-27 01:15:50 -0400
committerHerbert Xu <herbert@gondor.apana.org.au>2010-07-31 07:53:05 -0400
commitc635696c7c0fbc720698dbec34bb83e53df6a967 (patch)
tree98774f70f799ed51c990af79bda8bbd0264e6a39
parent65ff577e6b6e482ee9de3569e058edebdc02f069 (diff)
padata: Pass the padata cpumasks to the cpumask_change_notifier chain
We pass a pointer to the new padata cpumasks to the cpumask_change_notifier chain. So users can access the cpumasks without the need of an extra padata_get_cpumask function. Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--include/linux/padata.h40
-rw-r--r--kernel/padata.c3
2 files changed, 23 insertions, 20 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h
index bb0fc5dd0bbb..43db792f44dd 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -98,6 +98,16 @@ struct padata_parallel_queue {
98 int cpu_index; 98 int cpu_index;
99}; 99};
100 100
101/**
102 * struct padata_cpumask - The cpumasks for the parallel/serial workers
103 *
104 * @pcpu: cpumask for the parallel workers.
105 * @cbcpu: cpumask for the serial (callback) workers.
106 */
107struct padata_cpumask {
108 cpumask_var_t pcpu;
109 cpumask_var_t cbcpu;
110};
101 111
102/** 112/**
103 * struct parallel_data - Internal control structure, covers everything 113 * struct parallel_data - Internal control structure, covers everything
@@ -110,8 +120,7 @@ struct padata_parallel_queue {
110 * @reorder_objects: Number of objects waiting in the reorder queues. 120 * @reorder_objects: Number of objects waiting in the reorder queues.
111 * @refcnt: Number of objects holding a reference on this parallel_data. 121 * @refcnt: Number of objects holding a reference on this parallel_data.
112 * @max_seq_nr: Maximal used sequence number. 122 * @max_seq_nr: Maximal used sequence number.
113 * @cpumask: Contains two cpumasks: pcpu and cbcpu for 123 * @cpumask: The cpumasks in use for parallel and serial workers.
114 * parallel and serial workers respectively.
115 * @lock: Reorder lock. 124 * @lock: Reorder lock.
116 * @processed: Number of already processed objects. 125 * @processed: Number of already processed objects.
117 * @timer: Reorder timer. 126 * @timer: Reorder timer.
@@ -120,17 +129,14 @@ struct parallel_data {
120 struct padata_instance *pinst; 129 struct padata_instance *pinst;
121 struct padata_parallel_queue *pqueue; 130 struct padata_parallel_queue *pqueue;
122 struct padata_serial_queue *squeue; 131 struct padata_serial_queue *squeue;
123 atomic_t seq_nr; 132 atomic_t seq_nr;
124 atomic_t reorder_objects; 133 atomic_t reorder_objects;
125 atomic_t refcnt; 134 atomic_t refcnt;
126 unsigned int max_seq_nr; 135 unsigned int max_seq_nr;
127 struct { 136 struct padata_cpumask cpumask;
128 cpumask_var_t pcpu; 137 spinlock_t lock ____cacheline_aligned;
129 cpumask_var_t cbcpu; 138 unsigned int processed;
130 } cpumask; 139 struct timer_list timer;
131 spinlock_t lock ____cacheline_aligned;
132 unsigned int processed;
133 struct timer_list timer;
134}; 140};
135 141
136/** 142/**
@@ -139,8 +145,7 @@ struct parallel_data {
139 * @cpu_notifier: cpu hotplug notifier. 145 * @cpu_notifier: cpu hotplug notifier.
140 * @wq: The workqueue in use. 146 * @wq: The workqueue in use.
141 * @pd: The internal control structure. 147 * @pd: The internal control structure.
142 * @cpumask: User supplied cpumask. Contains two cpumasks: pcpu and 148 * @cpumask: User supplied cpumasks for parallel and serial works.
143 * cbcpu for parallel and serial works respectivly.
144 * @cpumask_change_notifier: Notifiers chain for user-defined notify 149 * @cpumask_change_notifier: Notifiers chain for user-defined notify
145 * callbacks that will be called when either @pcpu or @cbcpu 150 * callbacks that will be called when either @pcpu or @cbcpu
146 * or both cpumasks change. 151 * or both cpumasks change.
@@ -152,10 +157,7 @@ struct padata_instance {
152 struct notifier_block cpu_notifier; 157 struct notifier_block cpu_notifier;
153 struct workqueue_struct *wq; 158 struct workqueue_struct *wq;
154 struct parallel_data *pd; 159 struct parallel_data *pd;
155 struct { 160 struct padata_cpumask cpumask;
156 cpumask_var_t pcpu;
157 cpumask_var_t cbcpu;
158 } cpumask;
159 struct blocking_notifier_head cpumask_change_notifier; 161 struct blocking_notifier_head cpumask_change_notifier;
160 struct kobject kobj; 162 struct kobject kobj;
161 struct mutex lock; 163 struct mutex lock;
diff --git a/kernel/padata.c b/kernel/padata.c
index 4987203770bc..1c8c1d1d301d 100644
--- a/kernel/padata.c
+++ b/kernel/padata.c
@@ -538,7 +538,8 @@ static void padata_replace(struct padata_instance *pinst,
538 538
539 if (notification_mask) 539 if (notification_mask)
540 blocking_notifier_call_chain(&pinst->cpumask_change_notifier, 540 blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
541 notification_mask, pinst); 541 notification_mask,
542 &pd_new->cpumask);
542 543
543 pinst->flags &= ~PADATA_RESET; 544 pinst->flags &= ~PADATA_RESET;
544} 545}