1 |
"Mihir Sevak" <mihir.sevak@×××××.com> posted |
2 |
48fcf8860605260703m2264be8hcd5a5fc9d43c86dd@××××××××××.com, excerpted |
3 |
below, on Fri, 26 May 2006 10:03:24 -0400: |
4 |
|
5 |
> i am using C as a programming language. I have an AMD 64 dual core |
6 |
> system. Is there any way i can take charge of those two processors and |
7 |
> command them which thread should run on which processor??? I am prepared |
8 |
> with scheduling mechanism but only thing i am lacking is how to take |
9 |
> charge and decide that which processor should run which thread. |
10 |
|
11 |
I'm rather far from an expert in the field, but AFAIK, you use kernel |
12 |
scheduling domains for that, and configure your app to use a specific |
13 |
scheduling domain. AFAIK, the functionality is fairly new, and you'll |
14 |
need 2.6.16 or even the 2.6.17-rcs, plus some special user side utilities |
15 |
to configure and manage the domains, to get it working. |
16 |
|
17 |
Automatic kernel SMP scheduling normally does a pretty good job, noting of |
18 |
course that on some hardware, some chipset elements may be connected to |
19 |
only one of the CPUs (tho that shouldn't be a problem for dual-core), and |
20 |
the various costs of switching between cores on the same CPU, as opposed |
21 |
to different CPU/sockets, as opposed to different hosts (in a clustering |
22 |
environment), what with local vs remote memory and cache coherency and the |
23 |
like. Specifying a CPU/core is now possible using the special tools |
24 |
mentioned above, but it's seldom worth the trouble, and can actually be |
25 |
worse. It may be better to tweak the various tweakables exposed by the |
26 |
kernel for its automated scheduling, changing how it chooses to switch |
27 |
CPUs if one is busier than the other. |
28 |
|
29 |
FWIW, I have a dual Opteron system here, single-cores. I expect to be |
30 |
upgrading later this year to dual-cores, for a 4-core system on dual |
31 |
socket-940. I've generally been fairly happy with the kernel's scheduling |
32 |
as-is, allowing for when I'm running single-threaded apps that /can't/ |
33 |
divide the work. If the app is multithreaded, or I'm running several apps |
34 |
in parallel, the kernel generally does a pretty good job of keeping things |
35 |
balanced. Back when I had a single-disk system, that was often the |
36 |
bottleneck. However, with a 4 disk RAID system (kernel-RAID, RAID-6 for |
37 |
most of it, RAID-0 for the performance critical redundancy unneeded stuff, |
38 |
RAID-1 for /boot) and 8 gig of memory, the bottleneck is again usually the |
39 |
CPUs, thus the planned upgrade to 2 by dual-cores later this year. |
40 |
|
41 |
Of course, that's for personal desktop/workstation use. If I were running |
42 |
something less general purpose, say a big database server or the like, |
43 |
there would indeed be reason to think about specific tuning including |
44 |
possibly confining some tasks to specific CPUs. |
45 |
|
46 |
-- |
47 |
Duncan - List replies preferred. No HTML msgs. |
48 |
"Every nonfree program has a lord, a master -- |
49 |
and if you use the program, he is your master." Richard Stallman |
50 |
|
51 |
-- |
52 |
gentoo-amd64@g.o mailing list |