From: Viresh Kumar <viresh.kumar@linaro.org>
To: Steve Muckle <steve.muckle@linaro.org>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target()
Date: Thu, 2 Jun 2016 06:59:04 +0530 [thread overview]
Message-ID: <20160602012904.GV3725@vireshk-i7> (raw)
In-Reply-To: <20160601194615.GQ9864@graphite.smuckle.net>
On 01-06-16, 12:46, Steve Muckle wrote:
> > /*
> > * Find the closest frequency above target_freq.
> > - *
> > - * The table is sorted in the reverse order with respect to the
> > - * frequency and all of the entries are valid (see the initialization).
> > */
> > - entry = policy->freq_table;
> > - do {
> > - entry++;
> > - freq = entry->frequency;
> > - } while (freq >= target_freq && freq != CPUFREQ_TABLE_END);
> > - entry--;
> > + index = cpufreq_frequency_table_target(policy, target_freq,
> > + CPUFREQ_RELATION_L);
>
> This adds a function call to the fast path...
I understand that, but I am not sure how far should we go to avoid
that. Open coding routines to save on that isn't a good idea surely.
I have at least kept this routine in cpufreq.h to avoid a call, but
eventually we will have at least a call somewhere within it. :(
--
viresh
next prev parent reply other threads:[~2016-06-02 1:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-01 10:39 [PATCH V2 0/2] cpufreq: Use sorted frequency tables Viresh Kumar
2016-06-01 10:39 ` [PATCH V2 1/2] cpufreq: Store sorted frequency table Viresh Kumar
2016-06-01 10:39 ` [PATCH V2 2/2] cpufreq: Optimize cpufreq_frequency_table_target() Viresh Kumar
2016-06-01 19:46 ` Steve Muckle
2016-06-02 1:29 ` Viresh Kumar [this message]
2016-06-02 18:28 ` Steve Muckle
2016-06-03 3:16 ` Viresh Kumar
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=20160602012904.GV3725@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rjw@rjwysocki.net \
--cc=steve.muckle@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;
as well as URLs for NNTP newsgroup(s).