[Nottingham] Multi-processor machines
Graeme Fowler
graeme at graemef.net
Wed Feb 9 22:43:25 GMT 2005
On Wed, 9 Feb 2005, Mike Cardwell wrote:
> Because the processing can potentially use a lot of memory, a queue is
> created and one image is processed at a time to stop the machine from
> thrashing it's swap.
...OK, this is reasonably sensible if your system doesn't have enough physical
RAM to do multiple simultaneous jobs.
> I am soon going to have access to a machine with dual cpus. It would make
> sense to have both cpus working on separate images simultaneously.
But...
> My question is, is it possible with Linux to force processes to run on
> particular CPU's? Or am I missing the point entirely?
...if RAM is your problem, how is using two CPUs going to help? If you run up
two simultaneous processing threads then surely (from your single process
model) you're going to end up in thrashland?
> I doubt it makes any difference, but the program I'm using is something I
> wrote my self in perl.
IIRC there's a couple of ways (but I can't remember the detail, and it may
have changed again in 2.6) you can force jobs to run on a specific CPU, but as
a lot of people have spent an awful lot of effort and time getting the SMP
schedulers right inside the kernel in my experience it's better to let the
schedulers do the job for you.
If you have a DP box, you get twice the queue length for a given load average
as there's double the headroom for running processes waiting for CPU (think
PHP scripts, you've actually seen this a lot!).
What I've often seen is that attempts to force jobs onto a specific CPU will
get overridden in kernel space anyway. Shame I can't remember the detail; I
think a trawl of LKML might help you out a bit here.
Graeme
More information about the Nottingham
mailing list