High resolution timers on ACPI-less kernel
Hello everyone,
I'm using a -rt kernel with high resolution timer support.
http://rt.wiki.kernel.org/index.php/Main_Page
Linux version 2.6.22.1-rt9 (root@venus) (gcc version 3.4.6) #1 PREEMPT RT Tue Oct 9 10:02:45 CEST 2007
I enabled high resolution timer support and disabled ACPI support.
CONFIG_TICK_ONESHOT=y
# CONFIG_NO_HZ is not setCONFIG_HIGH_RES_TIMERS=yCONFIG_GENERIC_CLOCKEVENTS_BUILD=y
# CONFIG_SMP is not set
...CONFIG_PREEMPT_RT=yCONFIG_PREEMPT=yCONFIG_PREEMPT_SOFTIRQS=yCONFIG_PREEMPT_HARDIRQS=yCONFIG_PREEMPT_BKL=y
# CONFIG_CLASSIC_RCU is not setCONFIG_PREEMPT_RCU=y
# CONFIG_RCU_TRACE is not setCONFIG_X86_UP_APIC=yCONFIG_X86_UP_IOAPIC=yCONFIG_X86_LOCAL_APIC=yCONFIG_X86_IO_APIC=y
...CONFIG_MTRR=yCONFIG_REGPARM=y
# CONFIG_SECCOMP is not setCONFIG_HZ_100=y
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
# CONFIG_HZ_1000 is not setCONFIG_HZ=100
High resolution timers do not work in this configuration.
Consider the following app where I request a 2 ms sleep (where the time quantum is 10 ms).
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <sched.h>
static void set_SCHED_RR(int priority)
{
struct sched_param param = { 0 }; param.sched_priority = priority;
int err = sched_setscheduler(0, SCHED_RR, ¶m); if (err) perror("sched_setscheduler");
}
int main(void)
{
struct timespec t0, t1, ms = { 0, 2000000 };
set_SCHED_RR(20);
while ( 1 )
{
clock_gettime(CLOCK_REALTIME, &t0);
nanosleep(&ms, NULL);
clock_gettime(CLOCK_REALTIME, &t1);
long diff = (t1.tv_sec-t0.tv_sec)*1000000000 + (t1.tv_nsec-t0.tv_nsec);
printf("delta = %ld\n", diff);}
return 0;
}
# ./test delta = 6026911 delta = 9926038 delta = 9989993 delta = 9995600 delta = 9993176 delta = 9994805 delta = 9994822 delta = 9994978 delta = 9994912 delta = 9994998 delta = 9994878 delta = 9994513
Any idea why?
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc pit jiffies
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc
My timestamp counter is good. Why do I need ACPI for hrt?
I've attached dmesg output.
Regards.
Linux version 2.6.22.1-rt9 (root@venus) (gcc version 3.4.6) #1 PREEMPT RT Tue Oct 9 10:02:45 CEST 2007 BIOS-provided physical RAM map:
BIOS-e820: 0000000000000000 - 00000000000a0000 (usable)
BIOS-e820: 00000000000f0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 000000000fef0000 (usable)
BIOS-e820: 000000000fef0000 - 000000000fef3000 (ACPI NVS)
BIOS-e820: 000000000fef3000 - 000000000ff00000 (ACPI data)
BIOS-e820: 00000000fec00000 - 0000000100000000 (reserved)
254MB LOWMEM available.
found SMP MP-table at 000f4fa0
Entering add_active_range(0, 0, 65264) 0 entries of 256 used
Zone PFN ranges:
DMA 0 -> 4096
Normal 4096 -> 65264
early_node_map[1] active PFN ranges
0: 0 -> 65264
On node 0 totalpages: 65264
DMA zone: 32 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 4064 pages, LIFO batch:0
Normal zone: 477 pages used for memmap
Normal zone: 60691 pages, LIFO batch:15
DMI 2.2 present.
Intel MultiProcessor Specification v1.4
Virtual Wire compatibility mode.
OEM ID: OEM00000 Product ID: PROD00000000 APIC at: 0xFEE00000
Processor #0 15:2 APIC version 17
I/O APIC #2 Version 17 at 0xFEC00000.
Enabling APIC mode: Flat. Using 1 I/O APICs
Processors: 1
Allocating PCI resources starting at 10000000 (gap: 0ff00000:eed00000)
Real-Time Preemption Support (C) 2004-2007 Ingo Molnar
Built 1 zonelists. Total pages: 64755
Kernel command line: ro root=/dev/hdc1 console=ttyS0,57600n8 console=tty0 panic=3 apic=debug nmi_watchdog=0 mapped APIC to ffffd000 (fee00000)
mapped IOAPIC to ffffc000 (fec00000)
Enabling fast FPU save and restore... done.
Enabling unmasked SIMD FPU exception support... done.
Initializing CPU#0
WARNING: experimental RCU implementation.
PID hash table entries: 1024 (order: 10, 4096 bytes)
Detected 2400.000 MHz processor.
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 256308k/261056k available (1274k kernel code, 4252k reserved, 451k data, 128k init, 0k highmem) virtual kernel memory layout:
fixmap : 0xfffbc000 - 0xfffff000 ( 268 kB)
vmalloc : 0xd0800000 - 0xfffba000 ( 759 MB)
lowmem : 0xc0000000 - 0xcfef0000 ( 254 MB)
.init : 0xc02b2000 - 0xc02d2000 ( 128 kB)
.data : 0xc023e9ef - 0xc02af92c ( 451 kB)
.text : 0xc0100000 - 0xc023e9ef (1274 kB)Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 4802.76 BogoMIPS (lpj=24013820) Mount-cache hash table entries: 512
CPU: After generic identify, caps: bfebfbff 00000000 00000000 00000000 00004400 00000000 00000000
CPU: Trace cache: 12K uops, L1 D cache: 8K
CPU: L2 cache: 512K
CPU: After all inits, caps: bfebfbff 00000000 00000000 0000b080 00004400 00000000 00000000 Compat vDSO mapped to ffffe000.
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz stepping 09
Checking 'hlt' instruction... OK.
Getting VERSION: 50014
Getting VERSION: 50014
Getting ID: 0
Getting LVT0: 700
Getting LVT1: 400
enabled ExtINT on CPU#0
ExtINT not setup in hardware but reported by MP table
ENABLING IO-APIC IRQs
Setting 2 in the phys_id_present_map
...changing IO-APIC physical APIC ID to 2 ... ok.
init IO_APIC IRQs
IO-APIC (apicid-pin) 2-0, 2-5, 2-7, 2-9, 2-10, 2-11, 2-20, 2-21, 2-22 not connected.
..TIMER: vector=0x31 apic1=0 pin1=2 apic2=0 pin2=0
number of MP IRQ sources: 19.
number of IO-APIC #2 registers: 24.
testing the IO APIC.......................
IO APIC #2......
.... register #00: 02000000
....... : physical APIC id: 02 ....... : Delivery Type: 0 ....... : LTS : 0 .... register #01: 00178020 ....... : max redirection entries: 0017 ....... : PRQ implemented: 1 ....... : IO APIC version: 0020
.... register #02: 00000000
....... : arbitration: 00
.... register #03: 00000001
....... : Boot DT : 1
.... IRQ redirection table:
NR Log Phy Mask Trig IRR Pol Stat Dest Deli Vect:
00 000 00 1 0 0 0 0 0 0 00 01 001 01 0 0 0 0 0 1 1 39 02 001 01 0 0 0 0 0 1 1 31 03 001 01 0 0 0 0 0 1 1 41 04 001 01 0 0 0 0 0 1 1 49 05 000 00 1 0 0 0 0 0 0 00 06 001 01 0 0 0 0 0 1 1 51 07 000 00 1 0 0 0 0 0 0 00 08 001 01 0 0 0 0 0 1 1 59 09 000 00 1 0 0 0 0 0 0 00 0a 000 00 1 0 0 0 0 0 0 00 0b 000 00 1 0 0 0 0 0 0 00 0c 001 01 0 0 0 0 0 1 1 61 0d 001 01 0 0 0 0 0 1 1 69 0e 001 01 0 0 0 0 0 1 1 71 0f 001 01 0 0 0 0 0 1 1 79 10 001 01 1 1 0 1 0 1 1 81 11 001 01 1 1 0 1 0 1 1 89 12 001 01 1 1 0 1 0 1 1 91 13 001 01 1 1 0 1 0 1 1 99 14 000 00 1 0 0 0 0 0 0 00 15 000 00 1 0 0 0 0 0 0 00 16 000 00 1 0 0 0 0 0 0 00 17 001 01 1 1 0 1 0 1 1 A1
IRQ to pin mappings:
IRQ0 -> 0:2
IRQ1 -> 0:1
IRQ3 -> 0:3
IRQ4 -> 0:4
IRQ6 -> 0:6
IRQ8 -> 0:8
IRQ12 -> 0:12
IRQ13 -> 0:13
IRQ14 -> 0:14
IRQ15 -> 0:15
IRQ16 -> 0:16
IRQ17 -> 0:17
IRQ18 -> 0:18
IRQ19 -> 0:19
IRQ23 -> 0:23
.................................... done.
Using local APIC timer interrupts.
calibrating APIC timer ...
... lapic delta = 833376
... PM timer delta = 0
..... delta 833376
..... mult: 35793226
..... calibration result: 1333401
..... CPU clock speed is 2400.1228 MHz.
..... host bus clock speed is 133.3401 MHz.
... verify APIC timer
... jiffies delta = 10
... jiffies result ok
NET: Registered protocol family 16
PCI: PCI BIOS revision 2.10 entry at 0xfb3e0, last bus=1
PCI: Using configuration type 1
Setting up standard PCI resources
PCI: Probing PCI hardware
PCI: Probing PCI hardware (bus 00)
PCI quirk: region 0400-047f claimed by ICH4 ACPI/GPIO/TCO
PCI quirk: region 0480-04bf claimed by ICH4 GPIO
PCI: Transparent bridge - 0000:00:1e.0
PCI: Using IRQ router PIIX/ICH [8086/24c0] at 0000:00:1f.0 querying PCI -> IRQ mapping bus:0, slot:2, pin:0.PCI->APIC IRQ transform: 0000:00:02.0[A] -> IRQ 16
querying PCI -> IRQ mapping bus:0, slot:31, pin:0.PCI->APIC IRQ transform: 0000:00:1f.1[A] -> IRQ 16
querying PCI -> IRQ mapping bus:0, slot:31, pin:1.PCI->APIC IRQ transform: 0000:00:1f.3[B] -> IRQ 17
querying PCI -> IRQ mapping bus:1, slot:2, pin:0.PCI->APIC IRQ transform: 0000:01:02.0[A] -> IRQ 16
querying PCI -> IRQ mapping bus:1, slot:3, pin:0.PCI->APIC IRQ transform: 0000:01:03.0[A] -> IRQ 17
querying PCI -> IRQ mapping bus:1, slot:4, pin:0.PCI->APIC IRQ transform: 0000:01:04.0[A] -> IRQ 18
querying PCI -> IRQ mapping bus:1, slot:5, pin:0.PCI->APIC IRQ transform: 0000:01:05.0[A] -> IRQ 19
querying PCI -> IRQ mapping bus:1, slot:15, pin:0.PCI->APIC IRQ transform: 0000:01:0f.0[A] -> IRQ 23
PCI: Bridge: 0000:00:1e.0
IO window: c000-cfff
MEM window: ec000000-edffffff
PREFETCH window: 10000000-100fffff
PCI: Setting latency timer of device 0000:00:1e.0 to 64
NET: Registered protocol family 2
IP route cache hash table entries: 2048 (order: 1, 8192 bytes) TCP established hash table entries: 8192 (order: 6, 294912 bytes) TCP bind hash table entries: 8192 (order: 5, 229376 bytes)
TCP: Hash tables configured (established 8192 bind 8192)
TCP reno registered
io scheduler noop registered (default)
Boot video device is 0000:00:02.0
Real Time Clock Driver v1.12ac
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing disabled serial8250.0: ttyS0 at I/O 0x3f8 (irq = 4) is a 16550A serial8250.0: ttyS1 at I/O 0x2f8 (irq = 3) is a 16550A
Intel(R) PRO/1000 Network Driver - version 7.3.20-k2
Copyright (c) 1999-2006 Intel Corporation.
e1000: 0000:01:02.0: e1000_probe: (PCI:33MHz:32-bit) 00:0b:ab:14:32:31
e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: 0000:01:03.0: e1000_probe: (PCI:33MHz:32-bit) 00:0b:ab:14:32:32
e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: 0000:01:04.0: e1000_probe: (PCI:33MHz:32-bit) 00:0b:ab:14:32:33
e1000: eth2: e1000_probe: Intel(R) PRO/1000 Network Connection
e1000: 0000:01:05.0: e1000_probe: (PCI:33MHz:32-bit) 00:0b:ab:14:32:34
e1000: eth3: e1000_probe: Intel(R) PRO/1000 Network Connection Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx
ICH4: IDE controller at PCI slot 0000:00:1f.1
ICH4: chipset revision 2
ICH4: not 100% native mode: will probe irqs later
ide0: BM-DMA at 0xf000-0xf007, BIOS settings: hda:pio, hdb:pio
ide1: BM-DMA at 0xf008-0xf00f, BIOS settings: hdc:pio, hdd:pioProbing IDE interface ide0...
Probing IDE interface ide1...
hdc: PQI IDE DiskOnModule, ATA DISK drive
hdc: set_drive_speed_status: status=0x51 { DriveReady SeekComplete Error }
hdc: set_drive_speed_status: error=0x04 { DriveStatusError }
ide1 at 0x170-0x177,0x376 on irq 15
hdc: max request size: 128KiB
hdc: 256000 sectors (131 MB) w/1KiB Cache, CHS=500/16/32
hdc: hdc1 hdc2 hdc3 hdc4
TCP cubic registered
NET: Registered protocol family 1
NET: Registered protocol family 17
802.1Q VLAN Support v1.8 Ben Greear <[email protected]>
All bugs added by David S. Miller <[email protected]>
Using IPI Shortcut mode
VFS: Mounted root (ext2 filesystem) readonly.
Freeing unused kernel memory: 128k freed
e1000: eth0: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX/TX
Hi John,
On Tue, 2007-10-09 at 11:06 +0200, John Sigler wrote:
[...]
Quoted 1 line
I enabled high resolution timer support and disabled ACPI support.
[...]
http://www.mail-archive.com/[email protected]/msg00375.html
Ciao,
Alessio
Quoted 6 lines · Alessio Igor Bogani
On Tue, 2007-10-09 at 11:06 +0200, John Sigler wrote:
[...]Quoted 1 line
I enabled high resolution timer support and disabled ACPI support.
[...]
There are other clock sources on my system.
The timestamp counter is reliable (as far as I can tell). The LAPIC timer is reliable.
(I've just disabled the PM timer.)
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc pit jiffies
# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc
# cat /proc/timer_list Timer List Version: v0.3 HRTIMER_MAX_CLOCK_BASES: 2 now at 3787164271418 nsecs
cpu: 0
clock 0:
.index: 0
.resolution: 10000000 nsecs
.get_time: ktime_get_real
.offset: 0 nsecs
active timers:
clock 1:
.index: 1
.resolution: 10000000 nsecs
.get_time: ktime_get
.offset: 0 nsecs
active timers:
#0: <cf22bec0>, it_real_fn, S:01
# expires at 3789432883979 nsecs [in 2268612561 nsecs] .expires_next : 9223372036854775807 nsecs .hres_active : 0 .nr_events : 0 .nohz_mode : 0 .idle_tick : 0 nsecs .tick_stopped : 0 .idle_jiffies : 0 .idle_calls : 0 .idle_sleeps : 0 .idle_entrytime : 0 nsecs .idle_sleeptime : 0 nsecs .last_jiffies : 0 .next_jiffies : 0 .idle_expires : 0 nsecs jiffies: 348693
Tick Device: mode: 0
Clock Event Device: pit
max_delta_ns: 27461866 min_delta_ns: 12571 mult: 5124677 shift: 32 mode: 1 next_event: 0 nsecs
set_next_event: pit_next_event
set_mode: init_pit_timer
event_handler: clockevents_handle_nooptick_broadcast_mask: 00000000tick_broadcast_oneshot_mask: 00000000
Tick Device: mode: 0
Clock Event Device: lapic
max_delta_ns: 1006581321 min_delta_ns: 1799 mult: 35793226 shift: 32 mode: 2 next_event: 0 nsecs
set_next_event: lapic_next_event
set_mode: lapic_timer_setup
event_handler: tick_handle_periodic
Regards.
Quoted 10 lines · John Sigler
Quoted 6 lines · Alessio Igor Bogani
On Tue, 2007-10-09 at 11:06 +0200, John Sigler wrote:
[...]Quoted 1 line
I enabled high resolution timer support and disabled ACPI support.
[...]
There are other clock sources on my system.
The timestamp counter is reliable (as far as I can tell).
See previous mail.
Quoted 1 line
The LAPIC timer is reliable.
LAPIC timer is a clock event device, not a clock source. It can be used to program the next event, but not to read the time.
Quoted 1 line
(I've just disabled the PM timer.)
Yup, which in turn disables highres.
tglx
Quoted 13 lines · Thomas Gleixner
Quoted 9 lines · John Sigler
Quoted 5 lines · Alessio Igor Bogani
Quoted 1 line · John Sigler
I enabled high resolution timer support and disabled ACPI support.
There are other clock sources on my system.
The timestamp counter is reliable (as far as I can tell).See previous mail.
Quoted 8 lines
Quoted 1 line
The LAPIC timer is reliable.
LAPIC timer is a clock event device, not a clock source. It can be used to program the next event, but not to read the time.
Quoted 1 line
(I've just disabled the PM timer.)
Yup, which in turn disables highres.
OK. I have two more questions.
Can the kernel verify the correctness of the TSC with the PIT?
When I enable the ACPI PM timer, the kernel tells me:
* The chipset may have PM-Timer Bug. Due to workarounds for a bug,
* this clock source is slow. If you are sure your timer does not have
* this bug, please use "acpi_pm_good" to disable the workaround
How can I tell whether my PM timer has this bug or not? (Specific revision? Test app?)
Regards.
Quoted 30 lines · John Sigler
Quoted 14 lines · Thomas Gleixner
Quoted 10 lines · John Sigler
Quoted 6 lines · Alessio Igor Bogani
Quoted 1 line · John Sigler
I enabled high resolution timer support and disabled ACPI support.
There are other clock sources on my system.
The timestamp counter is reliable (as far as I can tell).See previous mail.
Quoted 8 lines
Quoted 1 line
The LAPIC timer is reliable.
LAPIC timer is a clock event device, not a clock source. It can be used to program the next event, but not to read the time.
Quoted 1 line
(I've just disabled the PM timer.)
Yup, which in turn disables highres.
OK. I have two more questions.
Can the kernel verify the correctness of the TSC with the PIT?
When I enable the ACPI PM timer, the kernel tells me:
Quoted 9 lines
* The chipset may have PM-Timer Bug. Due to workarounds for a bug,
* this clock source is slow. If you are sure your timer does not have
* this bug, please use "acpi_pm_good" to disable the workaroundHow can I tell whether my PM timer has this bug or not? (Specific revision? Test app?)
Regards.
hallo, i am using the 2.6.22.1-rt9 kernel too, and it runs pretty good for me, but following this thread i got very unsure, if the hrtimer is being used here. please, i would really appreciate if someone of you could make a 'diagnosis' of the issue.
murija2:/home/nowhiskey# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc hpet acpi_pm pit jiffies murija2:/home/nowhiskey# cat /sys/devices/system/clocksource/clocksource0/ available_clocksource current_clocksource murija2:/home/nowhiskey# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc murija2:/home/nowhiskey# cat /proc/timer_list Timer List Version: v0.3 HRTIMER_MAX_CLOCK_BASES: 2 now at 279500939467 nsecs
cpu: 0
clock 0:
.index: 0
.resolution: 1 nsecs
.get_time: ktime_get_real
.offset: 1191944919927389648 nsecs
active timers:
clock 1:
.index: 1
.resolution: 1 nsecs
.get_time: ktime_get
.offset: 0 nsecs
active timers:
#0: <d7697f04>, tick_sched_timer, S:01
# expires at 279501000000 nsecs [in 60533 nsecs] #1: <d7697f04>, it_real_fn, S:01 # expires at 279519610937 nsecs [in 18671470 nsecs] #2: <d7697f04>, hrtimer_wakeup, S:01 # expires at 279911555013 nsecs [in 410615546 nsecs] #3: <d7697f04>, hrtimer_wakeup, S:01 # expires at 285349267955 nsecs [in 5848328488 nsecs] #4: <d7697f04>, it_real_fn, S:01 # expires at 292823897860 nsecs [in 13322958393 nsecs] #5: <d7697f04>, hrtimer_wakeup, S:01 # expires at 307102248124 nsecs [in 27601308657 nsecs] #6: <d7697f04>, hrtimer_wakeup, S:01 # expires at 307167956204 nsecs [in 27667016737 nsecs] .expires_next : 279501000000 nsecs .hres_active : 1 .nr_events : 43411 .nohz_mode : 2 .idle_tick : 279482000000 nsecs .tick_stopped : 0 .idle_jiffies : 4294946777 .idle_calls : 33246 .idle_sleeps : 27192 .idle_entrytime : 279481048513 nsecs .idle_sleeptime : 248235489890 nsecs .last_jiffies : 4294946777 .next_jiffies : 4294946817 .idle_expires : 279521000000 nsecs jiffies: 4294946796
Tick Device: mode: 1 Clock Event Device: pit max_delta_ns: 27461866 min_delta_ns: 12571 mult: 5124677 shift: 32 mode: 3 next_event: 9223372036854775807 nsecs set_next_event: pit_next_event set_mode: init_pit_timer event_handler: tick_handle_oneshot_broadcast tick_broadcast_mask: 00000000 tick_broadcast_oneshot_mask: 00000000
Tick Device: mode: 1 Clock Event Device: hpet max_delta_ns: 2147483647 min_delta_ns: 3352 mult: 61496110 shift: 32 mode: 3 next_event: 279502000000 nsecs set_next_event: hpet_legacy_next_event set_mode: hpet_legacy_set_mode event_handler: hrtimer_interrupt
Quoted 4 lines · Dragan Noveski
hallo, i am using the 2.6.22.1-rt9 kernel too, and it runs pretty good for me, but following this thread i got very unsure, if the hrtimer is being used here.
.resolution: 1 nsecs
Yes, it switched to high resolution (1 nsec). Otherwise it would show 10, 4 or 1 ms
tglx
Quoted 8 lines · Thomas Gleixner
Quoted 5 lines · Dragan Noveski
hallo, i am using the 2.6.22.1-rt9 kernel too, and it runs pretty good for me, but following this thread i got very unsure, if the hrtimer is being used here.
.resolution: 1 nsecs
Quoted 5 lines
Yes, it switched to high resolution (1 nsec). Otherwise it would show 10, 4 or 1 ms
tglx
hallo thomas, very much thanks for the response - it clarifies some things here for me!
cheers,
doc
Quoted 38 lines · John Sigler
I'm using a -rt kernel with high resolution timer support.
http://rt.wiki.kernel.org/index.php/Main_Page
Linux version 2.6.22.1-rt9 (root@venus) (gcc version 3.4.6) #1 PREEMPT RT Tue Oct 9 10:02:45 CEST 2007I enabled high resolution timer support and disabled ACPI support.
CONFIG_TICK_ONESHOT=y
#CONFIG_NO_HZis not setCONFIG_HIGH_RES_TIMERS=yCONFIG_GENERIC_CLOCKEVENTS_BUILD=y
#CONFIG_SMPis not set
...CONFIG_PREEMPT_RT=yCONFIG_PREEMPT=yCONFIG_PREEMPT_SOFTIRQS=yCONFIG_PREEMPT_HARDIRQS=yCONFIG_PREEMPT_BKL=y
#CONFIG_CLASSIC_RCUis not setCONFIG_PREEMPT_RCU=y
#CONFIG_RCU_TRACEis not setCONFIG_X86_UP_APIC=yCONFIG_X86_UP_IOAPIC=yCONFIG_X86_LOCAL_APIC=yCONFIG_X86_IO_APIC=y
...CONFIG_MTRR=yCONFIG_REGPARM=y
#CONFIG_SECCOMPis not setCONFIG_HZ_100=y
#CONFIG_HZ_250is not set
#CONFIG_HZ_300is not set
#CONFIG_HZ_1000is not setCONFIG_HZ=100High resolution timers do not work in this configuration.
Any idea why?
Quoted 7 lines
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc pit jiffies# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tscMy timestamp counter is good. Why do I need ACPI for hrt?
I noticed something strange about IRQ0.
It keeps firing even after the system has booted.
# cat /proc/interrupts ; sleep 10 ; cat /proc/interrupts
CPU0
0: 312530 IO-APIC-edge timer
2: 0 XT-PIC-XT cascade
4: 73 IO-APIC-edge serial
8: 1 IO-APIC-edge rtc
15: 16085 IO-APIC-edge ide1
16: 3302 IO-APIC-fasteoi eth0
17: 1560 IO-APIC-fasteoi eth1
18: 1560 IO-APIC-fasteoi eth2
19: 1560 IO-APIC-fasteoi eth3
NMI: 0
LOC: 312489
ERR: 0
MIS: 0CPU0
0: 313532 IO-APIC-edge timer 2: 0 XT-PIC-XT cascade 4: 73 IO-APIC-edge serial 8: 1 IO-APIC-edge rtc 15: 16109 IO-APIC-edge ide1 16: 3309 IO-APIC-fasteoi eth0 17: 1565 IO-APIC-fasteoi eth1 18: 1565 IO-APIC-fasteoi eth2 19: 1565 IO-APIC-fasteoi eth3 NMI: 0 LOC: 313492 ERR: 0 MIS: 0
IRQ0 is still firing. (1002 times in 10 s = 100 Hz)
When high resolution timers work, the IRQ0 counter stops incrementing after the system has booted. (When the system switches from the PIT to the APIC timer AFAIU.) The APIC timer (is that what LOC counts?) also fired 1003 times in 10 s = 100 Hz.
Is it normal that both the PIT and the APIC timer keep firing?
Regards.
Quoted 10 lines · John Sigler
Hello everyone,
I'm using a -rt kernel with high resolution timer support.
http://rt.wiki.kernel.org/index.php/Main_Page
Linux version 2.6.22.1-rt9 (root@venus) (gcc version 3.4.6) #1 PREEMPT RT Tue Oct 9 10:02:45 CEST 2007I enabled high resolution timer support and disabled ACPI support.
...
High resolution timers do not work in this configuration.
Correct
Quoted 1 line
Any idea why?
Yes
Quoted 7 lines
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc pit jiffies# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tscMy timestamp counter is good. Why do I need ACPI for hrt?
We do not trust TSC at all. Never ever.
The kernel refuses to switch to high resolution mode, when there is no reliable backup clock source available. ACPI enables the acpi_pm timer, which is a trusted clock source and is used by the kernel to verify the correctness of the TSC. You might try to enable HPET.
tglx
Quoted 23 lines · Thomas Gleixner
Quoted 8 lines · John Sigler
I'm using a -rt kernel with high resolution timer support.
http://rt.wiki.kernel.org/index.php/Main_Page
Linux version 2.6.22.1-rt9 (root@venus) (gcc version 3.4.6) #1 PREEMPT RT Tue Oct 9 10:02:45 CEST 2007I enabled high resolution timer support and disabled ACPI support.
...
High resolution timers do not work in this configuration.Correct
Quoted 1 line
Any idea why?
Yes
Quoted 6 lines
# cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc pit jiffies# cat /sys/devices/system/clocksource/clocksource0/current_clocksource tsc
Quoted 8 lines
Quoted 1 line
My timestamp counter is good. Why do I need ACPI for hrt?
We do not trust TSC at all. Never ever.
The kernel refuses to switch to high resolution mode, when there is no reliable backup clock source available. ACPI enables the
acpi_pmtimer, which is a trusted clock source and is used by the kernel to verify the correctness of the TSC. You might try to enable HPET.
OK. I seem to remember that you had a patch to enable HPET on ICH4? Is it still available somewhere?
Regards.
On Tue, 2007-10-09 at 11:22 +0200, Thomas Gleixner wrote:
[...]
Quoted 1 line
We do not trust TSC at all. Never ever.
I found in the code at arch/i386/kernel/tsc.c that there is a exception for Geode LX (the famous OLPC). ;-)
Ciao,
Alessio
Quoted 6 lines · Alessio Igor Bogani
On Tue, 2007-10-09 at 11:22 +0200, Thomas Gleixner wrote:
[...]Quoted 1 line
We do not trust TSC at all. Never ever.
I found in the code at
arch/i386/kernel/tsc.cthat there is a exception for Geode LX (the famous OLPC). ;-)
True. Forgot about that one :9
tglx