Commit c635696c authored by Steffen Klassert's avatar Steffen Klassert Committed by Herbert Xu

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: default avatarSteffen Klassert <steffen.klassert@secunet.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 65ff577e
...@@ -98,6 +98,16 @@ struct padata_parallel_queue { ...@@ -98,6 +98,16 @@ struct padata_parallel_queue {
int cpu_index; int cpu_index;
}; };
/**
* struct padata_cpumask - The cpumasks for the parallel/serial workers
*
* @pcpu: cpumask for the parallel workers.
* @cbcpu: cpumask for the serial (callback) workers.
*/
struct padata_cpumask {
cpumask_var_t pcpu;
cpumask_var_t cbcpu;
};
/** /**
* struct parallel_data - Internal control structure, covers everything * struct parallel_data - Internal control structure, covers everything
...@@ -110,8 +120,7 @@ struct padata_parallel_queue { ...@@ -110,8 +120,7 @@ struct padata_parallel_queue {
* @reorder_objects: Number of objects waiting in the reorder queues. * @reorder_objects: Number of objects waiting in the reorder queues.
* @refcnt: Number of objects holding a reference on this parallel_data. * @refcnt: Number of objects holding a reference on this parallel_data.
* @max_seq_nr: Maximal used sequence number. * @max_seq_nr: Maximal used sequence number.
* @cpumask: Contains two cpumasks: pcpu and cbcpu for * @cpumask: The cpumasks in use for parallel and serial workers.
* parallel and serial workers respectively.
* @lock: Reorder lock. * @lock: Reorder lock.
* @processed: Number of already processed objects. * @processed: Number of already processed objects.
* @timer: Reorder timer. * @timer: Reorder timer.
...@@ -120,17 +129,14 @@ struct parallel_data { ...@@ -120,17 +129,14 @@ struct parallel_data {
struct padata_instance *pinst; struct padata_instance *pinst;
struct padata_parallel_queue *pqueue; struct padata_parallel_queue *pqueue;
struct padata_serial_queue *squeue; struct padata_serial_queue *squeue;
atomic_t seq_nr; atomic_t seq_nr;
atomic_t reorder_objects; atomic_t reorder_objects;
atomic_t refcnt; atomic_t refcnt;
unsigned int max_seq_nr; unsigned int max_seq_nr;
struct { struct padata_cpumask cpumask;
cpumask_var_t pcpu; spinlock_t lock ____cacheline_aligned;
cpumask_var_t cbcpu; unsigned int processed;
} cpumask; struct timer_list timer;
spinlock_t lock ____cacheline_aligned;
unsigned int processed;
struct timer_list timer;
}; };
/** /**
...@@ -139,8 +145,7 @@ struct parallel_data { ...@@ -139,8 +145,7 @@ struct parallel_data {
* @cpu_notifier: cpu hotplug notifier. * @cpu_notifier: cpu hotplug notifier.
* @wq: The workqueue in use. * @wq: The workqueue in use.
* @pd: The internal control structure. * @pd: The internal control structure.
* @cpumask: User supplied cpumask. Contains two cpumasks: pcpu and * @cpumask: User supplied cpumasks for parallel and serial works.
* cbcpu for parallel and serial works respectivly.
* @cpumask_change_notifier: Notifiers chain for user-defined notify * @cpumask_change_notifier: Notifiers chain for user-defined notify
* callbacks that will be called when either @pcpu or @cbcpu * callbacks that will be called when either @pcpu or @cbcpu
* or both cpumasks change. * or both cpumasks change.
...@@ -152,10 +157,7 @@ struct padata_instance { ...@@ -152,10 +157,7 @@ struct padata_instance {
struct notifier_block cpu_notifier; struct notifier_block cpu_notifier;
struct workqueue_struct *wq; struct workqueue_struct *wq;
struct parallel_data *pd; struct parallel_data *pd;
struct { struct padata_cpumask cpumask;
cpumask_var_t pcpu;
cpumask_var_t cbcpu;
} cpumask;
struct blocking_notifier_head cpumask_change_notifier; struct blocking_notifier_head cpumask_change_notifier;
struct kobject kobj; struct kobject kobj;
struct mutex lock; struct mutex lock;
......
...@@ -538,7 +538,8 @@ static void padata_replace(struct padata_instance *pinst, ...@@ -538,7 +538,8 @@ static void padata_replace(struct padata_instance *pinst,
if (notification_mask) if (notification_mask)
blocking_notifier_call_chain(&pinst->cpumask_change_notifier, blocking_notifier_call_chain(&pinst->cpumask_change_notifier,
notification_mask, pinst); notification_mask,
&pd_new->cpumask);
pinst->flags &= ~PADATA_RESET; pinst->flags &= ~PADATA_RESET;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment