Skip to content

Commit

Permalink
workqueue: use enum value to set array size of pools in gcwq
Browse files Browse the repository at this point in the history
Commit 3270476 ('workqueue: reimplement
WQ_HIGHPRI using a separate worker_pool') introduce separate worker_pool
for HIGHPRI. Although there is NR_WORKER_POOLS enum value which represent
size of pools, definition of worker_pool in gcwq doesn't use it.
Using it makes code robust and prevent future mistakes.
So change code to use this enum value.

Signed-off-by: Joonsoo Kim <js1304@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
  • Loading branch information
Joonsoo Kim authored and Tejun Heo committed Aug 16, 2012
1 parent 23657bb commit 330dad5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/workqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,8 @@ struct global_cwq {
struct hlist_head busy_hash[BUSY_WORKER_HASH_SIZE];
/* L: hash of busy workers */

struct worker_pool pools[2]; /* normal and highpri pools */
struct worker_pool pools[NR_WORKER_POOLS];
/* normal and highpri pools */

wait_queue_head_t rebind_hold; /* rebind hold wait */
} ____cacheline_aligned_in_smp;
Expand Down

0 comments on commit 330dad5

Please sign in to comment.