Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1216122 > unrolled thread
| Started by | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| First post | 2015-08-31 11:30 +0200 |
| Last post | 2015-09-13 13:10 +0200 |
| Articles | 7 — 3 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Peter Zijlstra <peterz@infradead.org> - 2015-08-31 11:30 +0200
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Dietmar Eggemann <dietmar.eggemann@arm.com> - 2015-09-02 12:00 +0200
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Peter Zijlstra <peterz@infradead.org> - 2015-09-07 14:50 +0200
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Peter Zijlstra <peterz@infradead.org> - 2015-09-07 15:30 +0200
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Peter Zijlstra <peterz@infradead.org> - 2015-09-07 15:30 +0200
Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking Dietmar Eggemann <dietmar.eggemann@arm.com> - 2015-09-07 16:50 +0200
[tip:sched/core] sched/fair: Defer calling scaling functions tip-bot for Dietmar Eggemann <tipbot@zytor.com> - 2015-09-13 13:10 +0200
| From | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-08-31 11:30 +0200 |
| Subject | Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking |
| Message-ID | <q3tzz-3A1-1@gated-at.bofh.it> |
On Fri, Aug 14, 2015 at 05:23:08PM +0100, Morten Rasmussen wrote: > Target: ARM TC2 A7-only (x3) > Test: hackbench -g 25 --threads -l 10000 > > Before After > 315.545 313.408 -0.68% > > Target: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz > Test: hackbench -g 25 --threads -l 1000 (avg of 10) > > Before After > 6.4643 6.395 -1.07% > A quick run here gives: IVB-EP (2*20*2): perf stat --null --repeat 10 -- perf bench sched messaging -g 50 -l 5000 Before: After: 5.484170711 ( +- 0.74% ) 5.590001145 ( +- 0.45% ) Which is an almost 2% slowdown :/ I've yet to look at what happens. -- 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 | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| Date | 2015-09-02 12:00 +0200 |
| Message-ID | <q4cZI-1tV-29@gated-at.bofh.it> |
| In reply to | #1216122 |
On 08/31/2015 11:24 AM, Peter Zijlstra wrote: > On Fri, Aug 14, 2015 at 05:23:08PM +0100, Morten Rasmussen wrote: >> Target: ARM TC2 A7-only (x3) >> Test: hackbench -g 25 --threads -l 10000 >> >> Before After >> 315.545 313.408 -0.68% >> >> Target: Intel(R) Core(TM) i5 CPU M 520 @ 2.40GHz >> Test: hackbench -g 25 --threads -l 1000 (avg of 10) >> >> Before After >> 6.4643 6.395 -1.07% >> > > A quick run here gives: > > IVB-EP (2*20*2): > > perf stat --null --repeat 10 -- perf bench sched messaging -g 50 -l 5000 > > Before: After: > 5.484170711 ( +- 0.74% ) 5.590001145 ( +- 0.45% ) > > Which is an almost 2% slowdown :/ > > I've yet to look at what happens. > I tested the patch-set on top of tip: ff277d4250fe - sched/deadline: Fix comment in enqueue_task_dl() on a 2 cluster IVB-EP (2 clusters * 10 cores * 2 HW threads) = 40 logical cpus w/ (SMT, MC, NUMA sd's). model name : Intel(R) Xeon(R) CPU E5-2690 v2 @ 3.00GHz perf stat --null --repeat 10 -- perf bench sched messaging -g 50 -l 5000 Before: After: 5.049361160 ( +- 1.26% ) 5.014980654 ( +- 1.20% ) Even by running this test multiple times I never saw something like a 2% slowdown. It's a vanilla ubuntu 15.04 system which might explain the slightly higher stddev. We could optimize the changes we did in __update_load_avg() by only calculating the additional scaled values [scaled_delta_w, contrib, scaled_delta] in case the function is called w/ 'weight !=0 && running !=0'. This is also true for the initialization of scale_freq and scale_cpu. -- 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 | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-09-07 14:50 +0200 |
| Message-ID | <q641Z-5PD-25@gated-at.bofh.it> |
| In reply to | #1216122 |
On Mon, Aug 31, 2015 at 11:24:49AM +0200, Peter Zijlstra wrote: > A quick run here gives: > > IVB-EP (2*20*2): As noted by someone; that should be 2*10*2, for a total of 40 cpus in this machine. > > perf stat --null --repeat 10 -- perf bench sched messaging -g 50 -l 5000 > > Before: After: > 5.484170711 ( +- 0.74% ) 5.590001145 ( +- 0.45% ) > > Which is an almost 2% slowdown :/ > > I've yet to look at what happens. OK, so it appears this is link order nonsense. When I compared profiles between the series, the one function that had significant change was skb_release_data(), which doesn't make much sense. If I do a 'make clean' in front of each build, I get a repeatable improvement with this patch set (although how much of that is due to the patches itself or just because of code movement is as yet undetermined). I'm of a mind to apply these patches; with two patches on top, which I'll post shortly. -- 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 | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-09-07 15:30 +0200 |
| Message-ID | <q64EF-6NN-1@gated-at.bofh.it> |
| In reply to | #1220152 |
On Mon, Sep 07, 2015 at 02:42:20PM +0200, Peter Zijlstra wrote:
> I'm of a mind to apply these patches; with two patches on top, which
> I'll post shortly.
---
Subject: sched: Optimize __update_load_avg()
From: Peter Zijlstra <peterz@infradead.org>
Date: Mon Sep 7 15:09:15 CEST 2015
Prior to this patch; the line:
scaled_delta_w = (delta_w * 1024) >> 10;
which is the result of the default arch_scale_freq_capacity()
function, turns into:
1b03: 49 89 d1 mov %rdx,%r9
1b06: 49 c1 e1 0a shl $0xa,%r9
1b0a: 49 c1 e9 0a shr $0xa,%r9
Which is silly; when made unsigned int, GCC recognises this as
pointless ops and fails to emit them (confirmed on 4.9.3 and 5.1.1).
Furthermore, afaict unsigned is actually the correct type for these
fields anyway, as we've explicitly ruled out negative delta's earlier
in this function.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2551,7 +2551,7 @@ __update_load_avg(u64 now, int cpu, stru
{
u64 delta, scaled_delta, periods;
u32 contrib;
- int delta_w, scaled_delta_w, decayed = 0;
+ unsigned int delta_w, scaled_delta_w, decayed = 0;
unsigned long scale_freq = arch_scale_freq_capacity(NULL, cpu);
unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
--
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 | Peter Zijlstra <peterz@infradead.org> |
|---|---|
| Date | 2015-09-07 15:30 +0200 |
| Message-ID | <q64EG-6NN-13@gated-at.bofh.it> |
| In reply to | #1220152 |
On Mon, Sep 07, 2015 at 02:42:20PM +0200, Peter Zijlstra wrote:
> I'm of a mind to apply these patches; with two patches on top, which
> I'll post shortly.
---
Subject: sched: Rename scale()
From: Peter Zijlstra <peterz@infradead.org>
Date: Mon Sep 7 15:05:42 CEST 2015
Rename scale() to cap_scale() to better reflect its purpose, it is
after all not a general purpose scale function, it has
SCHED_CAPACITY_SHIFT hardcoded in it.
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
kernel/sched/fair.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2515,7 +2515,7 @@ static u32 __compute_runnable_contrib(u6
return contrib + runnable_avg_yN_sum[n];
}
-#define scale(v, s) ((v)*(s) >> SCHED_CAPACITY_SHIFT)
+#define cap_scale(v, s) ((v)*(s) >> SCHED_CAPACITY_SHIFT)
/*
* We can represent the historical contribution to runnable average as the
@@ -2588,7 +2588,7 @@ __update_load_avg(u64 now, int cpu, stru
* period and accrue it.
*/
delta_w = 1024 - delta_w;
- scaled_delta_w = scale(delta_w, scale_freq);
+ scaled_delta_w = cap_scale(delta_w, scale_freq);
if (weight) {
sa->load_sum += weight * scaled_delta_w;
if (cfs_rq) {
@@ -2597,7 +2597,7 @@ __update_load_avg(u64 now, int cpu, stru
}
}
if (running)
- sa->util_sum += scale(scaled_delta_w, scale_cpu);
+ sa->util_sum += cap_scale(scaled_delta_w, scale_cpu);
delta -= delta_w;
@@ -2614,25 +2614,25 @@ __update_load_avg(u64 now, int cpu, stru
/* Efficiently calculate \sum (1..n_period) 1024*y^i */
contrib = __compute_runnable_contrib(periods);
- contrib = scale(contrib, scale_freq);
+ contrib = cap_scale(contrib, scale_freq);
if (weight) {
sa->load_sum += weight * contrib;
if (cfs_rq)
cfs_rq->runnable_load_sum += weight * contrib;
}
if (running)
- sa->util_sum += scale(contrib, scale_cpu);
+ sa->util_sum += cap_scale(contrib, scale_cpu);
}
/* Remainder of delta accrued against u_0` */
- scaled_delta = scale(delta, scale_freq);
+ scaled_delta = cap_scale(delta, scale_freq);
if (weight) {
sa->load_sum += weight * scaled_delta;
if (cfs_rq)
cfs_rq->runnable_load_sum += weight * scaled_delta;
}
if (running)
- sa->util_sum += scale(scaled_delta, scale_cpu);
+ sa->util_sum += cap_scale(scaled_delta, scale_cpu);
sa->period_contrib += delta;
--
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 | Dietmar Eggemann <dietmar.eggemann@arm.com> |
|---|---|
| Date | 2015-09-07 16:50 +0200 |
| Message-ID | <q65U5-8vL-11@gated-at.bofh.it> |
| In reply to | #1220152 |
On 07/09/15 13:42, Peter Zijlstra wrote:
> On Mon, Aug 31, 2015 at 11:24:49AM +0200, Peter Zijlstra wrote:
>
>> A quick run here gives:
>>
>> IVB-EP (2*20*2):
>
> As noted by someone; that should be 2*10*2, for a total of 40 cpus in
> this machine.
>
>>
>> perf stat --null --repeat 10 -- perf bench sched messaging -g 50 -l 5000
>>
>> Before: After:
>> 5.484170711 ( +- 0.74% ) 5.590001145 ( +- 0.45% )
>>
>> Which is an almost 2% slowdown :/
>>
>> I've yet to look at what happens.
>
> OK, so it appears this is link order nonsense. When I compared profiles
> between the series, the one function that had significant change was
> skb_release_data(), which doesn't make much sense.
>
> If I do a 'make clean' in front of each build, I get a repeatable
> improvement with this patch set (although how much of that is due to the
> patches itself or just because of code movement is as yet undetermined).
>
> I'm of a mind to apply these patches; with two patches on top, which
> I'll post shortly.
>
-- >8 --
From: Dietmar Eggemann <dietmar.eggemann@arm.com>
Date: Mon, 7 Sep 2015 14:57:22 +0100
Subject: [PATCH] sched/fair: Defer calling scaling functions
Do not call the scaling functions in case time goes backwards or the
last update of the sched_avg structure has happened less than 1024ns
ago.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
---
kernel/sched/fair.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index d6ca8d987a63..3445d2fb38f4 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2552,8 +2552,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
u64 delta, scaled_delta, periods;
u32 contrib;
unsigned int delta_w, scaled_delta_w, decayed = 0;
- unsigned long scale_freq = arch_scale_freq_capacity(NULL, cpu);
- unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+ unsigned long scale_freq, scale_cpu;
delta = now - sa->last_update_time;
/*
@@ -2574,6 +2573,9 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
return 0;
sa->last_update_time = now;
+ scale_freq = arch_scale_freq_capacity(NULL, cpu);
+ scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+
/* delta_w is the amount already accumulated against our next period */
delta_w = sa->period_contrib;
if (delta + delta_w >= 1024) {
--
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 | tip-bot for Dietmar Eggemann <tipbot@zytor.com> |
|---|---|
| Date | 2015-09-13 13:10 +0200 |
| Subject | [tip:sched/core] sched/fair: Defer calling scaling functions |
| Message-ID | <q8dku-5Qt-25@gated-at.bofh.it> |
| In reply to | #1220248 |
Commit-ID: 6f2b04524f0b38bfbb8413f98d2d6af234508309
Gitweb: http://git.kernel.org/tip/6f2b04524f0b38bfbb8413f98d2d6af234508309
Author: Dietmar Eggemann <dietmar.eggemann@arm.com>
AuthorDate: Mon, 7 Sep 2015 14:57:22 +0100
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 13 Sep 2015 09:53:01 +0200
sched/fair: Defer calling scaling functions
Do not call the scaling functions in case time goes backwards or the
last update of the sched_avg structure has happened less than 1024ns
ago.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Juri Lelli <Juri.Lelli@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: daniel.lezcano@linaro.org <daniel.lezcano@linaro.org>
Cc: mturquette@baylibre.com <mturquette@baylibre.com>
Cc: pang.xunlei@zte.com.cn <pang.xunlei@zte.com.cn>
Cc: rjw@rjwysocki.net <rjw@rjwysocki.net>
Cc: sgurrappadi@nvidia.com <sgurrappadi@nvidia.com>
Cc: vincent.guittot@linaro.org <vincent.guittot@linaro.org>
Cc: yuyang.du@intel.com <yuyang.du@intel.com>
Link: http://lkml.kernel.org/r/55EDA2E9.8040900@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
kernel/sched/fair.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index c3c5585..fc835fa 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -2552,8 +2552,7 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
u64 delta, scaled_delta, periods;
u32 contrib;
unsigned int delta_w, scaled_delta_w, decayed = 0;
- unsigned long scale_freq = arch_scale_freq_capacity(NULL, cpu);
- unsigned long scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+ unsigned long scale_freq, scale_cpu;
delta = now - sa->last_update_time;
/*
@@ -2574,6 +2573,9 @@ __update_load_avg(u64 now, int cpu, struct sched_avg *sa,
return 0;
sa->last_update_time = now;
+ scale_freq = arch_scale_freq_capacity(NULL, cpu);
+ scale_cpu = arch_scale_cpu_capacity(NULL, cpu);
+
/* delta_w is the amount already accumulated against our next period */
delta_w = sa->period_contrib;
if (delta + delta_w >= 1024) {
--
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