Re: 2.6.21-rc2-mm1: what about CONFIG_NO_HZ and !CONFIG_SMP ?

Laurent Riffard
2007-03-02T21:12:30Z

Le 02.03.2007 12:00, Andrew Morton a écrit :
> Temporarily at
>
> http://userweb.kernel.org/~akpm/2.6.21-rc2-mm1/
>
> Will appear later at
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21-rc2/2.6.21-rc2-mm1/

Got this when CONFIG_NO_HZ=y and CONFIG_SMP=n:

CC kernel/sched.o
kernel/sched.c: In function 'trigger_load_balance':
kernel/sched.c:3384: error: 'struct rq' has no member named 'in_nohz_recently'
kernel/sched.c:3384: error: 'struct rq' has no member named 'idle_at_tick'
kernel/sched.c:3385: error: 'struct rq' has no member named 'in_nohz_recently'
kernel/sched.c:3387: error: 'nohz' undeclared (first use in this function)
kernel/sched.c:3387: error: (Each undeclared identifier is reported only once
kernel/sched.c:3387: error: for each function it appears in.)
kernel/sched.c:3404: warning: implicit declaration of function 'resched_cpu'
kernel/sched.c:3412: error: 'struct rq' has no member named 'idle_at_tick'
kernel/sched.c:3422: error: 'struct rq' has no member named 'idle_at_tick'
make[1]: *** [kernel/sched.o] Error 1
make: *** [kernel] Error 2

Looking at kernel/sched.c, it seems CONFIG_NO_HZ should depend on CONFIG_SMP...

238 struct rq {
239 spinlock_t lock;
240
241 /*
242 * nr_running and cpu_load should be in the same cacheline because
243 * remote CPUs use both these fields when doing load calculation.
244 */
245 unsigned long nr_running;
246 unsigned long raw_weighted_load;
247 #ifdef CONFIG_SMP
248 unsigned long cpu_load[3];
249 unsigned char idle_at_tick;
250 #ifdef CONFIG_NO_HZ
251 unsigned char in_nohz_recently;
252 #endif
253 #endif
254 unsigned long long nr_switches;

~~
laurent