Page 1 of 1

Different Capabilities on SMP Systems

Posted: Sat Dec 27, 2008 8:58 pm
by JohnnyTheDon
On an Intel SMP system, is it possible for different processors to have different capabilities? For example, could one processor not support SSE while another processor does?

Re: Different Capabilities on SMP Systems

Posted: Sat Dec 27, 2008 11:52 pm
by Brendan
Hi,
JohnnyTheDon wrote:On an Intel SMP system, is it possible for different processors to have different capabilities? For example, could one processor not support SSE while another processor does?
In theory, yes. Intel's "MultiProcessor Specification" even has a paragraph about it:
Intel wrote:B.8 Supporting Unequal Processors

Some MP operating systems that exist today do not support processors of different types, speeds, or capabilities. However, as processor lifetimes increase and new generations of processors arrive, the potential for dissimilarity among processors increases. The MP specification addresses this potential by providing an MP configuration table to help the operating system configure itself. Operating system writers should factor in processor variations, such as processor type, family, model, and features, to arrive at a configuration that maximizes overall system performance. At a minimum, the MP operating system should remain operational and should support the common features of unequal processors.
In practice, "some MP operating systems" that existed back when this was written (1990's) still exist today and haven't really improved a lot - they still have problems with unequal processors AFAIK. Because of this it's extremely rare to find a computer that has "noticeably unequal" processors (slight variations isn't as rare - e.g. same speed, same features and same family/model but different stepping).

As a minimum I'd follow Intel's recommendations - get the feature flags from CPUID from each CPU, and AND them together to find the features that are supported by all CPUs. Also, due to power/temperature management (and things like Core I7's "Turbo Mode"), identical CPUs may be running at different speeds (including different cores in the same chip) - your OS should be designed to handle every CPU running at a different speed, and every CPU changing it's speed independently.

Of course that's just the minimum. It can be a good idea to support more than the minimum (even if it's just for bragging/marketing reasons ;) ). For example, most OS's already support "CPU affinity" - it'd be relatively easy to use this to restrict processes to CPUs that support the features that the process uses; so that (for e.g.) if there's 2 CPUs and one doesn't support MMX, then a process that uses MMX is restricted to the CPU that supports MMX. The hard part is the kernel, as all CPUs run the kernel (CPU affinity won't help) and it also makes it a little harder to handle CPU errata/bugs (different CPUs that need different workarounds).


Cheers,

Brendan