lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 9 Sep 2013 10:13:02 -0400
From:	Tejun Heo <tj@...nel.org>
To:	Libin <huawei.libin@...wei.com>
Cc:	linux-kernel@...r.kernel.org, wangyijing@...wei.com,
	guohanjun@...wei.com
Subject: Re: [PATCH] workqueue: remove meaningless BUILD_BUG_ON() in
 init_workqueues()

Hello, Libin.

On Mon, Sep 09, 2013 at 01:10:00PM +0800, Libin wrote:
> From: Li Bin <huawei.libin@...wei.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@...wei.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ