lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2c00bc36-ff69-bc46-6d63-c4ee4168fc5c@sandisk.com>
Date:   Mon, 26 Sep 2016 06:28:38 -0700
From:   Bart Van Assche <bart.vanassche@...disk.com>
To:     Peter Zijlstra <peterz@...radead.org>
CC:     Ingo Molnar <mingo@...hat.com>, Oleg Nesterov <oleg@...hat.com>,
        linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] sched: Change READ_ONCE(jiffies) into jiffies

On 09/26/16 01:55, Peter Zijlstra wrote:
> On Sun, Sep 25, 2016 at 07:08:45PM -0700, Bart Van Assche wrote:
>> A quote from Documentation/memory_barriers.txt:
>>
>> For example, because 'jiffies' is marked volatile, it is never
>> necessary to say READ_ONCE(jiffies).  The reason for this is
>> that READ_ONCE() and WRITE_ONCE() are implemented as volatile
>> casts, which has no effect when its argument is already marked
>> volatile.
>>
>> Hence change all 'READ_ONCE(jiffies)' occurrences into 'jiffies'.
>
> So I'm not a huge fan of this patch. Yes its technically pointless, but
> it does convey intent. See the READ_ONCE() as a comment if you will.

Hello Peter,

Are you aware that the scheduler code is the only code that uses 
READ_ONCE() to read 'jiffies', and that even in the scheduler not all 
'jiffies' reads use READ_ONCE()? This patch makes the scheduler code 
more consistent and easier to read without affecting the generated code.

Bart.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ