Hyperthreading (again)

IIRC it has been previously stated that the QNX6 SMP kernel should “just
work” on a hyperthreading processor such as the Xeon, since the 2nd
(virtual) processor appears as a 2nd physical processor.

However an interesting article that I have just been reading on Linux
support for hyperthreading includess the following changes in a list of what
changes needed to be made to the Linux kernel in order for it to properly
support hyperthreading:
a… 128-byte lock alignment
b… Detection of Hyper-Threading enabled processor and starting the
logical processor as if machine was SMP
c… Optimization to scheduler when system is idle to prioritize scheduling
on a physical processor before scheduling on logical processor
d… Offset user stack to avoid 64K aliasing
Could someone please clarify whether these corresponding changes are already
in the QNX6 kernel, or explain why they are not required for QNX?

FYI the full article is at
http://www-106.ibm.com/developerworks/linux/library/l-htl/?ca=dgr-lnxw01Hype
rThread

FWIW this article shows that under Linux hyperthreading results in a
performance “gain” of between -2% and 30% depending on the application type
and mix. Not surprisiningly, heavily multi-threaded applications show the
best gains. Basic process-creation primitives (fork+exec, system, etc) show
the most degradation.

Rob Rutherford

I understand QNX has made a different change to better support hyperthreaded
CPUs - they are detecting those and allowing threads to migrate between two
‘hyperCPUs’ whereas they’d not let them migrate between real CPUs due to
cache miss penalties.

I do not know about the issues below.

– igor

“Robert Rutherford” <ruzz@NoSpamPlease.ruzz.com> wrote in message
news:b04puv$die$1@inn.qnx.com

IIRC it has been previously stated that the QNX6 SMP kernel should “just
work” on a hyperthreading processor such as the Xeon, since the 2nd
(virtual) processor appears as a 2nd physical processor.

However an interesting article that I have just been reading on Linux
support for hyperthreading includess the following changes in a list of
what
changes needed to be made to the Linux kernel in order for it to properly
support hyperthreading:
a… 128-byte lock alignment
b… Detection of Hyper-Threading enabled processor and starting the
logical processor as if machine was SMP
c… Optimization to scheduler when system is idle to prioritize
scheduling
on a physical processor before scheduling on logical processor
d… Offset user stack to avoid 64K aliasing
Could someone please clarify whether these corresponding changes are
already
in the QNX6 kernel, or explain why they are not required for QNX?

FYI the full article is at

http://www-106.ibm.com/developerworks/linux/library/l-htl/?ca=dgr-lnxw01Hype
rThread

FWIW this article shows that under Linux hyperthreading results in a
performance “gain” of between -2% and 30% depending on the application
type
and mix. Not surprisiningly, heavily multi-threaded applications show the
best gains. Basic process-creation primitives (fork+exec, system, etc)
show
the most degradation.

Rob Rutherford

Robert Rutherford <ruzz@nospamplease.ruzz.com> wrote:

However an interesting article that I have just been reading on Linux
support for hyperthreading includess the following changes in a list of what
changes needed to be made to the Linux kernel in order for it to properly
support hyperthreading:

AFAIK those are well known optimizations published by Intel.

chris


Chris McKillop <cdm@qnx.com> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –
http://qnx.wox.org/