[lkml]   [2009]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] sched: Hide runqueues from direct refer at source code level for __raw_get_cpu_var()


My previous patch (Commit-ID of tip tree d11ad9b3631b942b0d2e5b754a6c62158efb799f) hides
direct refers at source code level into macros.
This will hide the rest part, __raw_get_cpu_var().
After appling this, all of the direct refer to runqueues will be in macros in the close place.

Signed-off-by: Hitoshi Mitake <>

diff --git a/kernel/sched.c b/kernel/sched.c
index 7c9098d..d1d3599 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)
@@ -6631,7 +6632,7 @@ EXPORT_SYMBOL(yield);
void __sched io_schedule(void)
- struct rq *rq = &__raw_get_cpu_var(runqueues);
+ struct rq *rq = raw_rq();

@@ -6643,7 +6644,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;


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