lkml.org 
[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:sched/core] sched: Hide runqueues from direct reference at source code level for __raw_get_cpu_var()
Commit-ID:  54d35f29f49224d86b994acb6e5969b9ba09022d
Gitweb: http://git.kernel.org/tip/54d35f29f49224d86b994acb6e5969b9ba09022d
Author: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
AuthorDate: Mon, 29 Jun 2009 14:44:57 +0900
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 29 Jun 2009 09:19:27 +0200

sched: Hide runqueues from direct reference at source code level for __raw_get_cpu_var()

Hide __raw_get_cpu_var() as well - thus all the direct
references to runqueues will abstracted out.

Signed-off-by: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
LKML-Reference: <20090629.144457.886429910353660979.mitake@dcl.info.waseda.ac.jp>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
kernel/sched.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 168b268..ebc5151 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -692,6 +692,7 @@ static inline int cpu_of(struct rq *rq)
#define this_rq() (&__get_cpu_var(runqueues))
#define task_rq(p) cpu_rq(task_cpu(p))
#define cpu_curr(cpu) (cpu_rq(cpu)->curr)
+#define raw_rq() (&__raw_get_cpu_var(runqueues))

inline void update_rq_clock(struct rq *rq)
{
@@ -6669,7 +6670,7 @@ EXPORT_SYMBOL(yield);
*/
void __sched io_schedule(void)
{
- struct rq *rq = &__raw_get_cpu_var(runqueues);
+ struct rq *rq = raw_rq();

delayacct_blkio_start();
atomic_inc(&rq->nr_iowait);
@@ -6681,7 +6682,7 @@ EXPORT_SYMBOL(io_schedule);

long __sched io_schedule_timeout(long timeout)
{
- struct rq *rq = &__raw_get_cpu_var(runqueues);
+ struct rq *rq = raw_rq();
long ret;

delayacct_blkio_start();

\
 
 \ /
  Last update: 2009-06-29 09:27    [W:0.036 / U:2.436 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site