Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1340449

Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at current frequency

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at current frequency
Date 2016-02-23 10:20 +0100
Message-ID <r5his-3dd-61@gated-at.bofh.it> (permalink)
References <r59Xz-6rQ-1@gated-at.bofh.it> <r59XC-6rQ-47@gated-at.bofh.it> <r5agV-6zw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Feb 23, 2016 at 02:41:20AM +0100, Rafael J. Wysocki wrote:
> >  /*
> > + * Returns the current capacity of cpu after applying both
> > + * cpu and freq scaling.
> > + */
> > +static unsigned long capacity_curr_of(int cpu)
> > +{
> > +       return cpu_rq(cpu)->cpu_capacity_orig *
> > +              arch_scale_freq_capacity(NULL, cpu)
> 
> What about architectures that don't have this?

They get the 'default' which is a constant SCHED_CAPACITY_SCALE unit.

> Why is that an architecture feature?

Because not all archs can tell the frequency the same way. Some you
program the DVFS state and they really run at this speed, for those you
can simply report back.

For others, x86 for example, you program a DVFS 'hint' and the hardware
does whatever, we'd have to do APERF/MPERF samples to get an idea of the
actual frequency we ran at.

Also, the having of this makes the load tracking slightly more
expensive, instead of compile time constants we get function calls and
actual multiplications. Its not _too_ bad, but still.

> I can easily imagine two x86 platforms using different
> scale_freq_capacity(), for example.

That's up to the arch, if different x86 platforms need different
thingies the arch implementation needs to offer a selector -- this isn't
'hard'.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFCv7 PATCH 00/10] sched: scheduler-driven CPU frequency selection Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 07/10] sched/fair: jump to max OPP when crossing UP threshold Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 09/10] sched/deadline: split rt_avg in 2 distincts metrics Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 10/10] sched: rt scheduler sets capacity requirement Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 08/10] sched: remove call of sched_avg_update from sched_rt_avg_update Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
    Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow "Rafael J. Wysocki" <rafael@kernel.org> - 2016-02-23 02:40 +0100
      Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow Michael Turquette <mturquette@baylibre.com> - 2016-02-26 02:10 +0100
        Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-26 02:20 +0100
          Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow "Rafael J. Wysocki" <rafael@kernel.org> - 2016-02-26 22:10 +0100
        Re: [RFCv7 PATCH 02/10] cpufreq: introduce cpufreq_driver_is_slow Steve Muckle <steve.muckle@linaro.org> - 2016-02-26 02:20 +0100
  [RFCv7 PATCH 06/10] sched/fair: cpufreq_sched triggers for load balancing Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 04/10] sched/fair: add triggers for OPP change requests Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
    Re: [RFCv7 PATCH 04/10] sched/fair: add triggers for OPP change requests Ricky Liang <jcliang@chromium.org> - 2016-03-01 08:00 +0100
      Re: [RFCv7 PATCH 04/10] sched/fair: add triggers for OPP change  requests Steve Muckle <steve.muckle@linaro.org> - 2016-03-03 05:00 +0100
  [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
    Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-25 05:00 +0100
      Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-02-25 10:30 +0100
        Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-25 22:10 +0100
      Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-02-25 10:30 +0100
        Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-25 22:10 +0100
          Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-02-26 10:20 +0100
            Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-27 01:10 +0100
              Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-03-01 14:00 +0100
                Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rafael@kernel.org> - 2016-03-01 20:50 +0100
      Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-25 12:10 +0100
      Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Steve Muckle <steve.muckle@linaro.org> - 2016-02-26 01:40 +0100
        Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-27 03:40 +0100
          Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Steve Muckle <steve.muckle@linaro.org> - 2016-02-27 05:20 +0100
            Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-28 03:30 +0100
              Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-03-01 15:40 +0100
                Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rafael@kernel.org> - 2016-03-01 21:40 +0100
            Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-03-01 14:30 +0100
        Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-03-01 14:20 +0100
        Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection Michael Turquette <mturquette@baylibre.com> - 2016-03-02 08:50 +0100
          Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency selection "Rafael J. Wysocki" <rafael@kernel.org> - 2016-03-03 03:50 +0100
            Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Steve Muckle <steve.muckle@linaro.org> - 2016-03-03 05:00 +0100
              Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Juri Lelli <Juri.Lelli@arm.com> - 2016-03-03 10:40 +0100
          Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Peter Zijlstra <peterz@infradead.org> - 2016-03-03 14:10 +0100
    Re: [RFCv7 PATCH 03/10] sched: scheduler-driven cpu frequency  selection Ingo Molnar <mingo@kernel.org> - 2016-03-03 15:30 +0100
  [RFCv7 PATCH 05/10] sched/{core,fair}: trigger OPP change request on fork() Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
  [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at current frequency Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:30 +0100
    Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at  current frequency "Rafael J. Wysocki" <rafael@kernel.org> - 2016-02-23 02:50 +0100
      Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at  current frequency Peter Zijlstra <peterz@infradead.org> - 2016-02-23 10:20 +0100
        Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at current frequency "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-02-26 02:40 +0100
          Re: [RFCv7 PATCH 01/10] sched: Compute cpu capacity available at  current frequency Peter Zijlstra <peterz@infradead.org> - 2016-02-26 10:20 +0100
  Re: [RFCv7 PATCH 00/10] sched: scheduler-driven CPU frequency  selection Steve Muckle <steve.muckle@linaro.org> - 2016-02-23 02:40 +0100

csiph-web