Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-17 Thread Peter Zijlstra
On Mon, Jun 16, 2014 at 08:50:07AM -0700, Tim Chen wrote: > > The worry I have is that this update is 'slow'. We could have grown many > > tasks since the last update. > > The update to turn on the indicator is immediate and triggered in > add_nr_running. So if there are more than one tasks on any

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-16 Thread Tim Chen
On Sun, 2014-06-15 at 18:19 +0200, Peter Zijlstra wrote: > On Thu, Jun 12, 2014 at 02:25:59PM -0700, Tim Chen wrote: > > @@ -2630,7 +2630,7 @@ static inline struct task_struct * > > pick_next_task(struct rq *rq, struct task_struct *prev) > > { > > const struct sched_class *class = &fair_sched

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-15 Thread Peter Zijlstra
On Thu, Jun 12, 2014 at 02:25:59PM -0700, Tim Chen wrote: > @@ -2630,7 +2630,7 @@ static inline struct task_struct * > pick_next_task(struct rq *rq, struct task_struct *prev) > { > const struct sched_class *class = &fair_sched_class; > - struct task_struct *p; > + struct task_struct

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-13 Thread Tim Chen
On Fri, 2014-06-13 at 12:18 -0700, Jason Low wrote: > > I see. In that case, if a CPU is going idle, it still needs to call > idle_balance() to update rq->idle_stamp and rq->next_balance (even if we > skip calling the expensive load_balance). > > What do you think about moving the overload check

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-13 Thread Jason Low
On Fri, 2014-06-13 at 09:28 -0700, Tim Chen wrote: > On Thu, 2014-06-12 at 23:01 -0700, Jason Low wrote: > > On Thu, 2014-06-12 at 14:25 -0700, Tim Chen wrote: > > > > > Signed-off-by: Tim Chen > > > --- > > > kernel/sched/core.c | 12 > > > kernel/sched/fair.c | 23 ++

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-13 Thread Tim Chen
On Thu, 2014-06-12 at 23:01 -0700, Jason Low wrote: > On Thu, 2014-06-12 at 14:25 -0700, Tim Chen wrote: > > > Signed-off-by: Tim Chen > > --- > > kernel/sched/core.c | 12 > > kernel/sched/fair.c | 23 +-- > > kernel/sched/sched.h | 10 -- > > 3 files

Re: [PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-12 Thread Jason Low
On Thu, 2014-06-12 at 14:25 -0700, Tim Chen wrote: > Signed-off-by: Tim Chen > --- > kernel/sched/core.c | 12 > kernel/sched/fair.c | 23 +-- > kernel/sched/sched.h | 10 -- > 3 files changed, 37 insertions(+), 8 deletions(-) > > diff --git a/kernel/s

[PATCH] sched: Fast idling of CPU when system is partially loaded

2014-06-12 Thread Tim Chen
When a system is lightly loaded (i.e. no more than 1 job per cpu), attempt to pull job to a cpu before putting it to idle is unnecessary and can be skipped. This patch adds an indicator so the scheduler can know when there's no more than 1 active job is on any CPU in the system to skip needless jo