diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/workqueue.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 7e82480d9..20e43cfc1 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -527,14 +527,21 @@ extern void mttrace_workqueue_queue_work(unsigned int req_cpu, struct work_struc extern void mttrace_workqueue_execute_end(struct work_struct *work); #endif //CONFIG_MTK_WQ_DEBUG -/* allocate ID and assign it to @pool */ +/** + * worker_pool_assign_id - allocate ID and assing it to @pool + * @pool: the pool pointer of interest + * + * Returns 0 if ID in [0, WORK_OFFQ_POOL_NONE) is allocated and assigned + * successfully, -errno on failure. + */ static int worker_pool_assign_id(struct worker_pool *pool) { int ret; lockdep_assert_held(&wq_pool_mutex); - ret = idr_alloc(&worker_pool_idr, pool, 0, 0, GFP_KERNEL); + ret = idr_alloc(&worker_pool_idr, pool, 0, WORK_OFFQ_POOL_NONE, + GFP_KERNEL); if (ret >= 0) { pool->id = ret; return 0; @@ -5140,10 +5147,6 @@ static int __init init_workqueues(void) int std_nice[NR_STD_WORKER_POOLS] = { 0, HIGHPRI_NICE_LEVEL }; int i, cpu; - /* make sure we have enough bits for OFFQ pool ID */ - BUILD_BUG_ON((1LU << (BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT)) < - WORK_CPU_END * NR_STD_WORKER_POOLS); - WARN_ON(__alignof__(struct pool_workqueue) < __alignof__(long long)); pwq_cache = KMEM_CACHE(pool_workqueue, SLAB_PANIC); |
