Arachne Kernel API

void setCoreRequestPriority(int prio)
// Q1: Do we want to have different priorities inside our request? Say, we
// really really need at least 2 cores but it would be nice to have 3 in total
// Q2: Should we try to discourage applications from just using the highest
// priority selfishly?
 
/**
  * Set the desired number of cores dedicated to this process.
  *
  * This kernel will try to allocate the desired number of cores synchronously
  * and then return the actual number of allocated cores.
  *
  * The actual level of parallelism doesn't necessarily match this number
  * during the process's lifetime. First, the kernel may not have enough
  * cores to fullfil this requirement. Second, there could be normal kernel
  * threads in this process that are scheduled by the CFS scheduler running
  * on other cores.
  */
int setDesiredNumOfCores(int n);
// IMPLEMENTATION NOTES: 1) The kernel allocates a core X by moving one of its
// binding KTs from the wait queue to the run queue. This way, when core X
// gets to run `pick_next_task` next time, the scheduler will schedule this
// runnable KT before any other threads because our Arachne scheduling class
// has the highest priority. 2) The kernel will save the desired number of cores
// in the proc struct because it may not have enough cores right now but still
// want to try again later.
// Q1: What more information/constraint about the cores do we want to convey
// to the kernel?

/**
  * Return the actual number of cores allocated to this process.
  */
int getNumOfAllocCores();
 
// We use the existing syscall sched_yield() to relinquish the core. However,
// our own implementation in the Arachne scheduling class will put the calling
// thread into a wait queue to ensure it does not get scheduled automatically.
int sched_yield();
// NOTES: Relinquishing a core voluntarily does not affect the desired number
// of cores dedicated to the process.
 

 

 

Medium-term goals

  • Dedicate cores
  • Release cores
  • Preempt cores
  • Hypertwins

 

Long-term goals (after paper deadline)

  • Complex core topologies
  • Hypervisor kernel negotiation