[PATCH] RT: Only dirty a cacheline if the priority is actuallychanging

From: Gregory Haskins
Date: Wed Oct 17 2007 - 15:09:47 EST


Oops...forgot to refresh this patch before mailing it. Heres the actual
patch.


----


We can avoid dirtying a rq related cacheline with a simple check, so why not.

Signed-off-by: Gregory Haskins <ghaskins@xxxxxxxxxx>
---

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

diff --git a/kernel/sched.c b/kernel/sched.c
index 8c916de..d5dfe21 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -368,7 +368,8 @@ static DEFINE_MUTEX(sched_hotcpu_mutex);
#if defined(CONFIG_PREEMPT_RT) && defined(CONFIG_SMP)
static inline void set_rq_prio(struct rq *rq, int prio)
{
- rq->highest_prio = prio;
+ if (rq->highest_prio != prio)
+ rq->highest_prio = prio;
}

static inline void update_rq_prio(struct rq *rq)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/