Re: Help clear up a misconception about SMP systems

Oliver Xymoron (oxymoron@waste.org)
Fri, 9 Oct 1998 15:59:10 -0500 (CDT)


On Fri, 9 Oct 1998, Alex Buell wrote:

> When two or more processors come into play, what is the increase rate of
> processing over a single processor? Is does it works out as 100% increase
> over that of a single processor or is it limited by other factors such as
> caching, disk i/o or whatever?

It very much depends on the problem. CPU-bound tasks with a small cache
footprint (password crackers are often a good example) will likely show a
nearly linear speed increase with number of processors. However, if your
process was entirely disk-bound on a single processor, don't expect to see
any performance improvement.

There are a number of factors involved, including:

- disk bandwidth
- bus speeds
- memory bandwidth
- cache sizes
- number of processes
- cache sizes
- processor speed

A n-way SMP machine has effectively n x processor speed and L1 cache (and
L2 cache in many cases too), but does nothing for the rest of the
potential bottlenecks. And it adds overhead: multiple simultaneous threads
of kernel execution (just like userland threads) require locking
mechanisms to protect against simultaneous access to shared data
structures. The locking means if a processor tries to access something
that's already in use, it has to wait. For a dual system, this means
you're back to using one processor. And simply having the locks in the
code has a small cost on kernel size and speed. And finally, whenever the
kernel does certain memory operations, like adjusting the memory map, it
has to synchronize this info with the other processors, a major
performance hit.

--
 "Love the dolphins," she advised him. "Write by W.A.S.T.E.." 

- 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/