[PATCH] sched: Remove ACCESS_ONCE() for jiffies

Pranith Kumar
2014-08-11T22:51:22Z

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