Scaling on XP vs. 2000

[I don’t think this is a kernel issue but this list may know the answer.]

I have a multi-threaded user-mode app and a dual CPU box that can boot
either Win2000 or WinXP. When I boot Win2000 and run load/performance tests,
I see both CPUs get used. When I boot WinXP and run the exact same binary, I
see only one CPU get used. Any ideas why or where to look to diagnose? I
make no calls to any APIs that set process or thread affinity.

db

At 20.53 28/05/2002, you wrote:

I have a multi-threaded user-mode app and a dual CPU box that can boot
either Win2000 or WinXP. When I boot Win2000 and run load/performance
tests, I see both CPUs get used. When I boot WinXP and run the exact same
binary, I see only one CPU get used. Any ideas why or where to look to
diagnose? I make no calls to any APIs that set process or thread affinity.

what version of Windows XP? support for more than one processor may have
been intentionally disabled in some versions

What do you mean by “I see both CPUs get used”?
On NT, I can run a single compute bound thread, and the task manager will
show each CPU on a dual about 1/2 busy. This is a poor scheduling decision
on NT’s part for CPUs with large caches. Perhaps this is fixed in XP, and only one thread of
the app uses substantial CPU time.

Also, NT, and I assume XP, CPU time is measured by sampling on clock interrupts,
which works fine for everything except threads that wait on timers, which tend not to get
measured. So threads that wakeup on timer events and run less than 15 ms will tend to
show zero time.

VTune from Intel will let you look at this type of issue, and it uses a different
clock for sampling, that is asynchronous to the NT scheduling clock.

“Dave Burns” wrote in message news:xxxxx@ntdev…
>
> [I don’t think this is a kernel issue but this list may know the answer.]
>
> I have a multi-threaded user-mode app and a dual CPU box that can boot
> either Win2000 or WinXP. When I boot Win2000 and run load/performance tests,
> I see both CPUs get used. When I boot WinXP and run the exact same binary, I
> see only one CPU get used. Any ideas why or where to look to diagnose? I
> make no calls to any APIs that set process or thread affinity.
>
> db
>
>
>

By that I mean that I look in Task Manager and the graphs for both CPUs show
activity. I also set up two counters in PerfMon to watch CPU usage and get
the same graphs. On XP, only one CPU shows activity, the other goes idle. I
agree this makes sense if only one thread is compute-bound but I’ve got
about 70 threads that are compute bound. Seems to me that both CPUs should
be close to pegged.

I haven’t used VTune in years. Do recent versions show scheduling decisions?

db


What do you mean by “I see both CPUs get used”?
On NT, I can run a single compute bound thread, and the task manager will
show each CPU on a dual about 1/2 busy. This is a poor scheduling decision
on NT’s part for CPUs with large caches. Perhaps this is fixed in XP, and
only one thread of
the app uses substantial CPU time.

Also, NT, and I assume XP, CPU time is measured by sampling on clock
interrupts,
which works fine for everything except threads that wait on timers, which
tend not to get
measured. So threads that wakeup on timer events and run less than 15 ms
will tend to
show zero time.

VTune from Intel will let you look at this type of issue, and it uses a
different
clock for sampling, that is asynchronous to the NT scheduling clock.

“Dave Burns” wrote in message
news:xxxxx@ntdev…
>
> [I don’t think this is a kernel issue but this list may know the answer.]
>
> I have a multi-threaded user-mode app and a dual CPU box that can boot
> either Win2000 or WinXP. When I boot Win2000 and run load/performance
tests,
> I see both CPUs get used. When I boot WinXP and run the exact same binary,
I
> see only one CPU get used. Any ideas why or where to look to diagnose? I
> make no calls to any APIs that set process or thread affinity.
>
> db
>
>
>

“Dave Burns” wrote in message news:xxxxx@ntdev…
>
> By that I mean that I look in Task Manager and the graphs for both CPUs show
> activity. I also set up two counters in PerfMon to watch CPU usage and get
> the same graphs. On XP, only one CPU shows activity, the other goes idle. I
> agree this makes sense if only one thread is compute-bound but I’ve got
> about 70 threads that are compute bound. Seems to me that both CPUs should
> be close to pegged.
I can’t explain why XP does this, but if you have a large number of threads,
each of which runs for a very short time, and then wakes up another thread
and blocks, the throughput can be better if all threads are run on the same CPU.
This is pretty much always true if you are ping-ponging a byte on a pipe between
two threads, i.e.,
while (1) { read(…); write() }

So XP may be attempting to enforce such affinity. Is the application performance
better on NT? If not, then it might be making the right decision.
-DH

>
> I haven’t used VTune in years. Do recent versions show scheduling decisions?
I haven’t used VTune on XP yet.
-DH

>
> db
>
>
> ---------------------------------------------
>
> What do you mean by “I see both CPUs get used”?
> On NT, I can run a single compute bound thread, and the task manager will
> show each CPU on a dual about 1/2 busy. This is a poor scheduling decision
> on NT’s part for CPUs with large caches. Perhaps this is fixed in XP, and
> only one thread of
> the app uses substantial CPU time.
>
> Also, NT, and I assume XP, CPU time is measured by sampling on clock
> interrupts,
> which works fine for everything except threads that wait on timers, which
> tend not to get
> measured. So threads that wakeup on timer events and run less than 15 ms
> will tend to
> show zero time.
>
> VTune from Intel will let you look at this type of issue, and it uses a
> different
> clock for sampling, that is asynchronous to the NT scheduling clock.
>
> “Dave Burns” wrote in message
> news:xxxxx@ntdev…
> >
> > [I don’t think this is a kernel issue but this list may know the answer.]
> >
> > I have a multi-threaded user-mode app and a dual CPU box that can boot
> > either Win2000 or WinXP. When I boot Win2000 and run load/performance
> tests,
> > I see both CPUs get used. When I boot WinXP and run the exact same binary,
> I
> > see only one CPU get used. Any ideas why or where to look to diagnose? I
> > make no calls to any APIs that set process or thread affinity.
> >
> > db
> >
> >
> >
>
>
>