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


Groups > linux.kernel > #1220167

Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH 0/6] sched/fair: Compute capacity invariant load/utilization tracking
Date 2015-09-07 15:30 +0200
Message-ID <q64EF-6NN-1@gated-at.bofh.it> (permalink)
References <pXq1H-7le-7@gated-at.bofh.it> <q3tzz-3A1-1@gated-at.bofh.it> <q641Z-5PD-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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/

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


Thread

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

csiph-web