lkml.org 
[lkml]   [2020]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2020-03-30 15:35    [W:0.032 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site