From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v5 1/9] cpuidle: Add commonly used functionality for consolidation
Date: Tue, 28 Feb 2012 09:58:54 -0600 [thread overview]
Message-ID: <4F4CF9BE.1000203@gmail.com> (raw)
In-Reply-To: <CAMXH7KEBggsYEq9irMoEG-fZEjgEFACFhZZ+-JQj0uvwpGsZHA@mail.gmail.com>
On 02/28/2012 09:45 AM, Rob Lee wrote:
> Hey Mike,
>
> On Mon, Feb 27, 2012 at 6:06 PM, Turquette, Mike <mturquette@ti.com> wrote:
>> On Sun, Feb 26, 2012 at 8:47 PM, Robert Lee <rob.lee@linaro.org> wrote:
>>> +/**
>>> + * cpuidle_enter_wrap - performing timekeeping and irq around enter function
>>> + * @dev: pointer to a valid cpuidle_device object
>>> + * @drv: pointer to a valid cpuidle_driver object
>>> + * @index: index of the target cpuidle state.
>>> + */
>>> +static inline int cpuidle_wrap_enter(struct cpuidle_device *dev,
>>> + struct cpuidle_driver *drv, int index,
>>> + int (*enter)(struct cpuidle_device *dev,
>>> + struct cpuidle_driver *drv, int index))
>>> +{
>>> + ktime_t time_start, time_end;
>>> + s64 diff;
>>> +
>>> + time_start = ktime_get();
>>> +
>>> + index = enter(dev, drv, index);
>>> +
>>> + time_end = ktime_get();
>>> +
>>> + local_irq_enable();
>>> +
>>> + diff = ktime_to_us(ktime_sub(time_end, time_start));
>>> + if (diff > INT_MAX)
>>> + diff = INT_MAX;
>>> +
>>> + dev->last_residency = (int) diff;
>>> +
>>> + return index;
>>> +}
>>
>> Any reason that this code is in the header? Why not in cpuidle.c?
>>
>
> Not a strong reason. I thought making it an inline would introduce
> slightly less new execution when adding this code (realizing that
> there are function calls immediately after, so the only benefit is the
> reduce popping and pushing). But it does require an extra copy of
> this code for any platform driver that does not enable
> en_core_tk_irqen and instead makes calls to it directly (like omap3).
> For this case, I don't think the inline implementation should add
> extra code from what exists today as it should simply replace the
> existing platform time keeping calls to a standard one defined by the
> core cpuidle.
>
But you will have multiple copies of the inlined code if platforms do
use it. Or is it used only by the core cpuidle code? In that case, gcc
can automatically inline static functions.
It seems a bit long to inline and this isn't performance critical (at
least for the enter side).
Rob
> I don't have a strong preference with using the inline so if you or
> others can give your opinion on which method to use and why, I'd be
> glad to read it.
>
>> Regards,
>> Mike
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2012-02-28 15:58 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-27 4:47 [PATCH v5 0/9] Consolidate cpuidle functionality Robert Lee
2012-02-27 4:47 ` [PATCH v5 1/9] cpuidle: Add commonly used functionality for consolidation Robert Lee
2012-02-27 16:19 ` Jean Pihet
2012-02-27 19:23 ` Rob Lee
2012-02-28 0:06 ` Turquette, Mike
2012-02-28 15:45 ` Rob Lee
2012-02-28 15:58 ` Rob Herring [this message]
2012-02-28 20:49 ` Rob Lee
2012-02-28 0:49 ` Turquette, Mike
2012-02-28 15:50 ` Rob Lee
2012-02-28 21:42 ` Turquette, Mike
2012-02-28 23:33 ` Rob Lee
2012-02-28 23:47 ` Turquette, Mike
2012-02-29 0:04 ` Rob Lee
2012-02-27 4:47 ` [PATCH v5 2/9] SH: shmobile: cpuidle consolidation Robert Lee
2012-02-27 15:13 ` Rob Lee
2012-02-27 4:47 ` [PATCH v5 3/9] ARM: omap: Consolidate OMAP3 cpuidle time keeping and irq enable Robert Lee
2012-02-27 16:26 ` Jean Pihet
2012-02-27 19:27 ` Rob Lee
2012-02-27 4:47 ` [PATCH v5 4/9] ARM: omap: Consolidate OMAP4 " Robert Lee
2012-02-27 4:47 ` [PATCH v5 5/9] ARM: shmobile: Consolidate cpuidle functionality Robert Lee
2012-02-27 4:47 ` [PATCH v5 6/9] ARM: davinci: " Robert Lee
2012-02-27 4:47 ` [PATCH v5 7/9] ARM: exynos: " Robert Lee
2012-02-27 4:47 ` [PATCH v5 8/9] ARM: kirkwood: " Robert Lee
2012-02-27 4:47 ` [PATCH v5 9/9] ARM: at91: " Robert Lee
2012-02-27 16:32 ` [PATCH v5 0/9] " Amit Kucheria
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=4F4CF9BE.1000203@gmail.com \
--to=robherring2@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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).