Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-26 Thread Viresh Kumar
On 25 September 2012 23:26, Tejun Heo wrote: > On Tue, Sep 25, 2012 at 04:06:08PM +0530, Viresh Kumar wrote: >> +config MIGRATE_WQ >> + bool "(EXPERIMENTAL) Migrate Workqueues to non-idle cpu" >> + depends on SMP && EXPERIMENTAL >> + help >> + Workqueues queues work on current

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-26 Thread Viresh Kumar
On 25 September 2012 23:26, Tejun Heo t...@kernel.org wrote: On Tue, Sep 25, 2012 at 04:06:08PM +0530, Viresh Kumar wrote: +config MIGRATE_WQ + bool (EXPERIMENTAL) Migrate Workqueues to non-idle cpu + depends on SMP EXPERIMENTAL + help + Workqueues queues work on current

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Tejun Heo
Hello, On Tue, Sep 25, 2012 at 04:06:08PM +0530, Viresh Kumar wrote: > +config MIGRATE_WQ > + bool "(EXPERIMENTAL) Migrate Workqueues to non-idle cpu" > + depends on SMP && EXPERIMENTAL > + help > + Workqueues queues work on current cpu, if the caller haven't passed a > +

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 13:40 +0200, Peter Zijlstra wrote: > On Tue, 2012-09-25 at 17:00 +0530, Viresh Kumar wrote: > > But this is what the initial idea during LPC we had. > > Yeah.. that's true. > > > Any improvements here you can suggest? > > We could uhm... /me tries thinking ... reuse some

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 17:00 +0530, Viresh Kumar wrote: > But this is what the initial idea during LPC we had. Yeah.. that's true. > Any improvements here you can suggest? We could uhm... /me tries thinking ... reuse some of the NOHZ magic? Would that be sufficient, not waking a NOHZ cpu, or

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Vincent Guittot
On 25 September 2012 13:30, Viresh Kumar wrote: > On 25 September 2012 16:52, Peter Zijlstra wrote: >> On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: >>> @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, >>> struct work_struct *work) >>> { >>> int ret; >>> >>> -

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Viresh Kumar
On 25 September 2012 16:52, Peter Zijlstra wrote: > On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: >> @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, >> struct work_struct *work) >> { >> int ret; >> >> - ret = queue_work_on(get_cpu(), wq, work); >> -

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: > @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, > struct work_struct *work) > { > int ret; > > - ret = queue_work_on(get_cpu(), wq, work); > - put_cpu(); > + preempt_disable(); > + ret =

[PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Viresh Kumar
Workqueues queues work on current cpu, if the caller haven't passed a preferred cpu. This may wake up an idle CPU, which is actually not required. This work can be processed by any CPU and so we must select a non-idle CPU here. This patch adds in support in workqueue framework to get preferred

[PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Viresh Kumar
Workqueues queues work on current cpu, if the caller haven't passed a preferred cpu. This may wake up an idle CPU, which is actually not required. This work can be processed by any CPU and so we must select a non-idle CPU here. This patch adds in support in workqueue framework to get preferred

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, struct work_struct *work) { int ret; - ret = queue_work_on(get_cpu(), wq, work); - put_cpu(); + preempt_disable(); + ret =

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Viresh Kumar
On 25 September 2012 16:52, Peter Zijlstra pet...@infradead.org wrote: On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, struct work_struct *work) { int ret; - ret = queue_work_on(get_cpu(), wq, work); -

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Vincent Guittot
On 25 September 2012 13:30, Viresh Kumar viresh.ku...@linaro.org wrote: On 25 September 2012 16:52, Peter Zijlstra pet...@infradead.org wrote: On Tue, 2012-09-25 at 16:06 +0530, Viresh Kumar wrote: @@ -1066,8 +1076,9 @@ int queue_work(struct workqueue_struct *wq, struct work_struct *work) {

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 17:00 +0530, Viresh Kumar wrote: But this is what the initial idea during LPC we had. Yeah.. that's true. Any improvements here you can suggest? We could uhm... /me tries thinking ... reuse some of the NOHZ magic? Would that be sufficient, not waking a NOHZ cpu, or do

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Peter Zijlstra
On Tue, 2012-09-25 at 13:40 +0200, Peter Zijlstra wrote: On Tue, 2012-09-25 at 17:00 +0530, Viresh Kumar wrote: But this is what the initial idea during LPC we had. Yeah.. that's true. Any improvements here you can suggest? We could uhm... /me tries thinking ... reuse some of the

Re: [PATCH 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-25 Thread Tejun Heo
Hello, On Tue, Sep 25, 2012 at 04:06:08PM +0530, Viresh Kumar wrote: +config MIGRATE_WQ + bool (EXPERIMENTAL) Migrate Workqueues to non-idle cpu + depends on SMP EXPERIMENTAL + help + Workqueues queues work on current cpu, if the caller haven't passed a + preferred