Skip to contentSkip to conversation

v2.6.21.4-rt11

DISCUSSION Ingo Molnar 8 participants 23 messages Jun 9, 2007 – Jun 19, 2007 High-resolution timers, timer wheel, clockevents

lore
Share & tools
lore
#0 lore raw

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

http://people.redhat.com/mingo/realtime-preempt/

more info about the -rt patchset can be found in the RT wiki:

http://rt.wiki.kernel.org

-rt11 is a bit more experimental than usual: it includes the CFS scheduler. Several people have suggested the inclusion of CFS into the -rt tree: the determinism of the CFS scheduler is a nice match to the determinism offered by PREEMPT_RT. The port of CFS to -rt was done by Dinakar Guniguntala. Tested on i686 and x86_64.

to build a 2.6.21.4-rt11 tree, the following patches should be applied:

    http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.4.tar.bz2
    http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt11
  
	Ingo
#1 lore raw
Quoted 17 lines · Ingo Molnar <mingo <at> elte.hu> writes:

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

http://people.redhat.com/mingo/realtime-preempt/

more info about the -rt patchset can be found in the RT wiki:

http://rt.wiki.kernel.org

-rt11 is a bit more experimental than usual: it includes the CFS scheduler. Several people have suggested the inclusion of CFS into the -rt tree: the determinism of the CFS scheduler is a nice match to the determinism offered by PREEMPT_RT. The port of CFS to -rt was done by Dinakar Guniguntala. Tested on i686 and x86_64.

Quoted 7 lines

to build a 2.6.21.4-rt11 tree, the following patches should be applied:

    http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.4.tar.bz2
    http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt11

	Ingo

I've tried to compile it, but i've got the following:

  GEN     .version
  CHK     include/linux/compile.h
  UPD     include/linux/compile.h
  CC      init/version.o
  LD      init/built-in.o
  LD      .tmp_vmlinux1

kernel/built-in.o: In function `__schedule':
(.sched.text+0xe0): undefined reference to `pick_next_task' make[1]: *** [.tmp_vmlinux1] Ошибка 1
make[1]: Leaving directory `/usr/src/linux-2.6.21.4-rt11-cfs17-arsenic'
make: *** [debian/stamp-build-kernel] Ошибка 2

It seems that patch is broken.

#2 lore raw
Quoted 9 lines · Oleksandr Natalenko
Quoted 2 lines
    http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.4.tar.bz2
    http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt11

kernel/built-in.o: In function `__schedule':
(.sched.text+0xe0): undefined reference to `pick_next_task' make[1]: *** [.tmp_vmlinux1] Ошибка 1
make[1]: Leaving directory `/usr/src/linux-2.6.21.4-rt11-cfs17-arsenic'
make: *** [debian/stamp-build-kernel] Ошибка 2

It seems that patch is broken.

Yup, for CONFIG_SMP=n and for CONFIG_PREEMPT_RT=n.

Fix below

tglx

kernel/sched.c +19 -19
Index: linux-2.6.21/kernel/sched.c
===================================================================
@@ -827,6 +827,25 @@ unsigned long weighted_cpuload(const int
 	return cpu_rq(cpu)->raw_weighted_load;
 }
 
+static inline struct task_struct *
+pick_next_task(struct rq *rq, struct task_struct *prev)
+{
+	struct sched_class *class = sched_class_highest;
+	u64 now = __rq_clock(rq);
+	struct task_struct *p;
+
+	prev->sched_class->put_prev_task(rq, prev, now);
+
+	do {
+		p = class->pick_next_task(rq, now);
+		if (p)
+			return p;
+		class = class->next;
+	} while (class);
+
+	return NULL;
+}
+
 #ifdef CONFIG_SMP
 
 static inline void __set_task_cpu(struct task_struct *p, unsigned int cpu)
@@ -1093,25 +1112,6 @@ next_in_queue:
 
 static int double_lock_balance(struct rq *this_rq, struct rq *busiest);
 
-static inline struct task_struct *
-pick_next_task(struct rq *rq, struct task_struct *prev)
-{
-	struct sched_class *class = sched_class_highest;
-	u64 now = __rq_clock(rq);
-	struct task_struct *p;
-
-	prev->sched_class->put_prev_task(rq, prev, now);
-
-	do {
-		p = class->pick_next_task(rq, now);
-		if (p)
-			return p;
-		class = class->next;
-	} while (class);
-
-	return NULL;
-}
-
 /*
  * Pull RT tasks from other CPUs in the RT-overload
  * case. Interrupts are disabled, local rq is locked.
kernel/time/clockevents.c +1 -0
Index: linux-2.6.21/kernel/time/clockevents.c
===================================================================
@@ -18,6 +18,7 @@
 #include <linux/notifier.h>
 #include <linux/smp.h>
 #include <linux/sysdev.h>
+#include <linux/sched.h>
 
 /* The registered clock event devices */
 static LIST_HEAD(clockevent_devices);
#3 lore raw
In reply to Ingo Molnar
Quoted 16 lines · Ingo Molnar

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

http://people.redhat.com/mingo/realtime-preempt/

more info about the -rt patchset can be found in the RT wiki:

http://rt.wiki.kernel.org

-rt11 is a bit more experimental than usual: it includes the CFS scheduler. Several people have suggested the inclusion of CFS into the -rt tree: the determinism of the CFS scheduler is a nice match to the determinism offered by PREEMPT_RT. The port of CFS to -rt was done by Dinakar Guniguntala. Tested on i686 and x86_64.

Quoted 4 lines

to build a 2.6.21.4-rt11 tree, the following patches should be applied:

    http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.4.tar.bz2
    http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt11

2.6.21.4-rt12 boots on 4-CPU Opteron and passes several hours of rcutorture. However, if I simply do "modprobe rcutorture", the kernel threads do not spread across the CPUs as I would expect them to, even given CFS. Instead, the readers all stack up on a single CPU, and I have to use the "taskset" command to spread them out manually. Is there some config parameter I am missing out on?

Thanx, Paul

#4 lore raw
Quoted 6 lines · Paul E. McKenney

2.6.21.4-rt12 boots on 4-CPU Opteron and passes several hours of rcutorture. However, if I simply do "modprobe rcutorture", the kernel threads do not spread across the CPUs as I would expect them to, even given CFS. Instead, the readers all stack up on a single CPU, and I have to use the "taskset" command to spread them out manually. Is there some config parameter I am missing out on?

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

Ingo

#5 lore raw
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Paul E. McKenney

2.6.21.4-rt12 boots on 4-CPU Opteron and passes several hours of rcutorture. However, if I simply do "modprobe rcutorture", the kernel threads do not spread across the CPUs as I would expect them to, even given CFS. Instead, the readers all stack up on a single CPU, and I have to use the "taskset" command to spread them out manually. Is there some config parameter I am missing out on?

Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

Since there are eight readers, I use the following commands:

taskset -p 3 pid1
taskset -p 3 pid2
taskset -p 6 pid3
taskset -p 6 pid4
taskset -p c pid5
taskset -p c pid6
taskset -p 9 pid7
taskset -p 9 pid8

where the "pidn" are all replaced by the pids of the torture readers.

Before I do this, the processes are all sharing a single CPU. After I do this, they are spread reasonably nicely over the CPUs. I do need to allow some migration in order to fully test the realtime RCU variants in the various preemption scenarios.

Thanx, Paul

#6 lore raw
Quoted 6 lines · Paul E. McKenney
Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

ugh. Would be nice to figure out why this happens. I enabled rcutorture on a dual-core CPU and all the threads are spread evenly.

Ingo

#7 lore raw
Quoted 6 lines · Ingo Molnar
Quoted 3 lines · Paul E. McKenney
Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

Quoted 6 lines
Quoted 3 lines

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

ugh. Would be nice to figure out why this happens. I enabled rcutorture on a dual-core CPU and all the threads are spread evenly.

Here is the /proc/cpuinfo in case this helps. I am starting up a test on a dual-core CPU to see if that works better.

Thanx, Paul

processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 844
stepping : 8
cpu MHz : 1793.105
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips : 3522.56

processor : 1
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 844
stepping : 8
cpu MHz : 1793.105
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips : 3579.90

processor : 2
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 844
stepping : 8
cpu MHz : 1793.105
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips : 3579.90

processor : 3
vendor_id : AuthenticAMD
cpu family : 15
model : 5
model name : AMD Opteron(tm) Processor 844
stepping : 8
cpu MHz : 1793.105
cache size : 1024 KB
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 1
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall mmxext lm 3dnowext 3dnow
bogomips : 3579.90

#8 lore raw
Quoted 11 lines · Paul E. McKenney
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Paul E. McKenney
Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

Quoted 5 lines
Quoted 2 lines

ugh. Would be nice to figure out why this happens. I enabled rcutorture on a dual-core CPU and all the threads are spread evenly.

Here is the /proc/cpuinfo in case this helps. I am starting up a test on a dual-core CPU to see if that works better.

And this quickly load-balanced to put a pair of readers on each CPU. Later, it moved one of the readers so that it is now running with one reader on one of the CPUs, and the remaining three readers on the other CPU.

Argh... this is with 2.6.21-rt1... Need to reboot with 2.6.21.4-rt12...

Thanx, Paul

#9 lore raw
Quoted 18 lines · Paul E. McKenney
Quoted 11 lines · Paul E. McKenney
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Paul E. McKenney
Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

Quoted 5 lines
Quoted 2 lines

ugh. Would be nice to figure out why this happens. I enabled rcutorture on a dual-core CPU and all the threads are spread evenly.

Here is the /proc/cpuinfo in case this helps. I am starting up a test on a dual-core CPU to see if that works better.

Quoted 6 lines

And this quickly load-balanced to put a pair of readers on each CPU. Later, it moved one of the readers so that it is now running with one reader on one of the CPUs, and the remaining three readers on the other CPU.

Argh... this is with 2.6.21-rt1... Need to reboot with 2.6.21.4-rt12...

OK, here are a couple of snapshots from "top" on a two-way system. It seems to cycle back and forth between these two states.

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
20126 root      39  19     0    0    0 R   47  0.0  11:38.62 rcu_torture_rea    
20129 root      39  19     0    0    0 R   47  0.0  13:28.06 rcu_torture_rea    
20127 root      39  19     0    0    0 R   43  0.0  12:39.83 rcu_torture_rea    
20128 root      39  19     0    0    0 R   43  0.0  11:50.58 rcu_torture_rea    
20121 root      39  19     0    0    0 R   10  0.0   2:59.69 rcu_torture_wri    
20123 root      39  19     0    0    0 D    2  0.0   0:28.52 rcu_torture_fak    
20125 root      39  19     0    0    0 D    2  0.0   0:28.47 rcu_torture_fak    
20122 root      39  19     0    0    0 D    1  0.0   0:28.38 rcu_torture_fak    
20124 root      39  19     0    0    0 D    1  0.0   0:28.41 rcu_torture_fak    
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
20129 root      39  19     0    0    0 R   80  0.0  14:46.56 rcu_torture_rea    
20126 root      39  19     0    0    0 R   33  0.0  12:52.70 rcu_torture_rea    
20128 root      39  19     0    0    0 R   33  0.0  13:01.50 rcu_torture_rea    
20127 root      39  19     0    0    0 R   33  0.0  13:49.68 rcu_torture_rea    
20121 root      39  19     0    0    0 R   13  0.0   3:16.82 rcu_torture_wri    
20122 root      39  19     0    0    0 R    2  0.0   0:31.16 rcu_torture_fak    
20123 root      39  19     0    0    0 R    2  0.0   0:31.25 rcu_torture_fak    
20124 root      39  19     0    0    0 D    2  0.0   0:31.23 rcu_torture_fak    
20125 root      39  19     0    0    0 R    2  0.0   0:31.25 rcu_torture_fak    
12907 root      20   0 12576 1068  796 R    1  0.0   0:08.55 top                

The "preferred" state is the first one. But given that the readers will consume all CPU available to them, the scheduler might not be able to tell the difference.

Perhaps the fakewriters are confusing the scheduler, will try again on a 4-CPU machine leaving them out.

Thanx, Paul

#10 lore raw
Quoted 24 lines · Paul E. McKenney
Quoted 23 lines · Paul E. McKenney
Quoted 11 lines · Paul E. McKenney
Quoted 10 lines · Ingo Molnar
Quoted 6 lines · Paul E. McKenney
Quoted 2 lines

hm, what affinity do they start out with? Could they all be pinned to CPU#0 by default?

They start off with affinity masks of 0xf on a 4-CPU system. I would expect them to load-balance across the four CPUs, but they stay all on the same CPU until long after I lose patience (many minutes).

Quoted 5 lines
Quoted 2 lines

ugh. Would be nice to figure out why this happens. I enabled rcutorture on a dual-core CPU and all the threads are spread evenly.

Here is the /proc/cpuinfo in case this helps. I am starting up a test on a dual-core CPU to see if that works better.

And this quickly load-balanced to put a pair of readers on each CPU. Later, it moved one of the readers so that it is now running with one reader on one of the CPUs, and the remaining three readers on the other CPU.

Quoted 4 lines
Quoted 1 line

Argh... this is with 2.6.21-rt1... Need to reboot with 2.6.21.4-rt12...

OK, here are a couple of snapshots from "top" on a two-way system. It seems to cycle back and forth between these two states.

And on the 4-CPU box:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
 3112 root      39  19     0    0    0 R 11.6  0.0   0:44.34 rcu_torture_rea   
 3114 root      39  19     0    0    0 R 11.6  0.0   0:44.34 rcu_torture_rea   
 3115 root      39  19     0    0    0 R 11.6  0.0   0:44.34 rcu_torture_rea   
 3116 root      39  19     0    0    0 R 11.6  0.0   0:44.34 rcu_torture_rea   
 3109 root      39  19     0    0    0 R 11.3  0.0   0:44.33 rcu_torture_rea   
 3110 root      39  19     0    0    0 R 11.3  0.0   0:44.33 rcu_torture_rea   
 3111 root      39  19     0    0    0 R 11.3  0.0   0:44.34 rcu_torture_rea   
 3113 root      39  19     0    0    0 R 11.3  0.0   0:44.34 rcu_torture_rea   
 3108 root      39  19     0    0    0 D  6.0  0.0   0:24.35 rcu_torture_wri   

All are on CPU zero:

elm3b6:~# cat /proc/3109/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3110/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3111/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3112/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3113/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3114/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3115/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3116/stat | awk '{print $(NF-3)}'
0
elm3b6:~# cat /proc/3108/stat | awk '{print $(NF-3)}'
0

All have their affinity masks at f (allowing them to run on all CPUs):

elm3b6:~# taskset -p 3109
pid 3109's current affinity mask: f
elm3b6:~# taskset -p 3110
pid 3110's current affinity mask: f
elm3b6:~# taskset -p 3111
pid 3111's current affinity mask: f
elm3b6:~# taskset -p 3112
pid 3112's current affinity mask: f
elm3b6:~# taskset -p 3113
pid 3113's current affinity mask: f
elm3b6:~# taskset -p 3114
pid 3114's current affinity mask: f
elm3b6:~# taskset -p 3115
pid 3115's current affinity mask: f
elm3b6:~# taskset -p 3116
pid 3116's current affinity mask: f
elm3b6:~# taskset -p 3108
pid 3108's current affinity mask: f

Not a biggie for me, since I can easily do the taskset commands to force the processes to spread out, but I am worried that casual users of rcutorture won't know to do this -- thus not really torturing RCU. It would not be hard to modify rcutorture to affinity the tasks so as to spread them, but this seems a bit ugly.

Thanx, Paul

#13 lore raw
In reply to Ingo Molnar
Quoted 3 lines · Ingo Molnar

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

I'm running 2.6.21.4-rt12-cfs-v17 (x86_64), so far no problems. I like this kernel a lot, it's feels quite smooth.

One little thing, no HPET timer is detected. By looking at the patch, even the force detect code is there, it should work.

The hpet timer is not available as a clocksource and only one hpet related message is present in dmesg:

PM: Adding info for No Bus:hpet

This is on a Asus P5LD2-VM motherboard (ICH7)

Relevant config bits:

CONFIG_HPET_TIMER=y
# CONFIG_HPET_EMULATE_RTC is not set
CONFIG_HPET=y
# CONFIG_HPET_RTC_IRQ is not set
CONFIG_HPET_MMAP=y

Should I enable one of the two other options? Any ideas?

Best regards,

- Eric

#14 lore raw

(Cc:-ed Venki for the force-hpet issue below)

Quoted 6 lines · Eric St-Laurent
Quoted 2 lines · Ingo Molnar

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

I'm running 2.6.21.4-rt12-cfs-v17 (x86_64), so far no problems. I like this kernel a lot, it's feels quite smooth.

yeah, that's probably CFS in the works :-) That combined with PREEMPT_RT makes for a really snappy desktop.

Quoted 12 lines

One little thing, no HPET timer is detected. By looking at the patch, even the force detect code is there, it should work.

The hpet timer is not available as a clocksource and only one hpet related message is present in dmesg:

PM: Adding info for No Bus:hpet

This is on a Asus P5LD2-VM motherboard (ICH7)

Relevant config bits:

Quoted 7 lines

CONFIG_HPET_TIMER=y
# CONFIG_HPET_EMULATE_RTC is not set
CONFIG_HPET=y
# CONFIG_HPET_RTC_IRQ is not set
CONFIG_HPET_MMAP=y

Should I enable one of the two other options? Any ideas?

Venki, is this ICH7 board supposed to work with force-hpet?

Ingo

#15 lore raw
Quoted 47 lines

-----Original Message-----
From: Ingo Molnar [mailto:[email protected]]
Sent: Tuesday, June 12, 2007 12:32 AM
To: Eric St-Laurent
Cc: [email protected]; [email protected]; Thomas Gleixner; Dinakar Guniguntala; Pallipadi, Venkatesh
Subject: Re: v2.6.21.4-rt11

(Cc:-ed Venki for the force-hpet issue below)

Quoted 5 lines · Eric St-Laurent
Quoted 2 lines · Ingo Molnar

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

I'm running 2.6.21.4-rt12-cfs-v17 (x86_64), so far no

problems. I like

Quoted 1 line

this kernel a lot, it's feels quite smooth.

yeah, that's probably CFS in the works :-) That combined with PREEMPT_RT
makes for a really snappy desktop.

Quoted 1 line

One little thing, no HPET timer is detected. By looking at

the patch,

Quoted 17 lines

even the force detect code is there, it should work.

The hpet timer is not available as a clocksource and only one hpet related message is present in dmesg:

PM: Adding info for No Bus:hpet

This is on a Asus P5LD2-VM motherboard (ICH7)

Relevant config bits:

CONFIG_HPET_TIMER=y
# CONFIG_HPET_EMULATE_RTC is not set
CONFIG_HPET=y
# CONFIG_HPET_RTC_IRQ is not set
CONFIG_HPET_MMAP=y

Quoted 4 lines
Quoted 1 line

Should I enable one of the two other options? Any ideas?

Venki, is this ICH7 board supposed to work with force-hpet?

Yes. Force_hpet part is should have worked..
Eric: Can you send me the output of 'lspci -n on your system. We need to double check we are covering all ICH7 ids.

Thanks,
Venki

#11 lore raw
In reply to Paul E. McKenney
Quoted 5 lines · Paul E. McKenney

Not a biggie for me, since I can easily do the taskset commands to force the processes to spread out, but I am worried that casual users of rcutorture won't know to do this -- thus not really torturing RCU. It would not be hard to modify rcutorture to affinity the tasks so as to spread them, but this seems a bit ugly.

does it get any better if you renice them from +19 to 0? (and then back to +19?)

Ingo

#12 lore raw
Quoted 11 lines · Ingo Molnar
Quoted 5 lines · Paul E. McKenney

Not a biggie for me, since I can easily do the taskset commands to force the processes to spread out, but I am worried that casual users of rcutorture won't know to do this -- thus not really torturing RCU. It would not be hard to modify rcutorture to affinity the tasks so as to spread them, but this seems a bit ugly.

does it get any better if you renice them from +19 to 0? (and then back to +19?)

Interesting!

That did spread them evenly across two CPUs, but not across all four.

I took a look at CFS, which seems to operate in terms of milliseconds. Since the rcu_torture_reader() code enters the scheduler on each interation, it would not give CFS millisecond-scale bursts of CPU consumption, perhaps not allowing it to do reasonable load balancing.

So I inserted the following code at the beginning of rcu_torture_reader():

	set_user_nice(current, 19);
	set_user_nice(current, 0);
	for (idx = 0; idx < 1000; idx++) {
		udelay(10);
	}
	set_user_nice(current, 19);

This worked much better:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND           
18600 root      39  19     0    0    0 R   50  0.0   0:09.57 rcu_torture_rea    
18599 root      39  19     0    0    0 R   50  0.0   0:09.56 rcu_torture_rea    
18598 root      39  19     0    0    0 R   49  0.0   0:10.33 rcu_torture_rea    
18602 root      39  19     0    0    0 R   49  0.0   0:10.34 rcu_torture_rea    
18596 root      39  19     0    0    0 R   47  0.0   0:09.48 rcu_torture_rea    
18601 root      39  19     0    0    0 R   46  0.0   0:09.56 rcu_torture_rea    
18595 root      39  19     0    0    0 R   45  0.0   0:09.23 rcu_torture_rea    
18597 root      39  19     0    0    0 R   44  0.0   0:10.92 rcu_torture_rea    
18590 root      39  19     0    0    0 R   10  0.0   0:02.23 rcu_torture_wri    
18591 root      39  19     0    0    0 D    2  0.0   0:00.34 rcu_torture_fak    
18592 root      39  19     0    0    0 D    2  0.0   0:00.35 rcu_torture_fak    
18593 root      39  19     0    0    0 D    2  0.0   0:00.35 rcu_torture_fak    
18594 root      39  19     0    0    0 D    2  0.0   0:00.33 rcu_torture_fak    
18603 root      15  -5     0    0    0 S    1  0.0   0:00.06 rcu_torture_sta    

(The first eight tasks are readers, while the last six tasks are update and statistics threads that don't consume so much CPU, so the above is pretty close to optimal.)

I stopped and restarted rcutorture several times, and it spread nicely each time, at least aside from the time that makewhatis decided to fire up just as I started rcutorture.

But this is admittedly a -very- crude hack.

One approach would be to make them all spin until a few milliseconds after the last one was created. I would like to spread the readers separately from the other tasks, which could be done by taking a two-stage approach, spreading the writer and fakewriter tasks first, then spreading the readers. This seems a bit nicer, and I will play with it a bit.

In the meantime, thoughts on more-maintainable ways of making this work?

Thanx, Paul

#16 lore raw
In reply to Pallipadi, Venkatesh
Quoted 6 lines · Venkatesh
Quoted 2 lines

-----Original Message-----

Yes. Force_hpet part is should have worked..
Eric: Can you send me the output of 'lspci -n on your system. We need to double check we are covering all ICH7 ids.

Here it is:

00:00.0 0600: 8086:2770 (rev 02)
00:02.0 0300: 8086:2772 (rev 02)
00:1b.0 0403: 8086:27d8 (rev 01)
00:1c.0 0604: 8086:27d0 (rev 01)
00:1c.1 0604: 8086:27d2 (rev 01)
00:1d.0 0c03: 8086:27c8 (rev 01)
00:1d.1 0c03: 8086:27c9 (rev 01)
00:1d.2 0c03: 8086:27ca (rev 01)
00:1d.3 0c03: 8086:27cb (rev 01)
00:1d.7 0c03: 8086:27cc (rev 01)
00:1e.0 0604: 8086:244e (rev e1)
00:1f.0 0601: 8086:27b8 (rev 01)
00:1f.1 0101: 8086:27df (rev 01)
00:1f.2 0101: 8086:27c0 (rev 01)
00:1f.3 0c05: 8086:27da (rev 01)
01:0a.0 0604: 3388:0021 (rev 11)
02:0c.0 0c03: 1033:0035 (rev 41)
02:0c.1 0c03: 1033:0035 (rev 41)
02:0c.2 0c03: 1033:00e0 (rev 02)
02:0d.0 0c00: 1106:3044 (rev 46)
03:00.0 0200: 8086:109a

Adding the id for PCI_DEVICE_ID_INTEL_ICH7_0 (27b8) should do the trick.

I've patched my kernel and was ready to test it, but in the meantime I did a BIOS upgrade (bad idea...) and with the new version the HPET timer is detected via ACPI.

Unfortunately it seems that downgrading the BIOS is a lot more trouble than upgrading it. So I cannot easily test the force enable anymore.

Anyway it works now. Here is my patch if it's any use to you:

arch/i386/kernel/quirks.c +2 -0
diff -uprN linux-2.6.21.4.orig/arch/i386/kernel/quirks.c linux-2.6.21.4/arch/i386/kernel/quirks.c
@@ -149,6 +149,8 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_I
                          ich_force_enable_hpet);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1,
                          ich_force_enable_hpet);
+DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0,
+                         ich_force_enable_hpet);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1,
                          ich_force_enable_hpet);
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_31,

Best regards,

- Eric

#17 lore raw
In reply to Ingo Molnar
Quoted 9 lines · Ingo Molnar

i'm pleased to announce the v2.6.21.4-rt11 kernel, which can be downloaded from the usual place:

http://people.redhat.com/mingo/realtime-preempt/

more info about the -rt patchset can be found in the RT wiki:

http://rt.wiki.kernel.org

Not for ARM yet :(

What should I try for the ARM architecture? There are many choices and I don't know what is the more friendly. By friendly I mean the one that is likely to be merged and that cooperate with you.

Quoted 5 lines

to build a 2.6.21.4-rt11 tree, the following patches should be applied:

    http://kernel.org/pub/linux/kernel/v2.6/linux-2.6.21.4.tar.bz2
    http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt11

Using this patch:

http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt14

LD init/built-in.o
LD .tmp_vmlinux1
kernel/built-in.o(.text+0xd3f0): In function `do_sys_settimeofday':
: undefined reference to warp_check_clock_was_changed' kernel/built-in.o(.text+0x12588): In function timekeeping_resume':
: undefined reference to warp_check_clock_was_changed' kernel/built-in.o(.text+0x132f8): In function do_sysinfo':
: undefined reference to __get_nsec_offset' kernel/built-in.o(.text+0x20a04): In function ktime_get_ts':
: undefined reference to __get_nsec_offset' kernel/built-in.o(.text+0x221c0): In function $a':
: undefined reference to warp_check_clock_was_changed' kernel/built-in.o(.text+0x22208): In function $a':
: undefined reference to warp_check_clock_was_changed' kernel/built-in.o(.text+0x2b9dc): In function $a':
: undefined reference to `usecs_to_cycles'
make: *** [.tmp_vmlinux1] Error 1

Regards.

Signature · 2 lines
http://arhuaco.org
http://emQbit.com
#18 lore raw
Quoted 5 lines · Nelson Castillo
Quoted 1 line

http://rt.wiki.kernel.org

Not for ARM yet :(

What should I try for the ARM architecture?

ARM has a lot of sub architectures and not all of them are supported yet.

Quoted 3 lines

There are many choices and
I don't know what is the more friendly. By friendly I mean the one that is likely to be merged and that cooperate with you.

Which choices do you mean ?

Quoted 4 lines

http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt14

: undefined reference to `usecs_to_cycles'
make: *** [.tmp_vmlinux1] Error 1

Which ARM sub arch ?

tglx

#19 lore raw
Quoted 9 lines · Thomas Gleixner
Quoted 5 lines · Nelson Castillo
Quoted 1 line

http://rt.wiki.kernel.org

Not for ARM yet :(

What should I try for the ARM architecture?

ARM has a lot of sub architectures and not all of them are supported yet.

I see.

Quoted 5 lines
Quoted 3 lines

There are many choices and
I don't know what is the more friendly. By friendly I mean the one that is likely to be merged and that cooperate with you.

Which choices do you mean ?

I mean implementations. I've seen lot of them but i don't know which one to try (I'm new to RT and the implementation in this thread seems to be very nice).

Quoted 7 lines
Quoted 5 lines

http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt14

: undefined reference to `usecs_to_cycles'
make: *** [.tmp_vmlinux1] Error 1

Which ARM sub arch ?

sub arch AT91 -- (Atmel AT91RM9200 processor).

Thanks,
Nelson.-

Signature · 2 lines
http://arhuaco.org
http://emQbit.com
#20 lore raw
Quoted 9 lines · Nelson Castillo
Quoted 5 lines
Quoted 3 lines

There are many choices and
I don't know what is the more friendly. By friendly I mean the one that is likely to be merged and that cooperate with you.

Which choices do you mean ?

I mean implementations. I've seen lot of them but i don't know which one to try (I'm new to RT and the implementation in this thread seems to be very nice).

Thanks :)

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt14

: undefined reference to `usecs_to_cycles'
make: *** [.tmp_vmlinux1] Error 1

Which ARM sub arch ?

sub arch AT91 -- (Atmel AT91RM9200 processor).

It lacks support for the generic timeofday and clock event layers, which causes the compile breakage.

I take a look at the compile errors and ping somebody who is working on support for AT91 to send out the patches ASAP.

tglx

#21 lore raw

From: Thomas Gleixner <[email protected]>
Date: Sun, 17 Jun 2007 18:59:18 +0200

Quoted 18 lines · Nelson Castillo
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

There are many choices and
I don't know what is the more friendly. By friendly I mean the one that is likely to be merged and that cooperate with you.

Which choices do you mean ?

I mean implementations. I've seen lot of them but i don't know which one to try (I'm new to RT and the implementation in this thread seems to be very nice).

Thanks :)

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

http://people.redhat.com/mingo/realtime-preempt/patch-2.6.21.4-rt14

: undefined reference to `usecs_to_cycles'
make: *** [.tmp_vmlinux1] Error 1

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Which ARM sub arch ?

sub arch AT91 -- (Atmel AT91RM9200 processor).

It lacks support for the generic timeofday and clock event layers, which causes the compile breakage.

I am working on Renesas SuperH platforms.
I faced the similar compile errors
because 2.6.21.X in SH does not support GENERIC_TIME yet. I made a workaround patch. Is this correct?

Thanks,
---
Katsuya Matsubara @ Igel Co., Ltd
[email protected]

diff -cr linux-2.6.21.5-rt14/kernel/hrtimer.c linux-2.6.21.5-rt14-nogt/kernel/hrtimer.c
*** linux-2.6.21.5-rt14/kernel/hrtimer.c 2007-06-18 19:55:55.000000000 +0900
--- linux-2.6.21.5-rt14-nogt/kernel/hrtimer.c 2007-06-16 16:36:10.000000000 +0900
***************
*** 119,127 ****
--- 119,131 ----

do {
seq = read_seqbegin(&xtime_lock);
+ #ifdef CONFIG_GENERIC_TIME
*ts = xtime;
nsecs = __get_nsec_offset();
timespec_add_ns(ts, nsecs);
+ #else
+ getnstimeofday(ts);
+ #endif
tomono = wall_to_monotonic;

} while (read_seqretry(&xtime_lock, seq));
diff -cr linux-2.6.21.5-rt14/kernel/time/ntp.c linux-2.6.21.5-rt14-nogt/kernel/time/ntp.c
*** linux-2.6.21.5-rt14/kernel/time/ntp.c 2007-06-18 19:55:56.000000000 +0900
--- linux-2.6.21.5-rt14-nogt/kernel/time/ntp.c 2007-06-16 16:37:46.000000000 +0900
***************
*** 120,126 ****
--- 120,128 ----
*/
time_interpolator_update(-NSEC_PER_SEC);
time_state = TIME_OOP;
+ #ifdef CONFIG_GENERIC_TIME
warp_check_clock_was_changed();
+ #endif
clock_was_set();
printk(KERN_NOTICE "Clock: inserting leap second "
"23:59:60 UTC\n");
***************
*** 136,142 ****
--- 138,146 ----
*/
time_interpolator_update(NSEC_PER_SEC);
time_state = TIME_WAIT;
+ #ifdef CONFIG_GENERIC_TIME
warp_check_clock_was_changed();
+ #endif
clock_was_set();
printk(KERN_NOTICE "Clock: deleting leap second "
"23:59:59 UTC\n");
diff -cr linux-2.6.21.5-rt14/kernel/time.c linux-2.6.21.5-rt14-nogt/kernel/time.c
*** linux-2.6.21.5-rt14/kernel/time.c 2007-06-18 19:55:56.000000000 +0900
--- linux-2.6.21.5-rt14-nogt/kernel/time.c 2007-06-16 16:36:10.000000000 +0900
***************
*** 135,141 ****
--- 135,143 ----
wall_to_monotonic.tv_sec -= sys_tz.tz_minuteswest * 60; xtime.tv_sec += sys_tz.tz_minuteswest * 60; time_interpolator_reset();
+ #ifdef CONFIG_GENERIC_TIME
warp_check_clock_was_changed();
+ #endif
write_sequnlock_irq(&xtime_lock);
clock_was_set();
}
***************
*** 320,326 ****
--- 322,330 ----
time_esterror = NTP_PHASE_LIMIT;
time_interpolator_reset();
}
+ #ifdef CONFIG_GENERIC_TIME
warp_check_clock_was_changed();
+ #endif
write_sequnlock_irq(&xtime_lock);
clock_was_set();
return 0;
diff -cr linux-2.6.21.5-rt14/kernel/timer.c linux-2.6.21.5-rt14-nogt/kernel/timer.c
*** linux-2.6.21.5-rt14/kernel/timer.c 2007-06-18 19:55:56.000000000 +0900
--- linux-2.6.21.5-rt14-nogt/kernel/timer.c 2007-06-16 16:36:10.000000000 +0900
***************
*** 1165,1171 ****
--- 1165,1173 ----
clock->cycle_accumulated = 0;
clock->error = 0;
timekeeping_suspended = 0;
+ #ifdef CONFIG_GENERIC_TIME
warp_check_clock_was_changed();
+ #endif
write_sequnlock_irqrestore(&xtime_lock, flags);

touch_softlockup_watchdog();
***************
*** 1728,1736 ****
--- 1730,1742 ----
* too.
*/

+ #ifdef CONFIG_GENERIC_TIME
tp = xtime;
nsecs = __get_nsec_offset();
timespec_add_ns(&tp, nsecs);
+ #else
+ getnstimeofday(&tp);
+ #endif

  		tp.tv_sec += wall_to_monotonic.tv_sec;
  		tp.tv_nsec += wall_to_monotonic.tv_nsec;
#22 lore raw

Katsuya-San,

Quoted 7 lines · Katsuya MATSUBARA
Quoted 2 lines

It lacks support for the generic timeofday and clock event layers, which causes the compile breakage.

I am working on Renesas SuperH platforms.
I faced the similar compile errors
because 2.6.21.X in SH does not support GENERIC_TIME yet. I made a workaround patch. Is this correct?

Looks good.

Can you in future please use "diff -ur" to generate patches. That's the usual format.

Thanks,

tglx