diff options
author | Tejun Heo <tj@kernel.org> | 2013-04-01 14:23:35 -0400 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-04-01 14:23:35 -0400 |
commit | 2728fd2f098c3cc5efaf3f0433855e579d5e4f28 (patch) | |
tree | a5dd0281fa072f669690f5f5e1a77efe32a64ac2 /kernel/workqueue.c | |
parent | ecf6881ff349ad8670ec53a7586002d20b5f3b2e (diff) |
workqueue: move hot fields of workqueue_struct to the end
Move wq->flags and ->cpu_pwqs to the end of workqueue_struct and align
them to the cacheline. These two fields are used in the work item
issue path and thus hot. The scheduled NUMA affinity support will add
dispatch table at the end of workqueue_struct and relocating these two
fields will allow us hitting only single cacheline on hot paths.
Note that wq->pwqs isn't moved although it currently is being used in
the work item issue path for unbound workqueues. The dispatch table
mentioned above will replace its use in the issue path, so it will
become cold once NUMA support is implemented.
Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Diffstat (limited to 'kernel/workqueue.c')
-rw-r--r-- | kernel/workqueue.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index c8c5838c52c9..4c53fa216732 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -227,8 +227,6 @@ struct wq_device; | |||
227 | * the appropriate worker_pool through its pool_workqueues. | 227 | * the appropriate worker_pool through its pool_workqueues. |
228 | */ | 228 | */ |
229 | struct workqueue_struct { | 229 | struct workqueue_struct { |
230 | unsigned int flags; /* WQ: WQ_* flags */ | ||
231 | struct pool_workqueue __percpu *cpu_pwqs; /* I: per-cpu pwq's */ | ||
232 | struct list_head pwqs; /* WR: all pwqs of this wq */ | 230 | struct list_head pwqs; /* WR: all pwqs of this wq */ |
233 | struct list_head list; /* PL: list of all workqueues */ | 231 | struct list_head list; /* PL: list of all workqueues */ |
234 | 232 | ||
@@ -255,6 +253,10 @@ struct workqueue_struct { | |||
255 | struct lockdep_map lockdep_map; | 253 | struct lockdep_map lockdep_map; |
256 | #endif | 254 | #endif |
257 | char name[WQ_NAME_LEN]; /* I: workqueue name */ | 255 | char name[WQ_NAME_LEN]; /* I: workqueue name */ |
256 | |||
257 | /* hot fields used during command issue, aligned to cacheline */ | ||
258 | unsigned int flags ____cacheline_aligned; /* WQ: WQ_* flags */ | ||
259 | struct pool_workqueue __percpu *cpu_pwqs; /* I: per-cpu pwqs */ | ||
258 | }; | 260 | }; |
259 | 261 | ||
260 | static struct kmem_cache *pwq_cache; | 262 | static struct kmem_cache *pwq_cache; |