[PATCH 2/5] workqueue: merge the similar code

2015-05-11 Thread Lai Jiangshan
The calculation and allocation of per-node pwq code in apply_workqueue_attrs() and wq_update_unbound_numa() are highly similar, we merge them into alloc_node_unbound_pwq(). wq_calc_node_mask() is only used for this calculation and allocation, so it is also moved into alloc_node_unbound_pwq(). Cha

Re: [PATCH 2/5] workqueue: merge the similar code

2015-05-11 Thread Tejun Heo
Hello, Lai. On Mon, May 11, 2015 at 05:35:49PM +0800, Lai Jiangshan wrote: > @@ -3440,48 +3440,86 @@ static struct pool_workqueue > *alloc_unbound_pwq(struct workqueue_struct *wq, > } > > /** > - * wq_calc_node_mask - calculate a wq_attrs' cpumask for the specified node > - * @attrs: the wq_a

Re: [PATCH 2/5] workqueue: merge the similar code

2015-05-11 Thread Lai Jiangshan
On 05/11/2015 10:31 PM, Tejun Heo wrote: > Hello, Lai. Hello, TJ > >> * @node: the target NUMA node >> - * @cpu_going_down: if >= 0, the CPU to consider as offline >> - * @cpumask: outarg, the resulting cpumask >> + * @cpu_off: if >= 0, the CPU to consider as offline > > @cpu_off sounds like

Re: [PATCH 2/5] workqueue: merge the similar code

2015-05-12 Thread Tejun Heo
Hello, On Tue, May 12, 2015 at 10:03:11AM +0800, Lai Jiangshan wrote: > > @cpu_off sounds like offset into cpu array or sth. Is there a reason > > to change the name? > > @cpu_off is a local variable in wq_update_unbound_numa() and is a shorter > name. Let's stick with the other name. > > > >