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

2012-10-01 Thread Vincent Guittot
On 1 October 2012 05:47, Viresh Kumar wrote: > On 1 October 2012 06:02, Tejun Heo wrote: >> It isn't about the CPU being actually idle? > > No. Being idle only from scheduler's perspective. :) > >> Also, if it's only about timers, shouldn't it be enough to implement >> it for timer and

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

2012-10-01 Thread Vincent Guittot
On 1 October 2012 05:47, Viresh Kumar viresh.ku...@linaro.org wrote: On 1 October 2012 06:02, Tejun Heo t...@kernel.org wrote: It isn't about the CPU being actually idle? No. Being idle only from scheduler's perspective. :) Also, if it's only about timers, shouldn't it be enough to implement

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

2012-09-30 Thread Viresh Kumar
On 1 October 2012 06:02, Tejun Heo wrote: > It isn't about the CPU being actually idle? No. Being idle only from scheduler's perspective. :) > Also, if it's only about timers, shouldn't it be enough to implement > it for timer and delayed_work? What if we need a timer, which must re-arm itself

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

2012-09-30 Thread Tejun Heo
Hello, On Sun, Sep 30, 2012 at 05:46:45PM +0530, Viresh Kumar wrote: > For the scheduler CPU is idle, if all below are true: > - current task is idle task > - nr_running == 0 > - wake_list is empty > > And during these conditions, there can be a timer running in background. > And when we reach

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

2012-09-30 Thread Viresh Kumar
On 30 September 2012 14:24, Tejun Heo wrote: > On Thu, Sep 27, 2012 at 02:34:05PM +0530, Viresh Kumar wrote: >> - A cpu has programmed a timer and is IDLE now. >> - CPU gets into interrupt handler due to timer and queues a work. As the CPU >> is >> currently IDLE, we can queue this work to

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

2012-09-30 Thread Tejun Heo
Hello, Viresh. On Thu, Sep 27, 2012 at 02:34:05PM +0530, Viresh Kumar wrote: > - A cpu has programmed a timer and is IDLE now. > - CPU gets into interrupt handler due to timer and queues a work. As the CPU > is > currently IDLE, we can queue this work to some other CPU. I'm still a bit

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

2012-09-30 Thread Tejun Heo
Hello, Viresh. On Thu, Sep 27, 2012 at 02:34:05PM +0530, Viresh Kumar wrote: - A cpu has programmed a timer and is IDLE now. - CPU gets into interrupt handler due to timer and queues a work. As the CPU is currently IDLE, we can queue this work to some other CPU. I'm still a bit confused,

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

2012-09-30 Thread Viresh Kumar
On 30 September 2012 14:24, Tejun Heo t...@kernel.org wrote: On Thu, Sep 27, 2012 at 02:34:05PM +0530, Viresh Kumar wrote: - A cpu has programmed a timer and is IDLE now. - CPU gets into interrupt handler due to timer and queues a work. As the CPU is currently IDLE, we can queue this work

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

2012-09-30 Thread Tejun Heo
Hello, On Sun, Sep 30, 2012 at 05:46:45PM +0530, Viresh Kumar wrote: For the scheduler CPU is idle, if all below are true: - current task is idle task - nr_running == 0 - wake_list is empty And during these conditions, there can be a timer running in background. And when we reach its

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

2012-09-30 Thread Viresh Kumar
On 1 October 2012 06:02, Tejun Heo t...@kernel.org wrote: It isn't about the CPU being actually idle? No. Being idle only from scheduler's perspective. :) Also, if it's only about timers, shouldn't it be enough to implement it for timer and delayed_work? What if we need a timer, which must

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

2012-09-28 Thread Viresh Kumar
On 27 September 2012 14:34, Viresh Kumar wrote: > 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

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

2012-09-28 Thread Viresh Kumar
On 27 September 2012 14:34, Viresh Kumar viresh.ku...@linaro.org wrote: 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

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

2012-09-27 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 V2 3/3] workqueue: Schedule work on non-idle cpu instead of current one

2012-09-27 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