mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu,
	peterz@infradead.org, nicolas.pitre@linaro.org,
	linux-pm@vger.kernel.org, alex.shi@linaro.org,
	vincent.guittot@linaro.org, morten.rasmussen@arm.com
Subject: Re: [RFC PATCHC 0/3] sched/idle : find the idlest cpu with cpuidle info
Date: Fri, 04 Apr 2014 13:23:17 +0200	[thread overview]
Message-ID: <1529331.DNJJHlmQ1T@vostro.rjw.lan> (raw)
In-Reply-To: <533BC9B7.3010501@linaro.org>

On Wednesday, April 02, 2014 10:26:31 AM Daniel Lezcano wrote:
> On 04/02/2014 01:01 AM, Rafael J. Wysocki wrote:
> > On Friday, March 28, 2014 01:29:53 PM Daniel Lezcano wrote:
> >> The following patchset provides an interaction between cpuidle and the scheduler.
> >>
> >> The first patch encapsulate the needed information for the scheduler in a
> >> separate cpuidle structure. The second one stores the pointer to this structure
> >> when entering idle. The third one, use this information to take the decision to
> >> find the idlest cpu.
> >>
> >> After some basic testing with hackbench, it appears there is an improvement for
> >> the performances (small) and for the duration of the idle states (which provides
> >> a better power saving).
> >>
> >> The measurement has been done with the 'idlestat' tool previously posted in this
> >> mailing list.
> >>
> >> So the benefit is good for both sides performance and power saving.
> >>
> >> The select_idle_sibling could be also improved in the same way.
> >
> > Well, quite frankly, I don't really like this series.  Not the idea itself, but
> > the way it has been implemented.
> >
> > First off, if the scheduler is to access idle state data stored in struct
> > cpuidle_state, I'm not sure why we need a separate new structure for that?
> > Couldn't there be a pointer to a whole struct cpuidle_state from struct rq
> > instead?  [->exit_latency is the only field that find_idlest_cpu() in your
> > third patch seems to be using anyway.]
> 
> Hi Rafael,
> 
> thank you very much for reviewing the patchset.
> 
> I created a specific structure to encapsulate the informations needed 
> for the scheduler and to prevent to export unneeded data. This is purely 
> for code design. Also it was to separate the idle's energy 
> characteristics from the cpuidle framework data (flags, name, etc ...).
> 
> The exit_latency field is only used in this patchset but the 
> target_residency will be used also (eg. prevent to wakeup a cpu before 
> the minimum idle time target residency).

OK

It would be good to add that heuristics upfront so that we can see the full
picture.

> The power field is ... hum ... not filled by any board (except for 
> calxeda). Vendors do not like to share this information, so very likely 
> that would be changed to a normalized value, I don't know.

I'm not sure if that field is ever going to be used by everyone to be honest.

> I agree we can put a pointer to the struct cpuidle_state instead if that 
> reduce the impact of the patchset.

Yes, it will, in my opinion.

> > Second, is accessing the idle state information for all CPUs from find_idlest_cpu()
> > guaranteed to be non-racy?  I mean, what if a CPU changes its state from idle to
> > non-idle while another one is executing find_idlest_cpu()?  In other words,
> > where's the read memory barrier corresponding to the write ones in the modified
> > cpu_idle_call()?  And is the memory barrier actually sufficient?  After all,
> > you need to guarantee that the CPU is still idle after you have evaluated
> > idle_cpu() on it.
> 
> Well, as Nicolas mentioned it in another mail, we can live with races, 
> the scheduler will take a wrong decision but nothing worth than what we 

I guess you mean "worse"?  I'm not sure about that.

> have today. In any case we want to prevent any lock in the code.

Of course. :-)

> > Finally, is really the heuristics used by find_idlest_cpu() to select the "idlest"
> > CPU the best one?  What about deeper vs shallower idle states, for example?
> 
> I believe it is what is supposed to do the patchset. 1. if the cpu is 
> idle, pick the shallower, 2. if the cpu is not idle pick the less 
> loaded. But may be there is something wrong in the routine as pointed 
> Nico, I have to double check it.

Yes, that routine doesn't look entirely correct then.

Thanks!

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

  reply	other threads:[~2014-04-04 11:07 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 12:29 Daniel Lezcano
2014-03-28 12:29 ` [RFC PATCHC 1/3] cpuidle: encapsulate power info in a separate structure Daniel Lezcano
2014-03-28 18:17   ` Nicolas Pitre
2014-03-28 20:42     ` Daniel Lezcano
2014-03-29  0:00       ` Nicolas Pitre
2014-03-28 12:29 ` [RFC PATCHC 2/3] idle: store the idle state the cpu is Daniel Lezcano
2014-04-15 12:43   ` Peter Zijlstra
2014-04-15 12:44     ` Peter Zijlstra
2014-04-15 14:17       ` Daniel Lezcano
2014-04-15 14:33         ` Peter Zijlstra
2014-04-15 14:39           ` Daniel Lezcano
2014-03-28 12:29 ` [RFC PATCHC 3/3] sched/fair: use the idle state info to choose the idlest cpu Daniel Lezcano
2014-04-02  3:05   ` Nicolas Pitre
2014-04-04 11:57     ` Rafael J. Wysocki
2014-04-04 16:56       ` Nicolas Pitre
2014-04-05  2:01         ` Rafael J. Wysocki
2014-04-17 13:53     ` Daniel Lezcano
2014-04-17 14:47       ` Peter Zijlstra
2014-04-17 15:03         ` Daniel Lezcano
2014-04-18  8:09           ` Ingo Molnar
2014-04-18  8:36             ` Daniel Lezcano
2014-04-17 15:53       ` Nicolas Pitre
2014-04-17 16:05         ` Daniel Lezcano
2014-04-17 16:21           ` Nicolas Pitre
2014-04-18  9:38             ` Peter Zijlstra
2014-04-18 12:13               ` Daniel Lezcano
2014-04-18 12:53                 ` Peter Zijlstra
2014-04-18 13:04                   ` Daniel Lezcano
2014-04-18 16:00                     ` Nicolas Pitre
2014-04-15 13:03   ` Peter Zijlstra
2014-03-31 13:52 ` [RFC PATCHC 0/3] sched/idle : find the idlest cpu with cpuidle info Vincent Guittot
2014-03-31 15:55   ` Daniel Lezcano
2014-04-01  7:16     ` Vincent Guittot
2014-04-01  7:43       ` Daniel Lezcano
2014-04-01  9:05         ` Vincent Guittot
2014-04-15 13:13           ` Peter Zijlstra
2014-04-01 23:01 ` Rafael J. Wysocki
2014-04-02  3:14   ` Nicolas Pitre
2014-04-04 11:43     ` Rafael J. Wysocki
2014-04-15 13:17       ` Peter Zijlstra
2014-04-15 13:25       ` Peter Zijlstra
2014-04-15 15:27         ` Nicolas Pitre
2014-04-15 15:33         ` Rafael J. Wysocki
2014-04-02  8:26   ` Daniel Lezcano
2014-04-04 11:23     ` Rafael J. Wysocki [this message]
2014-04-04  6:29 ` Len Brown
2014-04-04  8:16   ` Daniel Lezcano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1529331.DNJJHlmQ1T@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=alex.shi@linaro.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=morten.rasmussen@arm.com \
    --cc=nicolas.pitre@linaro.org \
    --cc=peterz@infradead.org \
    --cc=vincent.guittot@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®