diff options
author | Steffen Klassert <steffen.klassert@secunet.com> | 2010-05-18 23:44:27 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2010-05-18 23:44:27 -0400 |
commit | 0198ffd135f51d4fbb0c50036395716c06632ed9 (patch) | |
tree | 70ee8c360df43a2077eac0e033ab54a65394a29f /include/linux/padata.h | |
parent | 2b73b07ab8a44ce171e07a328439f311481a7ea7 (diff) |
padata: Add some code comments
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.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h index 64836a63bd17..8d8406246eef 100644 --- a/include/linux/padata.h +++ b/include/linux/padata.h | |||
@@ -26,6 +26,17 @@ | |||
26 | #include <linux/list.h> | 26 | #include <linux/list.h> |
27 | #include <linux/timer.h> | 27 | #include <linux/timer.h> |
28 | 28 | ||
29 | /** | ||
30 | * struct padata_priv - Embedded to the users data structure. | ||
31 | * | ||
32 | * @list: List entry, to attach to the padata lists. | ||
33 | * @pd: Pointer to the internal control structure. | ||
34 | * @cb_cpu: Callback cpu for serializatioon. | ||
35 | * @seq_nr: Sequence number of the parallelized data object. | ||
36 | * @info: Used to pass information from the parallel to the serial function. | ||
37 | * @parallel: Parallel execution function. | ||
38 | * @serial: Serial complete function. | ||
39 | */ | ||
29 | struct padata_priv { | 40 | struct padata_priv { |
30 | struct list_head list; | 41 | struct list_head list; |
31 | struct parallel_data *pd; | 42 | struct parallel_data *pd; |
@@ -36,11 +47,29 @@ struct padata_priv { | |||
36 | void (*serial)(struct padata_priv *padata); | 47 | void (*serial)(struct padata_priv *padata); |
37 | }; | 48 | }; |
38 | 49 | ||
50 | /** | ||
51 | * struct padata_list | ||
52 | * | ||
53 | * @list: List head. | ||
54 | * @lock: List lock. | ||
55 | */ | ||
39 | struct padata_list { | 56 | struct padata_list { |
40 | struct list_head list; | 57 | struct list_head list; |
41 | spinlock_t lock; | 58 | spinlock_t lock; |
42 | }; | 59 | }; |
43 | 60 | ||
61 | /** | ||
62 | * struct padata_queue - The percpu padata queues. | ||
63 | * | ||
64 | * @parallel: List to wait for parallelization. | ||
65 | * @reorder: List to wait for reordering after parallel processing. | ||
66 | * @serial: List to wait for serialization after reordering. | ||
67 | * @pwork: work struct for parallelization. | ||
68 | * @swork: work struct for serialization. | ||
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. | ||
72 | */ | ||
44 | struct padata_queue { | 73 | struct padata_queue { |
45 | struct padata_list parallel; | 74 | struct padata_list parallel; |
46 | struct padata_list reorder; | 75 | struct padata_list reorder; |
@@ -52,6 +81,20 @@ struct padata_queue { | |||
52 | int cpu_index; | 81 | int cpu_index; |
53 | }; | 82 | }; |
54 | 83 | ||
84 | /** | ||
85 | * struct parallel_data - Internal control structure, covers everything | ||
86 | * that depends on the cpumask in use. | ||
87 | * | ||
88 | * @pinst: padata instance. | ||
89 | * @queue: percpu padata queues. | ||
90 | * @seq_nr: The sequence number that will be attached to the next object. | ||
91 | * @reorder_objects: Number of objects waiting in the reorder queues. | ||
92 | * @refcnt: Number of objects holding a reference on this parallel_data. | ||
93 | * @max_seq_nr: Maximal used sequence number. | ||
94 | * @cpumask: cpumask in use. | ||
95 | * @lock: Reorder lock. | ||
96 | * @timer: Reorder timer. | ||
97 | */ | ||
55 | struct parallel_data { | 98 | struct parallel_data { |
56 | struct padata_instance *pinst; | 99 | struct padata_instance *pinst; |
57 | struct padata_queue *queue; | 100 | struct padata_queue *queue; |
@@ -64,6 +107,16 @@ struct parallel_data { | |||
64 | struct timer_list timer; | 107 | struct timer_list timer; |
65 | }; | 108 | }; |
66 | 109 | ||
110 | /** | ||
111 | * struct padata_instance - The overall control structure. | ||
112 | * | ||
113 | * @cpu_notifier: cpu hotplug notifier. | ||
114 | * @wq: The workqueue in use. | ||
115 | * @pd: The internal control structure. | ||
116 | * @cpumask: User supplied cpumask. | ||
117 | * @lock: padata instance lock. | ||
118 | * @flags: padata flags. | ||
119 | */ | ||
67 | struct padata_instance { | 120 | struct padata_instance { |
68 | struct notifier_block cpu_notifier; | 121 | struct notifier_block cpu_notifier; |
69 | struct workqueue_struct *wq; | 122 | struct workqueue_struct *wq; |