From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>, Oleg Nesterov <oleg@redhat.com>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: Change READ_ONCE(jiffies) into jiffies
Date: Mon, 26 Sep 2016 06:28:38 -0700 [thread overview]
Message-ID: <2c00bc36-ff69-bc46-6d63-c4ee4168fc5c@sandisk.com> (raw)
In-Reply-To: <20160926085547.GJ5012@twins.programming.kicks-ass.net>
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.
prev parent reply other threads:[~2016-09-26 13:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 2:08 Bart Van Assche
2016-09-26 8:55 ` Peter Zijlstra
2016-09-26 13:28 ` Bart Van Assche [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2c00bc36-ff69-bc46-6d63-c4ee4168fc5c@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®