[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200330133508.GN20696@hirez.programming.kicks-ass.net>
Date: Mon, 30 Mar 2020 15:35:08 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Valentin Schneider <valentin.schneider@....com>
Cc: linux-kernel@...r.kernel.org, mingo@...nel.org,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
riel@...riel.com
Subject: Re: [PATCH] sched: Align rq->avg_idle and rq->avg_scan_cost
On Mon, Mar 30, 2020 at 10:01:27AM +0100, Valentin Schneider wrote:
>
> """
> The result of E1 >> E2 is E1 right-shifted E2 bit positions. [...] If E1
> has a signed type and a negative value, the resulting value is
> implementation-defined.
True; but the kernel uses -fwrapv, which would mandate 2s complement,
which then gets us to the next point:
> """
>
> Not only this, but (arithmetic) right shifting a negative value (using 2's
> complement) is *not* equivalent to dividing it by the corresponding power
> of 2.
True; good catch.
Powered by blists - more mailing lists