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


Groups > linux.kernel > #1592928

Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared()

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared()
Date 2017-03-06 05:50 +0100
Message-ID <thSKS-2BN-25@gated-at.bofh.it> (permalink)
References <tgurg-81p-15@gated-at.bofh.it> <tgurg-81p-13@gated-at.bofh.it> <th5Au-t5-9@gated-at.bofh.it> <th5Au-t5-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 04-03-17, 01:11, Rafael J. Wysocki wrote:
> So one idea is that if SCHED_CPUFREQ_RT_DL is set in flags, we don't even
> need to start the loop which is quite a cost to simply notice that there's
> nothing to do.

Hmm. Isn't the probability of this flag being set, same for all CPUs in the
policy? If yes, then why do we need to handle the current CPU specially?

> Also I don't quite agree with adding an extra pair of integer multiplications
> to that loop just to get rid of the extra args.

But that should be cheap enough as we would be multiplying with 1 in one of them
and with 0 on the other.

Isn't that better then keeping same code at two places?

Also as I mentioned in the commit log, the number of extra comparisons for the
current CPU will be balanced if we have three CPUs in the policy and with every
other CPU in the policy, we will end up doing one comparison less. With
Quad-core policies, we reduce the number of comparisons by 1 and for octa-core
ones, we reduce it by 5.

-- 
viresh

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


Thread

[PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-02 09:40 +0100
  Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-04 01:20 +0100
    Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from  sugov_next_freq_shared() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-06 05:50 +0100
      Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-06 13:40 +0100
        Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from  sugov_next_freq_shared() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-07 11:40 +0100
          Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-07 14:30 +0100
            Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from  sugov_next_freq_shared() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-08 05:20 +0100
              Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-08 12:00 +0100
                Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from  sugov_next_freq_shared() Viresh Kumar <viresh.kumar@linaro.org> - 2017-03-08 12:20 +0100
                Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rafael@kernel.org> - 2017-03-08 14:10 +0100
  Re: [PATCH 3/3] cpufreq: schedutil: remove redundant code from sugov_next_freq_shared() "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-03-04 01:20 +0100

csiph-web