mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Libin <huawei.libin@huawei.com>
Cc: linux-kernel@vger.kernel.org, wangyijing@huawei.com,
	guohanjun@huawei.com
Subject: Re: [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in init_workqueues()
Date: Mon, 9 Sep 2013 10:13:02 -0400	[thread overview]
Message-ID: <20130909141302.GC25434@htj.dyndns.org> (raw)
In-Reply-To: <1378703400-4536-1-git-send-email-huawei.libin@huawei.com>

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

  reply	other threads:[~2013-09-09 14:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-09  5:10 Libin
2013-09-09 14:13 ` Tejun Heo [this message]
2013-09-09 14:18   ` Tejun Heo
2013-09-10  0:26     ` Libin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130909141302.GC25434@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=guohanjun@huawei.com \
    --cc=huawei.libin@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wangyijing@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome