Page 1 of 1

Multiple cores, multiple rings, microkernels

Posted: Sun Feb 23, 2014 2:20 am
by iamtim
From what I understand the main complaint about microkernels is that the increased number of context switches causes a performance hit.

My CPU has 8 cores, my next one will probably have 16.

Why not dedicate one core to running in ring 0 while the rest stay in ring 3?

Or maybe instead of dedicating a core, the scheduler could just be programmed to try to keep processes in the same ring on the same core.

Is there any reason why this wouldn't work?

Re: Multiple cores, multiple rings, microkernels

Posted: Sun Feb 23, 2014 5:31 am
by thepowersgang
Context switch in this argument doesn't mean ring changes (they're pretty cheap nowadays with SYSENTER/SYSCALL)

Context switch means changing address spaces (which means flushing caches, which is expensive)

Re: Multiple cores, multiple rings, microkernels

Posted: Mon Feb 24, 2014 9:54 am
by bwat
iamtim wrote:From what I understand the main complaint about microkernels is that the increased number of context switches causes a performance hit.

My CPU has 8 cores, my next one will probably have 16.

Why not dedicate one core to running in ring 0 while the rest stay in ring 3?

Or maybe instead of dedicating a core, the scheduler could just be programmed to try to keep processes in the same ring on the same core.

Is there any reason why this wouldn't work?
All non-compute bound processes will be running on the same core. It wouldn't be surprising to see some cores at a high load whilst other cores were idle. See Chapter 9 of UNIX Systems for Modern Architectures, Schimmel for master-slave kernel design, and for why high load is bad see http://www.treewhimsy.com/TECPB/Article ... sights.pdf
thepowersgang wrote: Context switch means changing address spaces (which means flushing caches, which is expensive)
You're assuming separate address spaces and making other assumptions about cache design. See the first 7 chapters of UNIX Systems for Modern Architectures, Schimmel for cache design and how it impact context switches is UNIX like process designs.