Re: [Announce] [patch] Modular Scheduler Core and Completely Fair Scheduler [CFS]

From: Ingo Molnar
Date: Fri Apr 13 2007 - 19:26:28 EST



* Gabriel C <nix.or.die@xxxxxxxxxxxxxx> wrote:

> > as usual, any sort of feedback, bugreports, fixes and suggestions
> > are more than welcome,
>
> Compile error here.

ah, !CONFIG_SMP. Does the patch below do the trick for you? (I've also
updated the full patch at the cfs-scheduler URL)

Ingo

----------------------->
From: Ingo Molnar <mingo@xxxxxxx>
Subject: [cfs] fix !CONFIG_SMP build

fix the !CONFIG_SMP build error reported by Gabriel C

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

Index: linux/kernel/sched.c
===================================================================
--- linux.orig/kernel/sched.c
+++ linux/kernel/sched.c
@@ -257,16 +257,6 @@ static inline unsigned long long __rq_cl
return rq->rq_clock;
}

-static inline unsigned long long rq_clock(struct rq *rq)
-{
- int this_cpu = smp_processor_id();
-
- if (this_cpu == rq->cpu)
- return __rq_clock(rq);
-
- return rq->rq_clock;
-}
-
static inline int cpu_of(struct rq *rq)
{
#ifdef CONFIG_SMP
@@ -276,6 +266,16 @@ static inline int cpu_of(struct rq *rq)
#endif
}

+static inline unsigned long long rq_clock(struct rq *rq)
+{
+ int this_cpu = smp_processor_id();
+
+ if (this_cpu == cpu_of(rq))
+ return __rq_clock(rq);
+
+ return rq->rq_clock;
+}
+
/*
* The domain tree (rq->sd) is protected by RCU's quiescent state transition.
* See detach_destroy_domains: synchronize_sched for details.
-
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/