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:	Wed, 20 Mar 2013 11:16:15 -0700
From:	Tejun Heo <tj@...nel.org>
To:	Lai Jiangshan <laijs@...fujitsu.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 17/21] workqueue: simplify
 workqueue_cpu_up_callback(CPU_ONLINE)

On Wed, Mar 20, 2013 at 03:28:17AM +0800, Lai Jiangshan wrote:
> If we have 4096 CPUs, workqueue_cpu_up_callback() will travel too much CPUs,
> to avoid it, we use for_each_cpu_worker_pool for the cpu pools and
> use unbound_pool_hash for unbound pools.
> 
> After it, for_each_pool() becomes unused, so we remove it.
>  	case CPU_DOWN_FAILED:
>  	case CPU_ONLINE:
> -		mutex_lock(&pools_mutex);
> -
> -		for_each_pool(pool, pi) {
> -			mutex_lock(&pool->manager_mutex);
> -
> -			if (pool->cpu == cpu) {
> -				associate_cpu_pool(pool);
> -			} else if (pool->cpu < 0) {
> -				restore_unbound_workers_cpumask(pool, cpu);
> -			}
> -
> -			mutex_unlock(&pool->manager_mutex);
> -		}
> +		for_each_cpu_worker_pool(pool, cpu)
> +			associate_cpu_pool(pool);
>  
> +		mutex_lock(&pools_mutex);
> +		hash_for_each(unbound_pool_hash, bkt, pool, hash_node)
> +			restore_unbound_workers_cpumask(pool, cpu);
>  		mutex_unlock(&pools_mutex);
>  		break;

Hmmm... can you add for_each_unbound_pool() with proper lockdep
assertion?  Also, don't shuffle locking and flag setting around.  It
doesn't make any functional difference and I kinda like global stuff
in the hotplug callback and actual worker handling in the helper
functions.

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