mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pranith Kumar <bobby.prani@gmail.com>
To: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org (open list:SCHEDULER)
Subject: [PATCH] sched: Remove ACCESS_ONCE() for jiffies
Date: Mon, 11 Aug 2014 18:51:41 -0400	[thread overview]
Message-ID: <1407797503-24727-3-git-send-email-bobby.prani@gmail.com> (raw)
In-Reply-To: <1407797503-24727-1-git-send-email-bobby.prani@gmail.com>

jiffies is declared as a volatile variable. Therefore it is not neccessary to
use ACCESS_ONCE() while reading it.

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
---
 kernel/sched/core.c | 2 +-
 kernel/sched/proc.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ec1a286..381d0d0 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2552,7 +2552,7 @@ void scheduler_tick(void)
 u64 scheduler_tick_max_deferment(void)
 {
 	struct rq *rq = this_rq();
-	unsigned long next, now = ACCESS_ONCE(jiffies);
+	unsigned long next, now = jiffies;
 
 	next = rq->last_sched_tick + HZ;
 
diff --git a/kernel/sched/proc.c b/kernel/sched/proc.c
index 8ecd552..87ab31b 100644
--- a/kernel/sched/proc.c
+++ b/kernel/sched/proc.c
@@ -526,7 +526,7 @@ static inline unsigned long get_rq_runnable_load(struct rq *rq)
  */
 void update_idle_cpu_load(struct rq *this_rq)
 {
-	unsigned long curr_jiffies = ACCESS_ONCE(jiffies);
+	unsigned long curr_jiffies = jiffies;
 	unsigned long load = get_rq_runnable_load(this_rq);
 	unsigned long pending_updates;
 
@@ -548,7 +548,7 @@ void update_idle_cpu_load(struct rq *this_rq)
 void update_cpu_load_nohz(void)
 {
 	struct rq *this_rq = this_rq();
-	unsigned long curr_jiffies = ACCESS_ONCE(jiffies);
+	unsigned long curr_jiffies = jiffies;
 	unsigned long pending_updates;
 
 	if (curr_jiffies == this_rq->last_load_update_tick)
-- 
1.9.1


  parent reply	other threads:[~2014-08-11 22:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-11 22:51 [PATCH] doc: memory-barriers.txt: Minor correction in Control dependencies Pranith Kumar
2014-08-11 22:51 ` [PATCH] doc: memory-barriers.txt: Add barrier() to provide ordering Pranith Kumar
2014-08-13 22:50   ` Paul E. McKenney
2014-08-11 22:51 ` Pranith Kumar [this message]
2014-08-12  5:55   ` [PATCH] sched: Remove ACCESS_ONCE() for jiffies Peter Zijlstra
2014-08-12 14:42     ` Pranith Kumar
2014-08-12 22:11       ` David Rientjes
2014-08-11 22:51 ` [PATCH] compiler.h: Move __memory_barrier() use to compiler-intel.h Pranith Kumar
2014-08-13 22:49 ` [PATCH] doc: memory-barriers.txt: Minor correction in Control dependencies Paul E. McKenney

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=1407797503-24727-3-git-send-email-bobby.prani@gmail.com \
    --to=bobby.prani@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@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®