Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-30 Thread Lai Jiangshan
On 04/28/2015 06:16 PM, Lai Jiangshan wrote: > On 04/28/2015 11:49 AM, Tejun Heo wrote: >> Hello, >> >> On Tue, Apr 28, 2015 at 10:24:31AM +0800, Lai Jiangshan wrote: > Wouldn't this make a lot more sense above when copying @attrs into > @new_attrs? The comment there even says "make a copy

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-28 Thread Mike Galbraith
On Tue, 2015-04-28 at 18:31 +0800, Lai Jiangshan wrote: > So, the public function needs to be kept and the EXPORT_SYMBOL_GPL() > is killed? IMO yes. -Mike -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org Mor

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-28 Thread Lai Jiangshan
On 04/28/2015 12:36 PM, Mike Galbraith wrote: > On Mon, 2015-04-27 at 23:44 -0400, Tejun Heo wrote: > >>> So, we need an API to modify the wq_unbound_cpumask, and I provided >>> this public function. Otherwise, the other code can't modify it. >> >> I see. I don't have too strong an opinion; howe

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-28 Thread Lai Jiangshan
On 04/28/2015 11:49 AM, Tejun Heo wrote: > Hello, > > On Tue, Apr 28, 2015 at 10:24:31AM +0800, Lai Jiangshan wrote: Wouldn't this make a lot more sense above when copying @attrs into @new_attrs? The comment there even says "make a copy of @attrs and sanitize it". Copy to @new_att

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Mike Galbraith
On Mon, 2015-04-27 at 23:44 -0400, Tejun Heo wrote: > > So, we need an API to modify the wq_unbound_cpumask, and I provided > > this public function. Otherwise, the other code can't modify it. > > I see. I don't have too strong an opinion; however, changing the mask > is a fairly heavy operatio

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Tejun Heo
Hello, On Tue, Apr 28, 2015 at 10:24:31AM +0800, Lai Jiangshan wrote: > >> Wouldn't this make a lot more sense above when copying @attrs into > >> @new_attrs? The comment there even says "make a copy of @attrs and > >> sanitize it". Copy to @new_attrs, mask with wq_unbound_cpumask and > >> fall

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Tejun Heo
Hello, On Tue, Apr 28, 2015 at 09:44:44AM +0800, Lai Jiangshan wrote: > >> +int workqueue_set_unbound_cpumask(cpumask_var_t cpumask); > > > > Why is this a public function? > > > In V4 patchset, Kevin Hilman had requested the wq_unbound_cpumask > to be "cpumask_complement(wq_unbound_cpumask, ti

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Lai Jiangshan
On 04/28/2015 09:44 AM, Lai Jiangshan wrote: >>> >>> + /* save the user configured attrs */ >>> + cpumask_and(new_attrs->cpumask, attrs->cpumask, cpu_possible_mask); >> >> Wouldn't this make a lot more sense above when copying @attrs into >> @new_attrs? The comment there even says "make a c

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Lai Jiangshan
Hello > >> --- a/include/linux/workqueue.h >> +++ b/include/linux/workqueue.h >> @@ -424,6 +424,7 @@ struct workqueue_attrs *alloc_workqueue_attrs(gfp_t >> gfp_mask); >> void free_workqueue_attrs(struct workqueue_attrs *attrs); >> int apply_workqueue_attrs(struct workqueue_struct *wq, >>

Re: [PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Tejun Heo
Hello, Lai. Overall, it looks good, just a couple more nits. On Mon, Apr 27, 2015 at 05:58:40PM +0800, Lai Jiangshan wrote: > The oreder-workquue is ignore from the low level unbound workqueue Ordered workqueues are ignored > cpumask, it will be handled in near future. > > All the (default &

[PATCH 3/3 V8] workqueue: Allow modifying low level unbound workqueue cpumask

2015-04-27 Thread Lai Jiangshan
Allow to modify the low-level unbound workqueues cpumask through sysfs. This is performed by traversing the entire workqueue list and calling apply_wqattrs_prepare() on the unbound workqueues with the new low level mask. Only after all the preparation are done, we commit them all together. The ore