Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1261526
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection |
| Date | 2015-11-03 15:20 +0100 |
| Message-ID | <qqKBk-3MG-5@gated-at.bofh.it> (permalink) |
| References | <qqxup-3IW-3@gated-at.bofh.it> <qqxuq-3IW-15@gated-at.bofh.it> <qqJYC-3iE-15@gated-at.bofh.it> |
| Organization | OTC |
On Tue, 3 Nov 2015 14:31:20 +0100
Peter Zijlstra <peterz@infradead.org> wrote:
> > @@ -5136,6 +5148,16 @@ pick_next_task_fair(struct rq *rq, struct
> > task_struct *prev) struct task_struct *p;
> > int new_tasks;
> >
> > +#ifdef CONFIG_CFS_IDLE_INJECT
> > + if (cfs_rq->force_throttled &&
> > + !idle_cpu(cpu_of(rq)) &&
> > + !unlikely(local_softirq_pending())) {
> > + /* forced idle, pick no task */
> > + trace_sched_cfs_idle_inject(cpu_of(rq), 1);
> > + update_curr(cfs_rq);
> > + return NULL;
> > + }
> > +#endif
> > again:
> > #ifdef CONFIG_FAIR_GROUP_SCHED
> > if (!cfs_rq->nr_running)
>
> So this is horrible...
>
> This is a fast path, and you just put at least one cachemiss in it, a
> branch (without hint) and some goofy code (wth are we checking
> softirqs?).
>
softirq is checked here since it is one of the conditions to stop
sched tick. can_stop_idle_tick(). but we don't have to check here, you
are right.
> How about you frob things such that cfs_rq->nr_running == 0 and we'll
> hit the idle: path, at that point you can test if we're forced idle
> and skip the load-balancing attempt.
>
> There's probably a fair number of icky cases to deal with if you frob
> cfs_rq->nr_running, like the enqueue path which will add to it. We'll
> have to come up with something to not slow that down either.
>
> The thing is, both schedule and enqueue are very hot and this is code
> that will 'never' run.
Fair enough, I will give that a try. I understand we don't want to
sacrifice the hot patch for some code almost 'never' run. But I also
have follow up plan to use this code for consolidating/synchronizing
idle during balanced semi-active workload. In that case, it may run
more often. e.g.
Before:
CPU0 ______||| || |___________| || || |_____
CPU1 _________||| || |_______| || |_______
After:
CPU0 ______||| || |___________| || || |_____
CPU1 ______||| || |___________| || |_______
The goal is to have overlapping idle time if the load is already
balanced. The energy saving can be significant.
Jacob
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-03 01:20 +0100
[RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-03 01:20 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-03 14:40 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-03 15:20 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-03 17:50 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 11:20 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Arjan van de Ven <arjan@linux.intel.com> - 2015-11-05 15:30 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 15:40 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 15:50 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Arjan van de Ven <arjan@linux.intel.com> - 2015-11-05 16:30 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 18:00 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Thomas Gleixner <tglx@linutronix.de> - 2015-11-05 20:00 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Thomas Gleixner <tglx@linutronix.de> - 2015-11-05 19:50 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-05 16:40 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Arjan van de Ven <arjan@linux.intel.com> - 2015-11-05 17:10 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-05 20:30 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-05 20:40 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 15:10 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-06 00:50 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-06 08:50 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-07 01:00 +0100
Re: [RFC PATCH 3/3] sched: introduce synchronized idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-10 01:30 +0100
[RFC PATCH 2/3] timer: relax tick stop in idle entry Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-03 01:20 +0100
Re: [RFC PATCH 0/3] CFS idle injection Eduardo Valentin <edubezval@gmail.com> - 2015-11-04 07:10 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-04 18:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> - 2015-11-04 18:10 +0100
Re: [RFC PATCH 0/3] CFS idle injection Eduardo Valentin <edubezval@gmail.com> - 2015-11-04 19:50 +0100
Re: [RFC PATCH 0/3] CFS idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-05 11:20 +0100
Re: [RFC PATCH 0/3] CFS idle injection Punit Agrawal <punit.agrawal@arm.com> - 2015-11-06 18:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-06 22:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Punit Agrawal <punit.agrawal@arm.com> - 2015-11-09 13:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-09 15:20 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-09 15:50 +0100
Re: [RFC PATCH 0/3] CFS idle injection Juri Lelli <juri.lelli@gmail.com> - 2015-11-10 11:10 +0100
Re: [RFC PATCH 0/3] CFS idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-10 11:40 +0100
Re: [RFC PATCH 0/3] CFS idle injection Juri Lelli <juri.lelli@arm.com> - 2015-11-10 12:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-09 15:40 +0100
Re: [RFC PATCH 0/3] CFS idle injection Dietmar Eggemann <dietmar.eggemann@arm.com> - 2015-11-06 19:40 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-06 20:20 +0100
Re: [RFC PATCH 0/3] CFS idle injection Dietmar Eggemann <dietmar.eggemann@arm.com> - 2015-11-06 23:00 +0100
Re: [RFC PATCH 0/3] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-09 22:30 +0100
Re: [RFC PATCH 0/3] CFS idle injection Peter Zijlstra <peterz@infradead.org> - 2015-11-09 22:50 +0100
csiph-web