2005-04-03 00:38:11

by Arun Srinivas

[permalink] [raw]
Subject: sched /HT processor


HI

I have pentium4 hyperthreaded processor.I am using kernel 2.6.5 and i
rebuilt my kernel with CONFIG_SMP enabled (in this kernel source there is
nothing such as CONFIG_SMT...i noticed this only in recent 2.6.11).

1) So, after I rebulit it with CONFIG_SMP enabled does linux recogonize my
machine as hyperthreaded or as 2 seperate processor? Also, if it does not
recogonize it as hyperthreaded(but only as 2 seperate CPU's), does the
scheduler schedule instruction in the 2 cpu's independently? (does it
maintain 2 seperate runqueues?

2) If it has indeed recogonized this as hyperthreaded processor...does the
scheduler use a common runqueue for the 2 logical processor?

(please read below)
*********************************************************************************************************
(I am attaching the ouput of 'dmesg' (command) on my machine)
*************************************************************************************************************
Apr 2 17:43:12 kulick2 kernel: Linux version 2.6.5-1.358custom
(root@kulick2) (gcc version 3.3
.3 20040412 (Red Hat Linux 3.3.3-7)) #133 SMP Wed Mar 30 12:16:27 CST 2005
Apr 2 17:43:12 kulick2 kernel: BIOS-provided physical RAM map:
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000000000 -
00000000000a0000 (usable)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000000f0000 -
0000000000100000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000100000 -
000000001f770000 (usable)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f770000 -
000000001f772000 (ACPI NVS)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f772000 -
000000001f793000 (ACPI data)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f793000 -
000000001f800000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fec00000 -
00000000fec10000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fecf0000 -
00000000fecf1000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fed20000 -
00000000fed90000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fee00000 -
00000000fee10000 (reserved)
Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000ffb00000 -
0000000100000000 (reserved)
Apr 2 17:43:12 kulick2 kernel: 0MB HIGHMEM available.
Apr 2 17:43:12 kulick2 kernel: 503MB LOWMEM available.
Apr 2 17:43:12 kulick2 kernel: ACPI: S3 and PAE do not like each other for
now, S3 disabled.
Apr 2 17:43:12 kulick2 kernel: found SMP MP-table at 000fe710
Apr 2 17:43:12 kulick2 kernel: On node 0 totalpages: 128880
Apr 2 17:43:12 kulick2 kernel: DMA zone: 4096 pages, LIFO batch:1
Apr 2 17:43:12 kulick2 kernel: Normal zone: 124784 pages, LIFO batch:16
Apr 2 17:43:12 kulick2 kernel: HighMem zone: 0 pages, LIFO batch:1
Apr 2 17:43:12 kulick2 kernel: DMI 2.3 present.
Apr 2 17:43:12 kulick2 kernel: Using APIC driver default
Apr 2 17:43:12 kulick2 kernel: ACPI: RSDP (v000 DELL
) @
0x000feba0
Apr 2 17:43:12 kulick2 kernel: ACPI: RSDT (v001 DELL GX270 0x00000007
ASL 0x00000061) @
0x000fd192
Apr 2 17:43:12 kulick2 kernel: ACPI: FADT (v001 DELL GX270 0x00000007
ASL 0x00000061) @
0x000fd1ca
Apr 2 17:43:12 kulick2 kernel: ACPI: SSDT (v001 DELL st_ex 0x00001000
MSFT 0x0100000d) @
0xfffd4eee
Apr 2 17:43:12 kulick2 irqbalance: irqbalance startup succeeded
Apr 2 17:43:12 kulick2 kernel: ACPI: MADT (v001 DELL GX270 0x00000007
ASL 0x00000061) @
0x000fd23e
Apr 2 17:43:12 kulick2 kernel: ACPI: BOOT (v001 DELL GX270 0x00000007
ASL 0x00000061) @
0x000fd2aa
Apr 2 17:43:12 kulick2 kernel: ACPI: ASF! (v016 DELL GX270 0x00000007
ASL 0x00000061) @
0x000fd2d2
Apr 2 17:43:12 kulick2 kernel: ACPI: DSDT (v001 DELL dt_ex 0x00001000
MSFT 0x0100000d) @
0x00000000
Apr 2 17:43:12 kulick2 kernel: ACPI: PM-Timer IO Port: 0x808
Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00]
enabled)
Apr 2 17:43:12 kulick2 kernel: Processor #0 15:2 APIC version 20
Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01]
enabled)
Apr 2 17:43:12 kulick2 kernel: Processor #1 15:2 APIC version 20
Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01]
disabled)
Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03]
disabled)
Apr 2 17:43:12 kulick2 kernel: ACPI: IOAPIC (id[0x02] address[0xfec00000]
global_irq_base[0x0]
)
Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: Assigned apic_id 2
Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: apic_id 2, version 32, address
0xfec00000, GSI 0-23
Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0
global_irq 2 dfl dfl)
Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9
global_irq 9 high level)
Apr 2 17:43:12 kulick2 kernel: Enabling APIC mode: Flat. Using 1 I/O
APICs
Apr 2 17:43:12 kulick2 kernel: Using ACPI (MADT) for SMP configuration
information
Apr 2 17:43:12 kulick2 portmap: portmap startup succeeded
Apr 2 17:43:12 kulick2 kernel: Built 1 zonelists
Apr 2 17:43:12 kulick2 kernel: Kernel command line: ro root=LABEL=/ rhgb
quiet
Apr 2 17:43:12 kulick2 kernel: mapped 4G/4G trampoline to fffeb000.
Apr 2 17:43:12 kulick2 kernel: Initializing CPU#0
Apr 2 17:43:12 kulick2 kernel: CPU 0 irqstacks, hard=023cb000 soft=023ab000
Apr 2 17:43:12 kulick2 kernel: PID hash table entries: 2048 (order 11:
16384 bytes)
Apr 2 17:43:12 kulick2 kernel: Detected 2993.225 MHz processor.
Apr 2 17:43:12 kulick2 kernel: Using pmtmr for high-res timesource
Apr 2 17:43:12 kulick2 kernel: Console: colour VGA+ 80x25
Apr 2 17:43:12 kulick2 kernel: Memory: 505996k/515520k available (1744k
kernel code, 8772k res
erved, 756k data, 180k init, 0k highmem)
Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5931.00 BogoMIPS
Apr 2 17:43:12 kulick2 kernel: Security Scaffold v1.0.0 initialized
Apr 2 17:43:12 kulick2 kernel: SELinux: Initializing.
Apr 2 17:43:12 kulick2 kernel: SELinux: Starting in permissive mode
Apr 2 17:43:12 kulick2 kernel: There is already a security framework
initialized, register_sec
urity failed.
Apr 2 17:43:12 kulick2 kernel: Failure registering capabilities with the
kernel
Apr 2 17:43:12 kulick2 kernel: selinux_register_security: Registering
secondary module capabi
lity
Apr 2 17:43:12 kulick2 kernel: Capability LSM initialized
Apr 2 17:43:12 kulick2 kernel: Dentry cache hash table entries: 32768
(order: 5, 131072 bytes)
Apr 2 17:43:12 kulick2 kernel: Inode-cache hash table entries: 32768
(order: 5, 131072 bytes)
Apr 2 17:43:12 kulick2 kernel: Mount-cache hash table entries: 512 (order:
0, 4096 bytes)
Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache: 8K
Apr 2 17:43:12 kulick2 rpc.statd[2019]: Version 1.0.6 Starting
Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
Apr 2 17:43:12 kulick2 rpc.statd[2019]: gethostbyname error for kulick2
Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture supported.
Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
CPU#0.
Apr 2 17:43:12 kulick2 nfslock: rpc.statd startup succeeded
Apr 2 17:43:12 kulick2 kernel: CPU#0: Intel P4/Xeon Extended MCE MSRs (12)
available
Apr 2 17:43:12 kulick2 kernel: CPU#0: Thermal monitoring enabled
Apr 2 17:43:12 kulick2 kernel: Enabling fast FPU save and restore... done.
Apr 2 17:43:12 kulick2 kernel: Enabling unmasked SIMD FPU exception
support... done.
Apr 2 17:43:12 kulick2 kernel: Checking 'hlt' instruction... OK.
Apr 2 17:43:12 kulick2 kernel: POSIX conformance testing by UNIFIX
Apr 2 17:43:12 kulick2 kernel: CPU0: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping 09
Apr 2 17:43:12 kulick2 kernel: per-CPU timeslice cutoff: 1462.93 usecs.
Apr 2 17:43:12 kulick2 kernel: task migration cache decay timeout: 2 msecs.
Apr 2 17:43:12 kulick2 kernel: enabled ExtINT on CPU#0
Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector: 00000040
Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector: 00000000
Apr 2 17:43:12 kulick2 kernel: Booting processor 1/1 eip 2000
Apr 2 17:43:12 kulick2 kernel: CPU 1 irqstacks, hard=023cc000 soft=023ac000
Apr 2 17:43:12 kulick2 kernel: Initializing CPU#1
Apr 2 17:43:12 kulick2 kernel: masked ExtINT on CPU#1
Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector: 00000000
Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector: 00000000
Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5980.16 BogoMIPS
Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache: 8K
Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture supported.
Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
CPU#1.
Apr 2 17:43:12 kulick2 kernel: CPU#1: Intel P4/Xeon Extended MCE MSRs (12)
available
Apr 2 17:43:12 kulick2 kernel: CPU#1: Thermal monitoring enabled
Apr 2 17:43:12 kulick2 kernel: CPU1: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping 09
Apr 2 17:43:12 kulick2 kernel: Total of 2 processors activated (11911.16
BogoMIPS).
Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[0] = 1
Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[1] = 0
>From: [email protected]
>To: [email protected]
>Subject: Delivery Status Notification (Failure)
>Date: Sat, 2 Apr 2005 16:01:39 -0800
>
>This is an automatically generated Delivery Status Notification.
>
>Delivery to the following recipients failed.
>
> [email protected]
>
>
>
><< attach3 >>
><< message4.txt >>

_________________________________________________________________
Expressions unlimited! http://server1.msn.co.in/sp04/messenger/ The all new
MSN Messenger!


2005-04-03 01:18:36

by Steven Rostedt

[permalink] [raw]
Subject: Re: sched /HT processor

On Sun, 2005-04-03 at 06:07 +0530, Arun Srinivas wrote:
> HI
>
> I have pentium4 hyperthreaded processor.I am using kernel 2.6.5 and i
> rebuilt my kernel with CONFIG_SMP enabled (in this kernel source there is
> nothing such as CONFIG_SMT...i noticed this only in recent 2.6.11).
>

I don't have a 2.6.5 available, but I do have a 2.6.9 to look at.

> 1) So, after I rebulit it with CONFIG_SMP enabled does linux recogonize my
> machine as hyperthreaded or as 2 seperate processor? Also, if it does not
> recogonize it as hyperthreaded(but only as 2 seperate CPU's), does the
> scheduler schedule instruction in the 2 cpu's independently? (does it
> maintain 2 seperate runqueues?
>

I believe even HT on 2.6.11 maintains two different runqueues. But it
doesn't care so much to jump from one runqueue to the next if it is HT.

> 2) If it has indeed recogonized this as hyperthreaded processor...does the
> scheduler use a common runqueue for the 2 logical processor?
>

No, you wouldn't want to.


> (please read below)

What do you want us to see?

> *********************************************************************************************************
> (I am attaching the ouput of 'dmesg' (command) on my machine)
> *************************************************************************************************************
> Apr 2 17:43:12 kulick2 kernel: Linux version 2.6.5-1.358custom
> (root@kulick2) (gcc version 3.3
> .3 20040412 (Red Hat Linux 3.3.3-7)) #133 SMP Wed Mar 30 12:16:27 CST 2005
> Apr 2 17:43:12 kulick2 kernel: BIOS-provided physical RAM map:
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000000000 -
> 00000000000a0000 (usable)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000000f0000 -
> 0000000000100000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000100000 -
> 000000001f770000 (usable)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f770000 -
> 000000001f772000 (ACPI NVS)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f772000 -
> 000000001f793000 (ACPI data)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f793000 -
> 000000001f800000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fec00000 -
> 00000000fec10000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fecf0000 -
> 00000000fecf1000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fed20000 -
> 00000000fed90000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fee00000 -
> 00000000fee10000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000ffb00000 -
> 0000000100000000 (reserved)
> Apr 2 17:43:12 kulick2 kernel: 0MB HIGHMEM available.
> Apr 2 17:43:12 kulick2 kernel: 503MB LOWMEM available.
> Apr 2 17:43:12 kulick2 kernel: ACPI: S3 and PAE do not like each other for
> now, S3 disabled.
> Apr 2 17:43:12 kulick2 kernel: found SMP MP-table at 000fe710
> Apr 2 17:43:12 kulick2 kernel: On node 0 totalpages: 128880
> Apr 2 17:43:12 kulick2 kernel: DMA zone: 4096 pages, LIFO batch:1
> Apr 2 17:43:12 kulick2 kernel: Normal zone: 124784 pages, LIFO batch:16
> Apr 2 17:43:12 kulick2 kernel: HighMem zone: 0 pages, LIFO batch:1
> Apr 2 17:43:12 kulick2 kernel: DMI 2.3 present.
> Apr 2 17:43:12 kulick2 kernel: Using APIC driver default
> Apr 2 17:43:12 kulick2 kernel: ACPI: RSDP (v000 DELL
> ) @
> 0x000feba0
> Apr 2 17:43:12 kulick2 kernel: ACPI: RSDT (v001 DELL GX270 0x00000007
> ASL 0x00000061) @
> 0x000fd192
> Apr 2 17:43:12 kulick2 kernel: ACPI: FADT (v001 DELL GX270 0x00000007
> ASL 0x00000061) @
> 0x000fd1ca
> Apr 2 17:43:12 kulick2 kernel: ACPI: SSDT (v001 DELL st_ex 0x00001000
> MSFT 0x0100000d) @
> 0xfffd4eee
> Apr 2 17:43:12 kulick2 irqbalance: irqbalance startup succeeded
> Apr 2 17:43:12 kulick2 kernel: ACPI: MADT (v001 DELL GX270 0x00000007
> ASL 0x00000061) @
> 0x000fd23e
> Apr 2 17:43:12 kulick2 kernel: ACPI: BOOT (v001 DELL GX270 0x00000007
> ASL 0x00000061) @
> 0x000fd2aa
> Apr 2 17:43:12 kulick2 kernel: ACPI: ASF! (v016 DELL GX270 0x00000007
> ASL 0x00000061) @
> 0x000fd2d2
> Apr 2 17:43:12 kulick2 kernel: ACPI: DSDT (v001 DELL dt_ex 0x00001000
> MSFT 0x0100000d) @
> 0x00000000
> Apr 2 17:43:12 kulick2 kernel: ACPI: PM-Timer IO Port: 0x808
> Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00]
> enabled)
> Apr 2 17:43:12 kulick2 kernel: Processor #0 15:2 APIC version 20
> Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01]
> enabled)
> Apr 2 17:43:12 kulick2 kernel: Processor #1 15:2 APIC version 20
> Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x03] lapic_id[0x01]
> disabled)
> Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03]
> disabled)
> Apr 2 17:43:12 kulick2 kernel: ACPI: IOAPIC (id[0x02] address[0xfec00000]
> global_irq_base[0x0]
> )
> Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: Assigned apic_id 2
> Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: apic_id 2, version 32, address
> 0xfec00000, GSI 0-23
> Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0
> global_irq 2 dfl dfl)
> Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9
> global_irq 9 high level)
> Apr 2 17:43:12 kulick2 kernel: Enabling APIC mode: Flat. Using 1 I/O
> APICs
> Apr 2 17:43:12 kulick2 kernel: Using ACPI (MADT) for SMP configuration
> information
> Apr 2 17:43:12 kulick2 portmap: portmap startup succeeded
> Apr 2 17:43:12 kulick2 kernel: Built 1 zonelists
> Apr 2 17:43:12 kulick2 kernel: Kernel command line: ro root=LABEL=/ rhgb
> quiet
> Apr 2 17:43:12 kulick2 kernel: mapped 4G/4G trampoline to fffeb000.
> Apr 2 17:43:12 kulick2 kernel: Initializing CPU#0
> Apr 2 17:43:12 kulick2 kernel: CPU 0 irqstacks, hard=023cb000 soft=023ab000
> Apr 2 17:43:12 kulick2 kernel: PID hash table entries: 2048 (order 11:
> 16384 bytes)
> Apr 2 17:43:12 kulick2 kernel: Detected 2993.225 MHz processor.
> Apr 2 17:43:12 kulick2 kernel: Using pmtmr for high-res timesource
> Apr 2 17:43:12 kulick2 kernel: Console: colour VGA+ 80x25
> Apr 2 17:43:12 kulick2 kernel: Memory: 505996k/515520k available (1744k
> kernel code, 8772k res
> erved, 756k data, 180k init, 0k highmem)
> Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5931.00 BogoMIPS
> Apr 2 17:43:12 kulick2 kernel: Security Scaffold v1.0.0 initialized
> Apr 2 17:43:12 kulick2 kernel: SELinux: Initializing.
> Apr 2 17:43:12 kulick2 kernel: SELinux: Starting in permissive mode
> Apr 2 17:43:12 kulick2 kernel: There is already a security framework
> initialized, register_sec
> urity failed.
> Apr 2 17:43:12 kulick2 kernel: Failure registering capabilities with the
> kernel
> Apr 2 17:43:12 kulick2 kernel: selinux_register_security: Registering
> secondary module capabi
> lity
> Apr 2 17:43:12 kulick2 kernel: Capability LSM initialized
> Apr 2 17:43:12 kulick2 kernel: Dentry cache hash table entries: 32768
> (order: 5, 131072 bytes)
> Apr 2 17:43:12 kulick2 kernel: Inode-cache hash table entries: 32768
> (order: 5, 131072 bytes)
> Apr 2 17:43:12 kulick2 kernel: Mount-cache hash table entries: 512 (order:
> 0, 4096 bytes)
> Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache: 8K
> Apr 2 17:43:12 kulick2 rpc.statd[2019]: Version 1.0.6 Starting
> Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> Apr 2 17:43:12 kulick2 rpc.statd[2019]: gethostbyname error for kulick2
> Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture supported.
> Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> CPU#0.
> Apr 2 17:43:12 kulick2 nfslock: rpc.statd startup succeeded
> Apr 2 17:43:12 kulick2 kernel: CPU#0: Intel P4/Xeon Extended MCE MSRs (12)
> available
> Apr 2 17:43:12 kulick2 kernel: CPU#0: Thermal monitoring enabled
> Apr 2 17:43:12 kulick2 kernel: Enabling fast FPU save and restore... done.
> Apr 2 17:43:12 kulick2 kernel: Enabling unmasked SIMD FPU exception
> support... done.
> Apr 2 17:43:12 kulick2 kernel: Checking 'hlt' instruction... OK.
> Apr 2 17:43:12 kulick2 kernel: POSIX conformance testing by UNIFIX
> Apr 2 17:43:12 kulick2 kernel: CPU0: Intel(R) Pentium(R) 4 CPU 3.00GHz
> stepping 09
> Apr 2 17:43:12 kulick2 kernel: per-CPU timeslice cutoff: 1462.93 usecs.
> Apr 2 17:43:12 kulick2 kernel: task migration cache decay timeout: 2 msecs.
> Apr 2 17:43:12 kulick2 kernel: enabled ExtINT on CPU#0
> Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector: 00000040
> Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector: 00000000
> Apr 2 17:43:12 kulick2 kernel: Booting processor 1/1 eip 2000
> Apr 2 17:43:12 kulick2 kernel: CPU 1 irqstacks, hard=023cc000 soft=023ac000
> Apr 2 17:43:12 kulick2 kernel: Initializing CPU#1
> Apr 2 17:43:12 kulick2 kernel: masked ExtINT on CPU#1
> Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector: 00000000
> Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector: 00000000
> Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5980.16 BogoMIPS
> Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache: 8K
> Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture supported.
> Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> CPU#1.
> Apr 2 17:43:12 kulick2 kernel: CPU#1: Intel P4/Xeon Extended MCE MSRs (12)
> available
> Apr 2 17:43:12 kulick2 kernel: CPU#1: Thermal monitoring enabled
> Apr 2 17:43:12 kulick2 kernel: CPU1: Intel(R) Pentium(R) 4 CPU 3.00GHz
> stepping 09
> Apr 2 17:43:12 kulick2 kernel: Total of 2 processors activated (11911.16
> BogoMIPS).
> Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[0] = 1
> Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[1] = 0

Here you see that you have two CPUs. 0 is the sibling of 1 and 1 to 0.
This just shows that you have HT. If you were to have a dual xeon, then
you would see 4 CPUs and two pairs.

-- Steve

2005-04-03 02:16:35

by Arun Srinivas

[permalink] [raw]
Subject: Re: sched /HT processor


I attached the 'dmesg' output because there it shows that my kernel
recogonized 2 cpu's.As said earlier , are they treated as 2 physical cpu's
or logical cpu's?

>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: LKML <[email protected]>
>Subject: Re: sched /HT processor
>Date: Sat, 02 Apr 2005 20:17:54 -0500
>
>On Sun, 2005-04-03 at 06:07 +0530, Arun Srinivas wrote:
> > HI
> >
> > I have pentium4 hyperthreaded processor.I am using kernel 2.6.5 and i
> > rebuilt my kernel with CONFIG_SMP enabled (in this kernel source there
>is
> > nothing such as CONFIG_SMT...i noticed this only in recent 2.6.11).
> >
>
>I don't have a 2.6.5 available, but I do have a 2.6.9 to look at.
>
> > 1) So, after I rebulit it with CONFIG_SMP enabled does linux recogonize
>my
> > machine as hyperthreaded or as 2 seperate processor? Also, if it does
>not
> > recogonize it as hyperthreaded(but only as 2 seperate CPU's), does the
> > scheduler schedule instruction in the 2 cpu's independently? (does it
> > maintain 2 seperate runqueues?
> >
>
>I believe even HT on 2.6.11 maintains two different runqueues. But it
>doesn't care so much to jump from one runqueue to the next if it is HT.
>
> > 2) If it has indeed recogonized this as hyperthreaded processor...does
>the
> > scheduler use a common runqueue for the 2 logical processor?
> >
>
>No, you wouldn't want to.
>
>
> > (please read below)
>
>What do you want us to see?
>
> >
>*********************************************************************************************************
> > (I am attaching the ouput of 'dmesg' (command) on my machine)
> >
>*************************************************************************************************************
> > Apr 2 17:43:12 kulick2 kernel: Linux version 2.6.5-1.358custom
> > (root@kulick2) (gcc version 3.3
> > .3 20040412 (Red Hat Linux 3.3.3-7)) #133 SMP Wed Mar 30 12:16:27 CST
>2005
> > Apr 2 17:43:12 kulick2 kernel: BIOS-provided physical RAM map:
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000000000 -
> > 00000000000a0000 (usable)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000000f0000 -
> > 0000000000100000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000100000 -
> > 000000001f770000 (usable)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f770000 -
> > 000000001f772000 (ACPI NVS)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f772000 -
> > 000000001f793000 (ACPI data)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f793000 -
> > 000000001f800000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fec00000 -
> > 00000000fec10000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fecf0000 -
> > 00000000fecf1000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fed20000 -
> > 00000000fed90000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fee00000 -
> > 00000000fee10000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000ffb00000 -
> > 0000000100000000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: 0MB HIGHMEM available.
> > Apr 2 17:43:12 kulick2 kernel: 503MB LOWMEM available.
> > Apr 2 17:43:12 kulick2 kernel: ACPI: S3 and PAE do not like each other
>for
> > now, S3 disabled.
> > Apr 2 17:43:12 kulick2 kernel: found SMP MP-table at 000fe710
> > Apr 2 17:43:12 kulick2 kernel: On node 0 totalpages: 128880
> > Apr 2 17:43:12 kulick2 kernel: DMA zone: 4096 pages, LIFO batch:1
> > Apr 2 17:43:12 kulick2 kernel: Normal zone: 124784 pages, LIFO
>batch:16
> > Apr 2 17:43:12 kulick2 kernel: HighMem zone: 0 pages, LIFO batch:1
> > Apr 2 17:43:12 kulick2 kernel: DMI 2.3 present.
> > Apr 2 17:43:12 kulick2 kernel: Using APIC driver default
> > Apr 2 17:43:12 kulick2 kernel: ACPI: RSDP (v000 DELL
> > ) @
> > 0x000feba0
> > Apr 2 17:43:12 kulick2 kernel: ACPI: RSDT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd192
> > Apr 2 17:43:12 kulick2 kernel: ACPI: FADT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd1ca
> > Apr 2 17:43:12 kulick2 kernel: ACPI: SSDT (v001 DELL st_ex
>0x00001000
> > MSFT 0x0100000d) @
> > 0xfffd4eee
> > Apr 2 17:43:12 kulick2 irqbalance: irqbalance startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: ACPI: MADT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd23e
> > Apr 2 17:43:12 kulick2 kernel: ACPI: BOOT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd2aa
> > Apr 2 17:43:12 kulick2 kernel: ACPI: ASF! (v016 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd2d2
> > Apr 2 17:43:12 kulick2 kernel: ACPI: DSDT (v001 DELL dt_ex
>0x00001000
> > MSFT 0x0100000d) @
> > 0x00000000
> > Apr 2 17:43:12 kulick2 kernel: ACPI: PM-Timer IO Port: 0x808
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x01]
>lapic_id[0x00]
> > enabled)
> > Apr 2 17:43:12 kulick2 kernel: Processor #0 15:2 APIC version 20
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x02]
>lapic_id[0x01]
> > enabled)
> > Apr 2 17:43:12 kulick2 kernel: Processor #1 15:2 APIC version 20
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x03]
>lapic_id[0x01]
> > disabled)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x04]
>lapic_id[0x03]
> > disabled)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: IOAPIC (id[0x02]
>address[0xfec00000]
> > global_irq_base[0x0]
> > )
> > Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: Assigned apic_id 2
> > Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: apic_id 2, version 32,
>address
> > 0xfec00000, GSI 0-23
> > Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0
> > global_irq 2 dfl dfl)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9
> > global_irq 9 high level)
> > Apr 2 17:43:12 kulick2 kernel: Enabling APIC mode: Flat. Using 1 I/O
> > APICs
> > Apr 2 17:43:12 kulick2 kernel: Using ACPI (MADT) for SMP configuration
> > information
> > Apr 2 17:43:12 kulick2 portmap: portmap startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: Built 1 zonelists
> > Apr 2 17:43:12 kulick2 kernel: Kernel command line: ro root=LABEL=/
>rhgb
> > quiet
> > Apr 2 17:43:12 kulick2 kernel: mapped 4G/4G trampoline to fffeb000.
> > Apr 2 17:43:12 kulick2 kernel: Initializing CPU#0
> > Apr 2 17:43:12 kulick2 kernel: CPU 0 irqstacks, hard=023cb000
>soft=023ab000
> > Apr 2 17:43:12 kulick2 kernel: PID hash table entries: 2048 (order 11:
> > 16384 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Detected 2993.225 MHz processor.
> > Apr 2 17:43:12 kulick2 kernel: Using pmtmr for high-res timesource
> > Apr 2 17:43:12 kulick2 kernel: Console: colour VGA+ 80x25
> > Apr 2 17:43:12 kulick2 kernel: Memory: 505996k/515520k available (1744k
> > kernel code, 8772k res
> > erved, 756k data, 180k init, 0k highmem)
> > Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5931.00
>BogoMIPS
> > Apr 2 17:43:12 kulick2 kernel: Security Scaffold v1.0.0 initialized
> > Apr 2 17:43:12 kulick2 kernel: SELinux: Initializing.
> > Apr 2 17:43:12 kulick2 kernel: SELinux: Starting in permissive mode
> > Apr 2 17:43:12 kulick2 kernel: There is already a security framework
> > initialized, register_sec
> > urity failed.
> > Apr 2 17:43:12 kulick2 kernel: Failure registering capabilities with
>the
> > kernel
> > Apr 2 17:43:12 kulick2 kernel: selinux_register_security: Registering
> > secondary module capabi
> > lity
> > Apr 2 17:43:12 kulick2 kernel: Capability LSM initialized
> > Apr 2 17:43:12 kulick2 kernel: Dentry cache hash table entries: 32768
> > (order: 5, 131072 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Inode-cache hash table entries: 32768
> > (order: 5, 131072 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Mount-cache hash table entries: 512
>(order:
> > 0, 4096 bytes)
> > Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache:
>8K
> > Apr 2 17:43:12 kulick2 rpc.statd[2019]: Version 1.0.6 Starting
> > Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> > Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> > Apr 2 17:43:12 kulick2 rpc.statd[2019]: gethostbyname error for kulick2
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture
>supported.
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> > CPU#0.
> > Apr 2 17:43:12 kulick2 nfslock: rpc.statd startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: CPU#0: Intel P4/Xeon Extended MCE MSRs
>(12)
> > available
> > Apr 2 17:43:12 kulick2 kernel: CPU#0: Thermal monitoring enabled
> > Apr 2 17:43:12 kulick2 kernel: Enabling fast FPU save and restore...
>done.
> > Apr 2 17:43:12 kulick2 kernel: Enabling unmasked SIMD FPU exception
> > support... done.
> > Apr 2 17:43:12 kulick2 kernel: Checking 'hlt' instruction... OK.
> > Apr 2 17:43:12 kulick2 kernel: POSIX conformance testing by UNIFIX
> > Apr 2 17:43:12 kulick2 kernel: CPU0: Intel(R) Pentium(R) 4 CPU 3.00GHz
> > stepping 09
> > Apr 2 17:43:12 kulick2 kernel: per-CPU timeslice cutoff: 1462.93 usecs.
> > Apr 2 17:43:12 kulick2 kernel: task migration cache decay timeout: 2
>msecs.
> > Apr 2 17:43:12 kulick2 kernel: enabled ExtINT on CPU#0
> > Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector:
>00000040
> > Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: Booting processor 1/1 eip 2000
> > Apr 2 17:43:12 kulick2 kernel: CPU 1 irqstacks, hard=023cc000
>soft=023ac000
> > Apr 2 17:43:12 kulick2 kernel: Initializing CPU#1
> > Apr 2 17:43:12 kulick2 kernel: masked ExtINT on CPU#1
> > Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5980.16
>BogoMIPS
> > Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache:
>8K
> > Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> > Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture
>supported.
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> > CPU#1.
> > Apr 2 17:43:12 kulick2 kernel: CPU#1: Intel P4/Xeon Extended MCE MSRs
>(12)
> > available
> > Apr 2 17:43:12 kulick2 kernel: CPU#1: Thermal monitoring enabled
> > Apr 2 17:43:12 kulick2 kernel: CPU1: Intel(R) Pentium(R) 4 CPU 3.00GHz
> > stepping 09
> > Apr 2 17:43:12 kulick2 kernel: Total of 2 processors activated
>(11911.16
> > BogoMIPS).
> > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[0] = 1
> > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[1] = 0
>
>Here you see that you have two CPUs. 0 is the sibling of 1 and 1 to 0.
>This just shows that you have HT. If you were to have a dual xeon, then
>you would see 4 CPUs and two pairs.
>
>-- Steve
>

_________________________________________________________________
Make money with Zero Investment.
http://adfarm.mediaplex.com/ad/ck/4686-26272-10936-31?ck=RegSell Start your
business.

2005-04-03 04:22:47

by Steven Rostedt

[permalink] [raw]
Subject: Re: sched /HT processor

On Sun, 2005-04-03 at 07:46 +0530, Arun Srinivas wrote:
> I attached the 'dmesg' output because there it shows that my kernel
> recogonized 2 cpu's.As said earlier , are they treated as 2 physical cpu's
> or logical cpu's?
>

As I said, they are logical

[snip]

> > > available
> > > Apr 2 17:43:12 kulick2 kernel: CPU#1: Thermal monitoring enabled
> > > Apr 2 17:43:12 kulick2 kernel: CPU1: Intel(R) Pentium(R) 4 CPU 3.00GHz
> > > stepping 09
> > > Apr 2 17:43:12 kulick2 kernel: Total of 2 processors activated
> >(11911.16
> > > BogoMIPS).
> > > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[0] = 1
> > > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[1] = 0
> >
> >Here you see that you have two CPUs. 0 is the sibling of 1 and 1 to 0.
> >This just shows that you have HT. If you were to have a dual xeon, then
> >you would see 4 CPUs and two pairs.
> >
> >-- Steve
> >
>

I'll elaborate more. This says that you have a single CPU with
hyperthreading. That's what the siblings mean. That they share a single
physical CPU.

-- Steve


2005-04-03 07:53:37

by Arun Srinivas

[permalink] [raw]
Subject: Re: sched /HT processor


I looked at my "include/asm-i386/param.h" and the HZ value is 1000.So, I
suppose the timer interrupt frequency is 1000 times per sec. or once every 1
millisec.

So, is scheduler_tick() ( for resceduling) called only once every 1 ms?? I
am measuring the time when 2 of my processes are scheduled in a HT
processor.So, the possible timedifference of when my 2 processes are
scheduled can be only the following:

1) 0 (if both of my processes are scheduled @ the same time since its a HT)
2) 1ms ( this is the min. possible time diff.
3) some value greater than 1 ms
Is the above argument correct?

Thanks

>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: LKML <[email protected]>
>Subject: Re: sched /HT processor
>Date: Sat, 02 Apr 2005 20:17:54 -0500
>
>On Sun, 2005-04-03 at 06:07 +0530, Arun Srinivas wrote:
> > HI
> >
> > I have pentium4 hyperthreaded processor.I am using kernel 2.6.5 and i
> > rebuilt my kernel with CONFIG_SMP enabled (in this kernel source there
>is
> > nothing such as CONFIG_SMT...i noticed this only in recent 2.6.11).
> >
>
>I don't have a 2.6.5 available, but I do have a 2.6.9 to look at.
>
> > 1) So, after I rebulit it with CONFIG_SMP enabled does linux recogonize
>my
> > machine as hyperthreaded or as 2 seperate processor? Also, if it does
>not
> > recogonize it as hyperthreaded(but only as 2 seperate CPU's), does the
> > scheduler schedule instruction in the 2 cpu's independently? (does it
> > maintain 2 seperate runqueues?
> >
>
>I believe even HT on 2.6.11 maintains two different runqueues. But it
>doesn't care so much to jump from one runqueue to the next if it is HT.
>
> > 2) If it has indeed recogonized this as hyperthreaded processor...does
>the
> > scheduler use a common runqueue for the 2 logical processor?
> >
>
>No, you wouldn't want to.
>
>
> > (please read below)
>
>What do you want us to see?
>
> >
>*********************************************************************************************************
> > (I am attaching the ouput of 'dmesg' (command) on my machine)
> >
>*************************************************************************************************************
> > Apr 2 17:43:12 kulick2 kernel: Linux version 2.6.5-1.358custom
> > (root@kulick2) (gcc version 3.3
> > .3 20040412 (Red Hat Linux 3.3.3-7)) #133 SMP Wed Mar 30 12:16:27 CST
>2005
> > Apr 2 17:43:12 kulick2 kernel: BIOS-provided physical RAM map:
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000000000 -
> > 00000000000a0000 (usable)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000000f0000 -
> > 0000000000100000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 0000000000100000 -
> > 000000001f770000 (usable)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f770000 -
> > 000000001f772000 (ACPI NVS)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f772000 -
> > 000000001f793000 (ACPI data)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 000000001f793000 -
> > 000000001f800000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fec00000 -
> > 00000000fec10000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fecf0000 -
> > 00000000fecf1000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fed20000 -
> > 00000000fed90000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000fee00000 -
> > 00000000fee10000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: BIOS-e820: 00000000ffb00000 -
> > 0000000100000000 (reserved)
> > Apr 2 17:43:12 kulick2 kernel: 0MB HIGHMEM available.
> > Apr 2 17:43:12 kulick2 kernel: 503MB LOWMEM available.
> > Apr 2 17:43:12 kulick2 kernel: ACPI: S3 and PAE do not like each other
>for
> > now, S3 disabled.
> > Apr 2 17:43:12 kulick2 kernel: found SMP MP-table at 000fe710
> > Apr 2 17:43:12 kulick2 kernel: On node 0 totalpages: 128880
> > Apr 2 17:43:12 kulick2 kernel: DMA zone: 4096 pages, LIFO batch:1
> > Apr 2 17:43:12 kulick2 kernel: Normal zone: 124784 pages, LIFO
>batch:16
> > Apr 2 17:43:12 kulick2 kernel: HighMem zone: 0 pages, LIFO batch:1
> > Apr 2 17:43:12 kulick2 kernel: DMI 2.3 present.
> > Apr 2 17:43:12 kulick2 kernel: Using APIC driver default
> > Apr 2 17:43:12 kulick2 kernel: ACPI: RSDP (v000 DELL
> > ) @
> > 0x000feba0
> > Apr 2 17:43:12 kulick2 kernel: ACPI: RSDT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd192
> > Apr 2 17:43:12 kulick2 kernel: ACPI: FADT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd1ca
> > Apr 2 17:43:12 kulick2 kernel: ACPI: SSDT (v001 DELL st_ex
>0x00001000
> > MSFT 0x0100000d) @
> > 0xfffd4eee
> > Apr 2 17:43:12 kulick2 irqbalance: irqbalance startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: ACPI: MADT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd23e
> > Apr 2 17:43:12 kulick2 kernel: ACPI: BOOT (v001 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd2aa
> > Apr 2 17:43:12 kulick2 kernel: ACPI: ASF! (v016 DELL GX270
>0x00000007
> > ASL 0x00000061) @
> > 0x000fd2d2
> > Apr 2 17:43:12 kulick2 kernel: ACPI: DSDT (v001 DELL dt_ex
>0x00001000
> > MSFT 0x0100000d) @
> > 0x00000000
> > Apr 2 17:43:12 kulick2 kernel: ACPI: PM-Timer IO Port: 0x808
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x01]
>lapic_id[0x00]
> > enabled)
> > Apr 2 17:43:12 kulick2 kernel: Processor #0 15:2 APIC version 20
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x02]
>lapic_id[0x01]
> > enabled)
> > Apr 2 17:43:12 kulick2 kernel: Processor #1 15:2 APIC version 20
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x03]
>lapic_id[0x01]
> > disabled)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: LAPIC (acpi_id[0x04]
>lapic_id[0x03]
> > disabled)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: IOAPIC (id[0x02]
>address[0xfec00000]
> > global_irq_base[0x0]
> > )
> > Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: Assigned apic_id 2
> > Apr 2 17:43:12 kulick2 kernel: IOAPIC[0]: apic_id 2, version 32,
>address
> > 0xfec00000, GSI 0-23
> > Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 0
> > global_irq 2 dfl dfl)
> > Apr 2 17:43:12 kulick2 kernel: ACPI: INT_SRC_OVR (bus 0 bus_irq 9
> > global_irq 9 high level)
> > Apr 2 17:43:12 kulick2 kernel: Enabling APIC mode: Flat. Using 1 I/O
> > APICs
> > Apr 2 17:43:12 kulick2 kernel: Using ACPI (MADT) for SMP configuration
> > information
> > Apr 2 17:43:12 kulick2 portmap: portmap startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: Built 1 zonelists
> > Apr 2 17:43:12 kulick2 kernel: Kernel command line: ro root=LABEL=/
>rhgb
> > quiet
> > Apr 2 17:43:12 kulick2 kernel: mapped 4G/4G trampoline to fffeb000.
> > Apr 2 17:43:12 kulick2 kernel: Initializing CPU#0
> > Apr 2 17:43:12 kulick2 kernel: CPU 0 irqstacks, hard=023cb000
>soft=023ab000
> > Apr 2 17:43:12 kulick2 kernel: PID hash table entries: 2048 (order 11:
> > 16384 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Detected 2993.225 MHz processor.
> > Apr 2 17:43:12 kulick2 kernel: Using pmtmr for high-res timesource
> > Apr 2 17:43:12 kulick2 kernel: Console: colour VGA+ 80x25
> > Apr 2 17:43:12 kulick2 kernel: Memory: 505996k/515520k available (1744k
> > kernel code, 8772k res
> > erved, 756k data, 180k init, 0k highmem)
> > Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5931.00
>BogoMIPS
> > Apr 2 17:43:12 kulick2 kernel: Security Scaffold v1.0.0 initialized
> > Apr 2 17:43:12 kulick2 kernel: SELinux: Initializing.
> > Apr 2 17:43:12 kulick2 kernel: SELinux: Starting in permissive mode
> > Apr 2 17:43:12 kulick2 kernel: There is already a security framework
> > initialized, register_sec
> > urity failed.
> > Apr 2 17:43:12 kulick2 kernel: Failure registering capabilities with
>the
> > kernel
> > Apr 2 17:43:12 kulick2 kernel: selinux_register_security: Registering
> > secondary module capabi
> > lity
> > Apr 2 17:43:12 kulick2 kernel: Capability LSM initialized
> > Apr 2 17:43:12 kulick2 kernel: Dentry cache hash table entries: 32768
> > (order: 5, 131072 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Inode-cache hash table entries: 32768
> > (order: 5, 131072 bytes)
> > Apr 2 17:43:12 kulick2 kernel: Mount-cache hash table entries: 512
>(order:
> > 0, 4096 bytes)
> > Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache:
>8K
> > Apr 2 17:43:12 kulick2 rpc.statd[2019]: Version 1.0.6 Starting
> > Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> > Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> > Apr 2 17:43:12 kulick2 rpc.statd[2019]: gethostbyname error for kulick2
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture
>supported.
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> > CPU#0.
> > Apr 2 17:43:12 kulick2 nfslock: rpc.statd startup succeeded
> > Apr 2 17:43:12 kulick2 kernel: CPU#0: Intel P4/Xeon Extended MCE MSRs
>(12)
> > available
> > Apr 2 17:43:12 kulick2 kernel: CPU#0: Thermal monitoring enabled
> > Apr 2 17:43:12 kulick2 kernel: Enabling fast FPU save and restore...
>done.
> > Apr 2 17:43:12 kulick2 kernel: Enabling unmasked SIMD FPU exception
> > support... done.
> > Apr 2 17:43:12 kulick2 kernel: Checking 'hlt' instruction... OK.
> > Apr 2 17:43:12 kulick2 kernel: POSIX conformance testing by UNIFIX
> > Apr 2 17:43:12 kulick2 kernel: CPU0: Intel(R) Pentium(R) 4 CPU 3.00GHz
> > stepping 09
> > Apr 2 17:43:12 kulick2 kernel: per-CPU timeslice cutoff: 1462.93 usecs.
> > Apr 2 17:43:12 kulick2 kernel: task migration cache decay timeout: 2
>msecs.
> > Apr 2 17:43:12 kulick2 kernel: enabled ExtINT on CPU#0
> > Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector:
>00000040
> > Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: Booting processor 1/1 eip 2000
> > Apr 2 17:43:12 kulick2 kernel: CPU 1 irqstacks, hard=023cc000
>soft=023ac000
> > Apr 2 17:43:12 kulick2 kernel: Initializing CPU#1
> > Apr 2 17:43:12 kulick2 kernel: masked ExtINT on CPU#1
> > Apr 2 17:43:12 kulick2 kernel: ESR value before enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: ESR value after enabling vector:
>00000000
> > Apr 2 17:43:12 kulick2 kernel: Calibrating delay loop... 5980.16
>BogoMIPS
> > Apr 2 17:43:12 kulick2 kernel: CPU: Trace cache: 12K uops, L1 D cache:
>8K
> > Apr 2 17:43:12 kulick2 kernel: CPU: L2 cache: 512K
> > Apr 2 17:43:12 kulick2 kernel: CPU: Physical Processor ID: 0
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check architecture
>supported.
> > Apr 2 17:43:12 kulick2 kernel: Intel machine check reporting enabled on
> > CPU#1.
> > Apr 2 17:43:12 kulick2 kernel: CPU#1: Intel P4/Xeon Extended MCE MSRs
>(12)
> > available
> > Apr 2 17:43:12 kulick2 kernel: CPU#1: Thermal monitoring enabled
> > Apr 2 17:43:12 kulick2 kernel: CPU1: Intel(R) Pentium(R) 4 CPU 3.00GHz
> > stepping 09
> > Apr 2 17:43:12 kulick2 kernel: Total of 2 processors activated
>(11911.16
> > BogoMIPS).
> > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[0] = 1
> > Apr 2 17:43:12 kulick2 kernel: cpu_sibling_map[1] = 0
>
>Here you see that you have two CPUs. 0 is the sibling of 1 and 1 to 0.
>This just shows that you have HT. If you were to have a dual xeon, then
>you would see 4 CPUs and two pairs.
>
>-- Steve
>

_________________________________________________________________
News, views and gossip. http://www.msn.co.in/Cinema/ Get it all at MSN
Cinema!

2005-04-03 11:15:17

by Jesper Juhl

[permalink] [raw]
Subject: Re: sched /HT processor

On Sun, 3 Apr 2005, Arun Srinivas wrote:

>
> I looked at my "include/asm-i386/param.h" and the HZ value is 1000.So, I
> suppose the timer interrupt frequency is 1000 times per sec. or once every 1
> millisec.
>
> So, is scheduler_tick() ( for resceduling) called only once every 1 ms?? I am
> measuring the time when 2 of my processes are scheduled in a HT processor.So,
> the possible timedifference of when my 2 processes are scheduled can be only
> the following:
>
> 1) 0 (if both of my processes are scheduled @ the same time since its a HT)
> 2) 1ms ( this is the min. possible time diff.
> 3) some value greater than 1 ms
> Is the above argument correct?

A reschedule can happen once every ms, but also upon returning to
userspace and when returning from an interrupt handler, and also when
something in the kernel explicitly calls schedule() or sleeps (which in
turn results in a call to schedule()). And each CPU runs schedule()
independently.
At least that's my understanding of it - if I'm wrong I hope someone on
the list will correct me.


--
Jesper Juhl


2005-04-03 15:31:12

by Steven Rostedt

[permalink] [raw]
Subject: Re: sched /HT processor

On Sun, 2005-04-03 at 13:17 +0200, Jesper Juhl wrote:
>
> A reschedule can happen once every ms, but also upon returning to
> userspace and when returning from an interrupt handler, and also when
> something in the kernel explicitly calls schedule() or sleeps (which in
> turn results in a call to schedule()). And each CPU runs schedule()
> independently.
> At least that's my understanding of it - if I'm wrong I hope someone on
> the list will correct me.

You're correct, but I'll add some more details here. The actual
schedule happens when needed. A schedule may not take place at every
ms, if the task running is not done with its time slice and no events
happened where another task should preempt it. If an RT task is running
in a FIFO policy, then it will continue to run until it calls schedule
itself or another process of higher priority preempts it.

Now if you don't have PREEMPT turned on, than the schedule won't take
place at all while a task is in the kernel, unless the task explicitly
calls schedule.

What happens on a timer interrupt where a task is done with its time
slice or another event where a schedule should take place, is just the
need_resched flag is set for the task. On return from the interrupt the
flag is checked, and if set a schedule is called.

This is still a pretty basic description of what really happens, and if
you want to learn more, just start searching the kernel code for
schedule and need_resched. Don't forget to look in the asm code (ie
entry.S, and dependent on your arch other *.S files).

-- Steve


2005-04-03 22:52:10

by Arun Srinivas

[permalink] [raw]
Subject: Re: sched /HT processor

Thanks. yes, a reschedule may not take place after a ms, if the currently
running task cannot be preempted by another task.

(1) But, can a reschedule happen within a millisec (or once a process is
scheduled can schedule() be called before the next millisec.) ?

2) Also in case argument (1) is not true, and I want rescheduling to be done
(i.e., schedule() called) in less than 1 ms , can I directly change the HZ
value in <asm-i386/param.h> and recompile my kernel so that my timer
interrupt will occur frequently?

Thanks
Arun

>From: Steven Rostedt <[email protected]>
>To: Jesper Juhl <[email protected]>
>CC: Arun Srinivas <[email protected]>, LKML
><[email protected]>
>Subject: Re: sched /HT processor
>Date: Sun, 03 Apr 2005 11:31:03 -0400
>
>On Sun, 2005-04-03 at 13:17 +0200, Jesper Juhl wrote:
> >
> > A reschedule can happen once every ms, but also upon returning to
> > userspace and when returning from an interrupt handler, and also when
> > something in the kernel explicitly calls schedule() or sleeps (which in
> > turn results in a call to schedule()). And each CPU runs schedule()
> > independently.
> > At least that's my understanding of it - if I'm wrong I hope someone on
> > the list will correct me.
>
>You're correct, but I'll add some more details here. The actual
>schedule happens when needed. A schedule may not take place at every
>ms, if the task running is not done with its time slice and no events
>happened where another task should preempt it. If an RT task is running
>in a FIFO policy, then it will continue to run until it calls schedule
>itself or another process of higher priority preempts it.
>
>Now if you don't have PREEMPT turned on, than the schedule won't take
>place at all while a task is in the kernel, unless the task explicitly
>calls schedule.
>
>What happens on a timer interrupt where a task is done with its time
>slice or another event where a schedule should take place, is just the
>need_resched flag is set for the task. On return from the interrupt the
>flag is checked, and if set a schedule is called.
>
>This is still a pretty basic description of what really happens, and if
>you want to learn more, just start searching the kernel code for
>schedule and need_resched. Don't forget to look in the asm code (ie
>entry.S, and dependent on your arch other *.S files).
>
>-- Steve
>
>

_________________________________________________________________
The MSN Survey!
http://www.cross-tab.com/surveys/run/test.asp?sid=2026&respid=1 Help us help
you better!

2005-04-03 22:52:24

by Arun Srinivas

[permalink] [raw]
Subject: Re: sched /HT processor



>From: Steven Rostedt <[email protected]>
>To: Jesper Juhl <[email protected]>
>CC: Arun Srinivas <[email protected]>, LKML
><[email protected]>
>Subject: Re: sched /HT processor
>Date: Sun, 03 Apr 2005 11:31:03 -0400
>
>On Sun, 2005-04-03 at 13:17 +0200, Jesper Juhl wrote:
> >
> > A reschedule can happen once every ms, but also upon returning to
> > userspace and when returning from an interrupt handler, and also when
> > something in the kernel explicitly calls schedule() or sleeps (which in
> > turn results in a call to schedule()). And each CPU runs schedule()
> > independently.
> > At least that's my understanding of it - if I'm wrong I hope someone on
> > the list will correct me.
>
>You're correct, but I'll add some more details here. The actual
>schedule happens when needed. A schedule may not take place at every
>ms, if the task running is not done with its time slice and no events
>happened where another task should preempt it. If an RT task is running
>in a FIFO policy, then it will continue to run until it calls schedule
>itself or another process of higher priority preempts it.
>
>Now if you don't have PREEMPT turned on, than the schedule won't take
>place at all while a task is in the kernel, unless the task explicitly
>calls schedule.
>
>What happens on a timer interrupt where a task is done with its time
>slice or another event where a schedule should take place, is just the
>need_resched flag is set for the task. On return from the interrupt the
>flag is checked, and if set a schedule is called.
>
>This is still a pretty basic description of what really happens, and if
>you want to learn more, just start searching the kernel code for
>schedule and need_resched. Don't forget to look in the asm code (ie
>entry.S, and dependent on your arch other *.S files).
>
>-- Steve
>
>

_________________________________________________________________
News, views and gossip. http://www.msn.co.in/Cinema/ Get it all at MSN
Cinema!

2005-04-03 23:08:51

by Steven Rostedt

[permalink] [raw]
Subject: Re: sched /HT processor

On Mon, 2005-04-04 at 04:22 +0530, Arun Srinivas wrote:
> Thanks. yes, a reschedule may not take place after a ms, if the currently
> running task cannot be preempted by another task.
>
> (1) But, can a reschedule happen within a millisec (or once a process is
> scheduled can schedule() be called before the next millisec.) ?
>

Yes. For example: a high priority task may be waiting for some IO to
come in. Right after the normal timer interrupt scheduled another task,
the IO may come in and wake the high priority process up. This process
will preempt the other task right away. (ie. less than 1 ms).

> 2) Also in case argument (1) is not true, and I want rescheduling to be done
> (i.e., schedule() called) in less than 1 ms , can I directly change the HZ
> value in <asm-i386/param.h> and recompile my kernel so that my timer
> interrupt will occur frequently?
>

Well, 1) is true, but you can also increase HZ over 1000 if you like,
but that will usually cause more overhead, since, although a schedule
may not take place every HZ, a timer interrupt will.

-- Steve


2005-04-04 23:20:03

by Steven Rostedt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Tue, 2005-04-05 at 04:36 +0530, Arun Srinivas wrote:
> I am scheduling 2 SCHED_FIFO processes and set them affinity( process A runs
> on processor 1 and process B runs on processor 2), on a HT processor.(I did
> this cause I wanted to run them together).Now, in schedule() I measure the
> timedifference between when they are scheduled. I found that when I
> introduce these 2 processes as SCHED_FIFO they are
>
> 1)scheduled only once and run till completion ( they running time is around
> 2 mins.)

If they are the highest priority task, and running as FIFO this is the
proper behavior.

> 2)entire system appears frozen....no mouse/key presses detected until the
> processes exit.
>

If X is not at a higher priority than the test you are running, it will
never get a chance to run.

> >From what I observed does it mean that even the OS / interrupt handler does
> not occur during the entire period of time these real time processes run??
> (as I said the processes run in minutes).

The interrupts do get processed. Now the bottom halves and tasklets may
be starved if they are set at a lower priority than your test (ie. the
ksoftirqd thread). But most likely they are processed too.

> How can I verify that?
>

#!/bin/sh
cat /proc/interrupts
run_test
cat /proc/interrupts

If the run_test takes 2 minutes, you should see a large difference in
the two outputs.

-- Steve

> Thanks
> Arun


2005-04-04 23:11:48

by Arun Srinivas

[permalink] [raw]
Subject: scheduler/SCHED_FIFO behaviour

I am scheduling 2 SCHED_FIFO processes and set them affinity( process A runs
on processor 1 and process B runs on processor 2), on a HT processor.(I did
this cause I wanted to run them together).Now, in schedule() I measure the
timedifference between when they are scheduled. I found that when I
introduce these 2 processes as SCHED_FIFO they are

1)scheduled only once and run till completion ( they running time is around
2 mins.)
2)entire system appears frozen....no mouse/key presses detected until the
processes exit.

>From what I observed does it mean that even the OS / interrupt handler does
not occur during the entire period of time these real time processes run??
(as I said the processes run in minutes).
How can I verify that?

Thanks
Arun

>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: [email protected], LKML <[email protected]>
>Subject: Re: sched /HT processor
>Date: Sun, 03 Apr 2005 19:08:06 -0400
>
>On Mon, 2005-04-04 at 04:22 +0530, Arun Srinivas wrote:
> > Thanks. yes, a reschedule may not take place after a ms, if the
>currently
> > running task cannot be preempted by another task.
> >
> > (1) But, can a reschedule happen within a millisec (or once a process is
> > scheduled can schedule() be called before the next millisec.) ?
> >
>
>Yes. For example: a high priority task may be waiting for some IO to
>come in. Right after the normal timer interrupt scheduled another task,
>the IO may come in and wake the high priority process up. This process
>will preempt the other task right away. (ie. less than 1 ms).
>
> > 2) Also in case argument (1) is not true, and I want rescheduling to be
>done
> > (i.e., schedule() called) in less than 1 ms , can I directly change the
>HZ
> > value in <asm-i386/param.h> and recompile my kernel so that my timer
> > interrupt will occur frequently?
> >
>
>Well, 1) is true, but you can also increase HZ over 1000 if you like,
>but that will usually cause more overhead, since, although a schedule
>may not take place every HZ, a timer interrupt will.
>
>-- Steve
>
>

_________________________________________________________________
Want to meet David Beckham? http://www.msn.co.in/gillette/ Fly to Madrid
with Gillette!

2005-04-05 02:17:09

by Arun Srinivas

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

ok.My program runs for 30 sec. approx. I did
#!/bin/sh
cat /proc/interrupts
run_test
cat /proc/interrupts

and I see there is quite some difference in the numbers.....meaning
interrupts have been processed by the respective processor when my
SCHED_FIFO processes have been running on both the cpu's.

But, then I am not sure why I am getting only 1 reading for the timediff. of
schedule between my 2 processes.I do the following in my schedule() in
sched.c:
( I make the kernel know the pid's of my 2 process...lets say pid1 and pid2)

/* in function schedule() in sched.c*/
schedule()
{
need _resched:
/* after now=sched_clock(); I insert my code
here*/
if(current->pid=pid1)
{
time1=now;
}
elseif (current->pid=pid2)
{
time2=now;
}
/*after i get the 2 values for time1 and
time2*/
timediff= time1-time2; // or
time2 - time1 which ever is greater*/
printk(KERN_ERR "%llu",timediff);
}

So, what I want from the above code is whenever process1 or process2 is
being scheduled measure the time and print the timedifference. But, when I
run my 2 processes as SCHED_FIFO processes i get only one set of
readings....indicating they have been scheduled only once and run till
completion.

But, as we saw above if interrupts have been processed they must have been
scheduled several times(i.e., schedule() called several times). Is my
measurement procedure not correct?

please help.
thanks
arun


>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: [email protected], LKML <[email protected]>
>Subject: Re: scheduler/SCHED_FIFO behaviour
>Date: Mon, 04 Apr 2005 19:17:04 -0400
>
>On Tue, 2005-04-05 at 04:36 +0530, Arun Srinivas wrote:
> > I am scheduling 2 SCHED_FIFO processes and set them affinity( process A
>runs
> > on processor 1 and process B runs on processor 2), on a HT processor.(I
>did
> > this cause I wanted to run them together).Now, in schedule() I measure
>the
> > timedifference between when they are scheduled. I found that when I
> > introduce these 2 processes as SCHED_FIFO they are
> >
> > 1)scheduled only once and run till completion ( they running time is
>around
> > 2 mins.)
>
>If they are the highest priority task, and running as FIFO this is the
>proper behavior.
>
> > 2)entire system appears frozen....no mouse/key presses detected until
>the
> > processes exit.
> >
>
>If X is not at a higher priority than the test you are running, it will
>never get a chance to run.
>
> > >From what I observed does it mean that even the OS / interrupt handler
>does
> > not occur during the entire period of time these real time processes
>run??
> > (as I said the processes run in minutes).
>
>The interrupts do get processed. Now the bottom halves and tasklets may
>be starved if they are set at a lower priority than your test (ie. the
>ksoftirqd thread). But most likely they are processed too.
>
> > How can I verify that?
> >
>
>#!/bin/sh
>cat /proc/interrupts
>run_test
>cat /proc/interrupts
>
>If the run_test takes 2 minutes, you should see a large difference in
>the two outputs.
>
>-- Steve
>
> > Thanks
> > Arun
>
>

_________________________________________________________________
The MSN Survey!
http://www.cross-tab.com/surveys/run/test.asp?sid=2026&respid=1 Help us help
you better!

2005-04-05 03:33:31

by Steven Rostedt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Tue, 2005-04-05 at 07:46 +0530, Arun Srinivas wrote:

>
> So, what I want from the above code is whenever process1 or process2 is
> being scheduled measure the time and print the timedifference. But, when I
> run my 2 processes as SCHED_FIFO processes i get only one set of
> readings....indicating they have been scheduled only once and run till
> completion.
>
> But, as we saw above if interrupts have been processed they must have been
> scheduled several times(i.e., schedule() called several times). Is my
> measurement procedure not correct?

No! Interrupts are not scheduled. When an interrupt goes off, the
interrupt service routine (ISR) is executed. It doesn't need to be
scheduled. It runs right where it interrupted the CPU. That's why you
need to be careful about protecting data that ISRs manipulate with
spin_lock_irqsave. This not only protects against multiple CPUs, but
turns off interrupts so that an interrupt wont be called and one of the
ISRs modify the data you need to be atomic.

Your tasks are running and will be interrupted by an ISR, on return from
the routine, a check is made to see if your tasks should be preempted.
But since they are the highest running tasks and in FIFO mode, the check
determines that schedule should not be called. So you will not see any
schedules while your tasks are running.

Now, if you where running Ingo's RT patch with PREEMPT_HARDIRQ enabled,
and your tasks were of lower priority than the ISR thread handlers, then
you would see the scheduling. Maybe that is what you want?

-- Steve


2005-04-07 01:42:08

by Arun Srinivas

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

I am not sure if my question was clear enough or I couldnt interpret you
answer correctly.(If it was the case I apologise for that).

My question is, as I said I am measuring the schedule time difference
between my 2 of my SCHED_FIFO process in schedule() .But, I get only one set
of readings (i.e., schedule() is being called once which implies my process
is being scheduled only once and run till completion)

Also, as I said my interrupts are being processed during this time.I
inspected /proc/interrupts for this.So, my question was if interrupts heve
been processed several times the 2 SCHED_FIFO process which has been
interrupted must have been resecheduled several times and for this upon
returning from the interrupt handler the schedule() function must have been
called several times to schedule the 2 process which were running.But, as I
said I get only one reading??

>From your reply, I come to understand that when an interrupt interrupts my
user process.....it runs straight way ....but upon return from the interrupt
handler does it not call schedule() to again resume my interrupted process?
Please help.

Thanks
arun



>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: [email protected], LKML <[email protected]>
>Subject: Re: scheduler/SCHED_FIFO behaviour
>Date: Mon, 04 Apr 2005 23:33:05 -0400
>
>On Tue, 2005-04-05 at 07:46 +0530, Arun Srinivas wrote:
>
> >
> > So, what I want from the above code is whenever process1 or process2 is
> > being scheduled measure the time and print the timedifference. But, when
>I
> > run my 2 processes as SCHED_FIFO processes i get only one set of
> > readings....indicating they have been scheduled only once and run till
> > completion.
> >
> > But, as we saw above if interrupts have been processed they must have
>been
> > scheduled several times(i.e., schedule() called several times). Is my
> > measurement procedure not correct?
>
>No! Interrupts are not scheduled. When an interrupt goes off, the
>interrupt service routine (ISR) is executed. It doesn't need to be
>scheduled. It runs right where it interrupted the CPU. That's why you
>need to be careful about protecting data that ISRs manipulate with
>spin_lock_irqsave. This not only protects against multiple CPUs, but
>turns off interrupts so that an interrupt wont be called and one of the
>ISRs modify the data you need to be atomic.
>
>Your tasks are running and will be interrupted by an ISR, on return from
>the routine, a check is made to see if your tasks should be preempted.
>But since they are the highest running tasks and in FIFO mode, the check
>determines that schedule should not be called. So you will not see any
>schedules while your tasks are running.
>
>Now, if you where running Ingo's RT patch with PREEMPT_HARDIRQ enabled,
>and your tasks were of lower priority than the ISR thread handlers, then
>you would see the scheduling. Maybe that is what you want?
>
>-- Steve
>
>

_________________________________________________________________
Send money to India
http://ads.mediaturf.net/event.ng/Type=click&FlightID=17307&AdID=44925&TargetID=9763&Targets=9763&Values=414,868,1093,2385&Redirect=http:%2F%2Fwww.icicibanknripromotions.com%2Fm2i_feb%2Fnri_M2I_feb.jsp%3Fadid%3D44925%26siteid%3D1093%26flightid%3D17307
Get a FREE 30 minute India Calling Card.

2005-04-07 02:28:12

by Steven Rostedt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Thu, 2005-04-07 at 07:11 +0530, Arun Srinivas wrote:
> I am not sure if my question was clear enough or I couldnt interpret you
> answer correctly.(If it was the case I apologise for that).
>
> My question is, as I said I am measuring the schedule time difference
> between my 2 of my SCHED_FIFO process in schedule() .But, I get only one set
> of readings (i.e., schedule() is being called once which implies my process
> is being scheduled only once and run till completion)
>
> Also, as I said my interrupts are being processed during this time.I
> inspected /proc/interrupts for this.So, my question was if interrupts heve
> been processed several times the 2 SCHED_FIFO process which has been
> interrupted must have been resecheduled several times and for this upon
> returning from the interrupt handler the schedule() function must have been
> called several times to schedule the 2 process which were running.But, as I
> said I get only one reading??
>
> >From your reply, I come to understand that when an interrupt interrupts my
> user process.....it runs straight way ....but upon return from the interrupt
> handler does it not call schedule() to again resume my interrupted process?

Exactly! Even going back to a user process, if that process is the
highest priority process than it does not need to call schedule.
Actually the only time it would call schedule, is if the interrupt
called wake_up_process, or did something that needed the need_resched
for the running task set. Even if wake_up_process was called, if the
process was not higher in priority than the running process, then it
would not preempt it.

So...

1) Task running in user land.
2) interrupt goes off, switch to kernel mode.
3) execute interrupt service routine.
4) ISR calls wake_up_process (most likely on ksoftirqd)
5) ksoftirqd not as high a priority as running process (don't set
need_resched)
6) return from interrupt. need_resched not set.
7) go back to user process running in user land.

There, is that clear. schedule is never called. Set ksoftirqd higher in
priority than your tasks, and you might start seeing scheduling. But
sometimes the functions needed to execute are done on return from
interrupt and not though ksoftirqd, so you still might not see a
schedule. But I'm sure you will.

-- Steve


2005-05-01 02:06:18

by Arun Srinivas

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour


hi

I spkoe to you some days ago regarding scheduling two processes together
on a HT.As I told you before I run them as SCHED_FIFO processes.I understood
the theory you told me in your previous reply as to why both of SCHED_FIFO
processes get scheduled only once and then run till completion.

But, sometimes a see a occasional reschedulei.e., the 2 processes get
scheduled one more time after they are scheduled for the 1st time. I ran my
code 100 times and observed this behavior 8 out of 100 times. What could be
the reason?
(As I said i want my 2 processes to run together without any reschedule
after they are scheduled for the first time).

Thanks
Arun
>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: LKML <[email protected]>
>Subject: Re: scheduler/SCHED_FIFO behaviour
>Date: Wed, 06 Apr 2005 22:27:44 -0400
>
>On Thu, 2005-04-07 at 07:11 +0530, Arun Srinivas wrote:
> > I am not sure if my question was clear enough or I couldnt interpret you
> > answer correctly.(If it was the case I apologise for that).
> >
> > My question is, as I said I am measuring the schedule time difference
> > between my 2 of my SCHED_FIFO process in schedule() .But, I get only one
>set
> > of readings (i.e., schedule() is being called once which implies my
>process
> > is being scheduled only once and run till completion)
> >
> > Also, as I said my interrupts are being processed during this time.I
> > inspected /proc/interrupts for this.So, my question was if interrupts
>heve
> > been processed several times the 2 SCHED_FIFO process which has been
> > interrupted must have been resecheduled several times and for this upon
> > returning from the interrupt handler the schedule() function must have
>been
> > called several times to schedule the 2 process which were running.But,
>as I
> > said I get only one reading??
> >
> > >From your reply, I come to understand that when an interrupt interrupts
>my
> > user process.....it runs straight way ....but upon return from the
>interrupt
> > handler does it not call schedule() to again resume my interrupted
>process?
>
>Exactly! Even going back to a user process, if that process is the
>highest priority process than it does not need to call schedule.
>Actually the only time it would call schedule, is if the interrupt
>called wake_up_process, or did something that needed the need_resched
>for the running task set. Even if wake_up_process was called, if the
>process was not higher in priority than the running process, then it
>would not preempt it.
>
>So...
>
>1) Task running in user land.
>2) interrupt goes off, switch to kernel mode.
>3) execute interrupt service routine.
>4) ISR calls wake_up_process (most likely on ksoftirqd)
>5) ksoftirqd not as high a priority as running process (don't set
>need_resched)
>6) return from interrupt. need_resched not set.
>7) go back to user process running in user land.
>
>There, is that clear. schedule is never called. Set ksoftirqd higher in
>priority than your tasks, and you might start seeing scheduling. But
>sometimes the functions needed to execute are done on return from
>interrupt and not though ksoftirqd, so you still might not see a
>schedule. But I'm sure you will.
>
>-- Steve
>
>

_________________________________________________________________
Trailblazer Narain Karthikeyan http://server1.msn.co.in/sp05/tataracing/
Will he be rookie of the year?

2005-05-01 15:54:50

by Steven Rostedt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Sun, 2005-05-01 at 07:36 +0530, Arun Srinivas wrote:
> hi
>
> I spkoe to you some days ago regarding scheduling two processes together
> on a HT.As I told you before I run them as SCHED_FIFO processes.I understood
> the theory you told me in your previous reply as to why both of SCHED_FIFO
> processes get scheduled only once and then run till completion.
>
> But, sometimes a see a occasional reschedulei.e., the 2 processes get
> scheduled one more time after they are scheduled for the 1st time. I ran my
> code 100 times and observed this behavior 8 out of 100 times. What could be
> the reason?
> (As I said i want my 2 processes to run together without any reschedule
> after they are scheduled for the first time).

The only way a real time priority process of SCHED_FIFO gets
rescheduled, is if the process voluntarily calls schedule (you call a
system call that calls schedule), or a higher priority process gets
scheduled. I don't know what your program is doing, or what priorities
that they are running with to know if something like this has occurred.

Also, if the programs you are running haven't been locked into memory
(they exist partially on the hard drive still), then it will take time
to map the code into memory when that code is called, and a schedule
will occur then as well.

-- Steve


2005-05-02 05:27:46

by Arun Srinivas

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

The 2 processes which I am measuring are parent and child processes.I want
both of'em to be scheduled at the same time.My code simply does the
following:

1) From main(i.e., parent) create a shared memory seg. using shmget() and
shmat(). This is for communication between parent and child. I am trying to
use this as a locking mechanism to make them tightly coupled so that one
does not race before the other.
2) create child by fork() and call shmat() to attach this segment to child
too
3) In parent and child call ioctl() to pass their PID's from user space to
kernel space...so that I can measure when the particular PID's are scheduled
in the scheduler

I suppose shmget() dosent use a system call.So still confused about the
occasional resechedule behavior.



>From: Steven Rostedt <[email protected]>
>To: Arun Srinivas <[email protected]>
>CC: [email protected]
>Subject: Re: scheduler/SCHED_FIFO behaviour
>Date: Sun, 01 May 2005 11:51:25 -0400
>
>On Sun, 2005-05-01 at 07:36 +0530, Arun Srinivas wrote:
> > hi
> >
> > I spkoe to you some days ago regarding scheduling two processes
>together
> > on a HT.As I told you before I run them as SCHED_FIFO processes.I
>understood
> > the theory you told me in your previous reply as to why both of
>SCHED_FIFO
> > processes get scheduled only once and then run till completion.
> >
> > But, sometimes a see a occasional reschedulei.e., the 2 processes get
> > scheduled one more time after they are scheduled for the 1st time. I ran
>my
> > code 100 times and observed this behavior 8 out of 100 times. What
>could be
> > the reason?
> > (As I said i want my 2 processes to run together without any reschedule
> > after they are scheduled for the first time).
>
> The only way a real time priority process of SCHED_FIFO gets
>rescheduled, is if the process voluntarily calls schedule (you call a
>system call that calls schedule), or a higher priority process gets
>scheduled. I don't know what your program is doing, or what priorities
>that they are running with to know if something like this has occurred.
>
>Also, if the programs you are running haven't been locked into memory
>(they exist partially on the hard drive still), then it will take time
>to map the code into memory when that code is called, and a schedule
>will occur then as well.
>
>-- Steve
>
>

_________________________________________________________________
Thinking of Marriage.
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Think
BharatMatrimony.com

2005-05-02 10:38:17

by Florian Schmidt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Mon, 02 May 2005 10:57:29 +0530
"Arun Srinivas" <[email protected]> wrote:

> 1) From main(i.e., parent) create a shared memory seg. using shmget() and
> shmat(). This is for communication between parent and child. I am trying to
> use this as a locking mechanism to make them tightly coupled so that one
> does not race before the other.
> 2) create child by fork() and call shmat() to attach this segment to child
> too
> 3) In parent and child call ioctl() to pass their PID's from user space to
> kernel space...so that I can measure when the particular PID's are scheduled
> in the scheduler
>
> I suppose shmget() dosent use a system call.So still confused about the
> occasional resechedule behavior.

You might try the user triggered tracing which is available with Ingo's
realtime preemption patches.

Enable the latency tracing in the kernel confgig and

echo 1 > /proc/sys/kernel/user_triggered_tracing

then in your code you want to be checked do this before the section:

gettimeofday (1, 1)

and

gettimeofday (1, 0)

after the section you want to be checked.. Every reschedule of the task
will result in a signal SIGUSR2 sent to your program and a latency trace
in the syslog..

..i think

Flo


--
Palimm Palimm!
http://affenbande.org/~tapas/

2005-05-02 16:37:26

by Steven Rostedt

[permalink] [raw]
Subject: Re: scheduler/SCHED_FIFO behaviour

On Mon, 2005-05-02 at 10:57 +0530, Arun Srinivas wrote:
> The 2 processes which I am measuring are parent and child processes.I want
> both of'em to be scheduled at the same time.My code simply does the
> following:
>
> 1) From main(i.e., parent) create a shared memory seg. using shmget() and
> shmat(). This is for communication between parent and child. I am trying to
> use this as a locking mechanism to make them tightly coupled so that one
> does not race before the other.
> 2) create child by fork() and call shmat() to attach this segment to child
> too
> 3) In parent and child call ioctl() to pass their PID's from user space to
> kernel space...so that I can measure when the particular PID's are scheduled
> in the scheduler
>
> I suppose shmget() dosent use a system call.So still confused about the
> occasional resechedule behavior.

Uhh, yes it does:

$ vi shmget.c

i
#include <sys/ipc.h>
#include <sys/shm.h>

int main()
{
shmget(123,123,0);
return 0;
}
:wq

$ gcc -o shmget shmget.c
$ strace ./shmget
[snip]
shmget(123, 123, 0) = -1 ENOENT (No such file or directory)
[snip]
---

So it is a system call.

Now, I still don't know when you are using your locking (which is also a
system call) to run your code. A child is usually added to the same run
queue as the parent. So this means that it will be scheduled on the
same CPU as the parent. But if the other CPU scheduler notices that the
scheduling of processes on the CPUs are unbalanced, then it will pull
tasks from one CPU to the other. But once the tasks are running as
SCHED_FIFO on different CPUs, then they shouldn't be preempted.

BUT!!!

looking at the system call code for shmget:

asmlinkage long sys_shmget (key_t key, size_t size, int shmflg)
{
struct shmid_kernel *shp;
int err, id = 0;

down(&shm_ids.sem); ==========>>>>> Here we can schedule
if (key == IPC_PRIVATE) {
err = newseg(key, shmflg, size);
} else if ((id = ipc_findkey(&shm_ids, key)) == -1) {
if (!(shmflg & IPC_CREAT))
err = -ENOENT;
else
err = newseg(key, shmflg, size);
} else if ((shmflg & IPC_CREAT) && (shmflg & IPC_EXCL)) {
err = -EEXIST;
} else {
shp = shm_lock(id);
if(shp==NULL)
BUG();
if (shp->shm_segsz < size)
err = -EINVAL;
else if (ipcperms(&shp->shm_perm, shmflg))
err = -EACCES;
else {
int shmid = shm_buildid(id, shp->shm_perm.seq);
err = security_shm_associate(shp, shmflg);
if (!err)
err = shmid;
}
shm_unlock(shp);
}
up(&shm_ids.sem);

return err;
}


So, if both the parent and child are going for the same shared memory,
you can cause one to schedule.

-- Steve