Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1269185 > unrolled thread
| Started by | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| First post | 2015-11-13 21:00 +0100 |
| Last post | 2015-11-13 23:40 +0100 |
| Articles | 6 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH 0/4] CFS idle injection Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-13 21:00 +0100
[PATCH 1/4] ktime: add a roundup function Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-13 21:00 +0100
Re: [PATCH 1/4] ktime: add a roundup function John Stultz <john.stultz@linaro.org> - 2015-11-13 21:20 +0100
Re: [PATCH 1/4] ktime: add a roundup function Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-13 23:40 +0100
Re: [PATCH 1/4] ktime: add a roundup function Thomas Gleixner <tglx@linutronix.de> - 2015-11-13 21:20 +0100
Re: [PATCH 1/4] ktime: add a roundup function Jacob Pan <jacob.jun.pan@linux.intel.com> - 2015-11-13 23:40 +0100
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Date | 2015-11-13 21:00 +0100 |
| Subject | [PATCH 0/4] CFS idle injection |
| Message-ID | <qusFP-2eI-3@gated-at.bofh.it> |
We are entering a very power and thermal constrained environment. Often we have more horsepower than we can use due to these limits. But on the other side we all demand performance when needed. The reserved performance headroom does not come free. To conserve energy, more and more SoC blocks can be power gated at runtime. However, randomly scheduled idle time on individual CPU may not result in good power saving in that the common circuits such as memory controller can only be in the low power state when all cores are in idle at the same time. Frequency-Voltage scaling presents a good solution but its efficiency is limited to certain range. In general, only synchronized idle will allow SoC to enter the deepest power states. For most modern processors, deep idle power is nearly negligible to the peak running power. This implies if we can duty cycle the CPU between running and the deepest idle state, we can scale performance and power almost linearly. Combined with the most efficient frequency point, idle injection presents a way to cap power efficiently. Intel powerclamp driver was introduced a while ago to address the problem but is broken in the sense of turning off idle ticks in the forced idle period. https://lkml.org/lkml/2014/12/18/369 It was suggested to replace the current kthread play idle loop with a timer based runqueue throttling scheme. I finally got around to implement this and code looks much simpler and more effective. Test results were presented at LinuxCon where data/graph can be seen from slides #18 and later. http://events.linuxfoundation.org/sites/events/files/slides/LinuxCon_Japan_2015_idle_injection1_0.pdf RFC discussions are here. https://lkml.org/lkml/2015/11/2/756 Thanks, Jacob Jacob Pan (4): ktime: add a roundup function timer: relax tick stop in idle entry sched: introduce synchronized idle injection sched: add trace event for idle injection include/linux/ktime.h | 10 ++ include/linux/sched.h | 16 ++ include/linux/sched/sysctl.h | 5 + include/trace/events/sched.h | 25 +++ init/Kconfig | 10 ++ kernel/sched/fair.c | 356 ++++++++++++++++++++++++++++++++++++++++++- kernel/sched/sched.h | 54 ++++++- kernel/sysctl.c | 21 +++ kernel/time/tick-sched.c | 2 +- 9 files changed, 493 insertions(+), 6 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Date | 2015-11-13 21:00 +0100 |
| Subject | [PATCH 1/4] ktime: add a roundup function |
| Message-ID | <qusFQ-2eI-29@gated-at.bofh.it> |
| In reply to | #1269185 |
ktime roundup function can be used to keep timer aligned and
prevent drift for recurring timeouts.
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
---
include/linux/ktime.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2b6a204..2e293fa 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -233,6 +233,16 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
+static inline ktime_t ktime_roundup(ktime_t x, ktime_t y)
+{
+ u64 temp_tv64;
+
+ temp_tv64 = x.tv64 + y.tv64 - 1;
+ temp_tv64 = div64_u64(temp_tv64, y.tv64);
+ x.tv64 = temp_tv64 * y.tv64;
+
+ return x;
+}
/**
* ktime_to_timespec_cond - convert a ktime_t variable to timespec
* format only if the variable contains data
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | John Stultz <john.stultz@linaro.org> |
|---|---|
| Date | 2015-11-13 21:20 +0100 |
| Subject | Re: [PATCH 1/4] ktime: add a roundup function |
| Message-ID | <qusZc-2Cc-15@gated-at.bofh.it> |
| In reply to | #1269187 |
On Fri, Nov 13, 2015 at 11:53 AM, Jacob Pan
<jacob.jun.pan@linux.intel.com> wrote:
> ktime roundup function can be used to keep timer aligned and
> prevent drift for recurring timeouts.
>
> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
> ---
> include/linux/ktime.h | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/include/linux/ktime.h b/include/linux/ktime.h
> index 2b6a204..2e293fa 100644
> --- a/include/linux/ktime.h
> +++ b/include/linux/ktime.h
> @@ -233,6 +233,16 @@ static inline ktime_t ktime_sub_us(const ktime_t kt, const u64 usec)
>
> extern ktime_t ktime_add_safe(const ktime_t lhs, const ktime_t rhs);
>
> +static inline ktime_t ktime_roundup(ktime_t x, ktime_t y)
> +{
> + u64 temp_tv64;
> +
> + temp_tv64 = x.tv64 + y.tv64 - 1;
> + temp_tv64 = div64_u64(temp_tv64, y.tv64);
> + x.tv64 = temp_tv64 * y.tv64;
> +
> + return x;
> +}
Could you add a comment as to what the function does, and use some
better variable names here to make it more immediately obvious what is
being done here?
Something like:
/**
* ktime_roundup - Rounds value up to interval chunk
* @ value: Value to be rounded up
* @ interval: interval size to round up to
*
* Rounds a value up to the next higher multiple of an interval size
*/
static inline ktime ktime_roundup(ktime_t value, ktime_t interval)
thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Date | 2015-11-13 23:40 +0100 |
| Subject | Re: [PATCH 1/4] ktime: add a roundup function |
| Message-ID | <quvaG-3UL-9@gated-at.bofh.it> |
| In reply to | #1269192 |
On Fri, 13 Nov 2015 12:11:01 -0800 John Stultz <john.stultz@linaro.org> wrote: > Could you add a comment as to what the function does, and use some > better variable names here to make it more immediately obvious what is > being done here? > > Something like: > /** > * ktime_roundup - Rounds value up to interval chunk > * @ value: Value to be rounded up > * @ interval: interval size to round up to > * > * Rounds a value up to the next higher multiple of an interval size > */ > static inline ktime ktime_roundup(ktime_t value, ktime_t interval) will do. thank you for taking the time. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Date | 2015-11-13 21:20 +0100 |
| Subject | Re: [PATCH 1/4] ktime: add a roundup function |
| Message-ID | <qusZc-2Cc-17@gated-at.bofh.it> |
| In reply to | #1269187 |
On Fri, 13 Nov 2015, Jacob Pan wrote: > ktime roundup function can be used to keep timer aligned and > prevent drift for recurring timeouts. That tells me a use case, but not WHAT the function does and WHY we need it. > > +static inline ktime_t ktime_roundup(ktime_t x, ktime_t y) Kerneldoc comment of this function would be appreciated. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Jacob Pan <jacob.jun.pan@linux.intel.com> |
|---|---|
| Date | 2015-11-13 23:40 +0100 |
| Subject | Re: [PATCH 1/4] ktime: add a roundup function |
| Message-ID | <quvaG-3UL-11@gated-at.bofh.it> |
| In reply to | #1269193 |
On Fri, 13 Nov 2015 15:13:45 -0500 (EST) Thomas Gleixner <tglx@linutronix.de> wrote: > > > > +static inline ktime_t ktime_roundup(ktime_t x, ktime_t y) > > Kerneldoc comment of this function would be appreciated. will do. Plan to reuse John's comment. Thanks, Jacob -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web