* [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues()
@ 2013-09-09 5:10 Libin
2013-09-09 14:13 ` Tejun Heo
0 siblings, 1 reply; 4+ messages in thread
From: Libin @ 2013-09-09 5:10 UTC (permalink / raw)
To: tj; +Cc: linux-kernel, wangyijing, guohanjun
From: Li Bin <huawei.libin@huawei.com>
In the current implementation, this BUILD_BUG_ON makes no sense.
First of all, the number of worker pools needed cannot be determined
at compile time, because the number of backing pools for UNBOUND
workqueues is dynamic based on the assigned custom attributes.
Secondly, it should use WORK_OFFQ_POOL_BITS instead of
(BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT).
Signed-off-by: Li Bin <huawei.libin@huawei.com>
---
kernel/workqueue.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 987293d..41019b1 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -5009,10 +5009,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);
--
1.8.2.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues()
2013-09-09 5:10 [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues() Libin
@ 2013-09-09 14:13 ` Tejun Heo
2013-09-09 14:18 ` Tejun Heo
0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2013-09-09 14:13 UTC (permalink / raw)
To: Libin; +Cc: linux-kernel, wangyijing, guohanjun
Hello, Libin.
On Mon, Sep 09, 2013 at 01:10:00PM +0800, Libin wrote:
> From: Li Bin <huawei.libin@huawei.com>
>
> In the current implementation, this BUILD_BUG_ON makes no sense.
> First of all, the number of worker pools needed cannot be determined
> at compile time, because the number of backing pools for UNBOUND
> workqueues is dynamic based on the assigned custom attributes.
> Secondly, it should use WORK_OFFQ_POOL_BITS instead of
> (BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT).
>
> Signed-off-by: Li Bin <huawei.libin@huawei.com>
> ---
> kernel/workqueue.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/kernel/workqueue.c b/kernel/workqueue.c
> index 987293d..41019b1 100644
> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -5009,10 +5009,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);
> -
Indeed, but can you please update worker_pool_assign_id() so that it
doesn't allocate ids >= WORK_OFFQ_POOL_NONE?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues()
2013-09-09 14:13 ` Tejun Heo
@ 2013-09-09 14:18 ` Tejun Heo
2013-09-10 0:26 ` Libin
0 siblings, 1 reply; 4+ messages in thread
From: Tejun Heo @ 2013-09-09 14:18 UTC (permalink / raw)
To: Libin; +Cc: linux-kernel, wangyijing, guohanjun
On Mon, Sep 09, 2013 at 10:13:02AM -0400, Tejun Heo wrote:
> Indeed, but can you please update worker_pool_assign_id() so that it
> doesn't allocate ids >= WORK_OFFQ_POOL_NONE?
So, you did this separately on the next patch. Can you please roll
that patch into this one with the suggested update?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues()
2013-09-09 14:18 ` Tejun Heo
@ 2013-09-10 0:26 ` Libin
0 siblings, 0 replies; 4+ messages in thread
From: Libin @ 2013-09-10 0:26 UTC (permalink / raw)
To: Tejun Heo; +Cc: linux-kernel, wangyijing, guohanjun
On 2013/9/9 22:18, Tejun Heo wrote:
> On Mon, Sep 09, 2013 at 10:13:02AM -0400, Tejun Heo wrote:
>> Indeed, but can you please update worker_pool_assign_id() so that it
>> doesn't allocate ids >= WORK_OFFQ_POOL_NONE?
>
> So, you did this separately on the next patch. Can you please roll
> that patch into this one with the suggested update?
Hello Tejun,
I will update it according to your suggestion.
Thanks!
Libin
>
> Thanks.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-09-10 0:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-09 5:10 [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues() Libin
2013-09-09 14:13 ` Tejun Heo
2013-09-09 14:18 ` Tejun Heo
2013-09-10 0:26 ` Libin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox