Different Capabilities on SMP Systems

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Different Capabilities on SMP Systems

Post 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?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Different Capabilities on SMP Systems

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply