lkml.org 
[lkml]   [2013]   [Mar]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 16/31] workqueue: introduce workqueue_attrs
On 05/03/13 05:37, Tejun Heo wrote:
> Introduce struct workqueue_attrs which carries worker attributes -
> currently the nice level and allowed cpumask along with helper
> routines alloc_workqueue_attrs() and free_workqueue_attrs().
>
> Each worker_pool now carries ->attrs describing the attributes of its
> workers. All functions dealing with cpumask and nice level of workers
> are updated to follow worker_pool->attrs instead of determining them
> from other characteristics of the worker_pool, and init_workqueues()
> is updated to set worker_pool->attrs appropriately for all standard
> pools.
>
> Note that create_worker() is updated to always perform set_user_nice()
> and use set_cpus_allowed_ptr() combined with manual assertion of
> PF_THREAD_BOUND instead of kthread_bind(). This simplifies handling
> random attributes without affecting the outcome.
>
> This patch doesn't introduce any behavior changes.
>
> v2: Missing cpumask_var_t definition caused build failure on some
> archs. linux/cpumask.h included.
>
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: kbuild test robot <fengguang.wu@intel.com>

> --- a/kernel/workqueue.c
> +++ b/kernel/workqueue.c
> @@ -148,6 +148,8 @@ struct worker_pool {
> struct mutex assoc_mutex; /* protect POOL_DISASSOCIATED */
> struct ida worker_ida; /* L: for worker IDs */
>
> + struct workqueue_attrs *attrs; /* I: worker attributes */

If attrs always exists, why not just embed the struct and avoid the
need to alloc/free it?

~Ryan



\
 
 \ /
  Last update: 2013-03-06 02:41    [W:0.090 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site