Re: Separating processes per CPU in a SMP system

Aaron Wrasman (awrasman@enchanted.net)
Fri, 19 Feb 1999 08:11:01 -0600


On Fri, Feb 19, 1999 at 01:21:42PM +0100, Ingo Molnar wrote:
>
> On Fri, 19 Feb 1999, Alexandre Hautequest wrote:
>
> > Is there some manner to i separate proccesses between processors? Like, if
> > i have a machine with 4 processors, for example, and i want that httpd uses
> > just processor 0, and sendmail just processor 1, and orasrv uses processors
> > 2 and 3, and maybe they can be changed, with an entry at cron's or somewhat
> > like this.
>
> the kernel dynamically decides which CPU should run what process. The
> kernel has much better knowledge about caching issues, working set,
> scheduling frequency, interrupt traffic, etc. Other than hard-RT purposes,
> i doubt it could be desirable to explicitly bind processes to CPUs.
>
> -- mingo

But on many OSs, you can lock a process to a processor. I know this is true
under HPUX and AIX at least under certain conditions it does become useful.

Say you have at least 2 processes. One of them is doing work to feed another
and then another. If they are each tied to a different processor, they act
better in a pipeline. They can each do their little bit in the pipeline of
work.

Example:

find /usr/local -xdev | cpio -oc | compress -9c | dd of=/dev/rmt0 bs=32768

For small amounts data it won't matter. But I have seen this go much quicker
when the processes were tied to different processors. It shaved time from 2
hours to 1 hour 45 minutes on AIX in one case. Of course this system was doing many
other things at time.

It is off by default on AIX and HPUX. It would be interesting to see if
similiar things are ever true under Linux versus saying that the kernel will
always know better. Of course I say this and I run mostly UP on linux.

Aaron

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/