28.08.2015 Views

The Design and Implementation of the Anykernel and Rump Kernels

1F3KDce

1F3KDce

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

91<br />

is bound to a certain rump kernel virtual CPU simply has migration disabled. This<br />

way, <strong>the</strong> scheduler will always try to acquire <strong>the</strong> same CPU for <strong>the</strong> thread.<br />

Scheduler Priorities<br />

<strong>The</strong> assumption is that a rump kernel is configured with a number <strong>of</strong> virtual CPUs<br />

which is equal or greater to <strong>the</strong> number <strong>of</strong> frequently executing threads. Despite<br />

this configuration, a rump kernel may run into a situation where <strong>the</strong>re will be<br />

competition for virtual CPUs. <strong>The</strong>re are two ways to approach <strong>the</strong> issue <strong>of</strong> deciding<br />

in which order threads should be given a rump CPU context: build priority support<br />

into <strong>the</strong> rump CPU scheduler or rely on host thread priorities.<br />

To examine <strong>the</strong> merits <strong>of</strong> having priority support in <strong>the</strong> rump CPU scheduler, we<br />

consider <strong>the</strong> following scenario. Thread A has higher priority than thread B in <strong>the</strong><br />

rump kernel. Both are waiting for <strong>the</strong> same rump kernel virtual CPU. Even if <strong>the</strong><br />

rump CPU scheduler denies thread B entry because <strong>the</strong> higher priority thread A<br />

is waiting for access, <strong>the</strong>re is no guarantee that <strong>the</strong> host schedules thread A before<br />

thread B could <strong>the</strong>oretically run to completion in <strong>the</strong> rump kernel. By this logic,<br />

it is better to let host priorities dictate, <strong>and</strong> h<strong>and</strong> out rump kernel CPUs on a<br />

first-come-first-serve basis. <strong>The</strong>refore, we do not support thread priorities in <strong>the</strong><br />

rump CPU scheduler. It is <strong>the</strong> client’s task to call pthread_setschedparam() or<br />

equivalent if it wants to set a thread’s priority.<br />

3.3.2 Interrupts <strong>and</strong> S<strong>of</strong>t Interrupts<br />

As mentioned in Section 2.3.3, a rump kernel CPU cannot be preempted. <strong>The</strong> mechanism<br />

<strong>of</strong> how an interrupt gets delivered requires preemption, so we must examine<br />

that we meet <strong>the</strong> requirements <strong>of</strong> both hardware interrupts <strong>and</strong> s<strong>of</strong>t interrupts.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!