Skip to content
Snippets Groups Projects
  1. May 29, 2014
    • Nadav Har'El's avatar
      sched: remove unnecessary reschedule_from_interrupt() parameter. · 5f5b6144
      Nadav Har'El authored
      
      Before commit 202b2ccc,
      cpu::reschedule_from_interrupt() needed to know whether we were called
      from an interrupt (preempt=true) or as an ordinary function (preempt=false),
      to know whether or not to save the FPU state.
      
      As we now save the FPU state at the interrupt code,
      reschedule_from_interrupt() no longer needs to deal with this, and so this
      patch removes the unneeded paramter "preempt" to that function.
      
      One thing we are losing in this patch is the "sched_preempt" tracepoint,
      which we previously had when an interrupt caused an actual context switch
      (not just a reschedule call, but actually switching to a different thread).
      We still have the "sched_switch" tracepoint which traces all the context
      switches, which is probably more interesting anyway.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      5f5b6144
  2. May 28, 2014
  3. May 27, 2014
  4. May 26, 2014
  5. May 23, 2014
  6. May 22, 2014
  7. May 21, 2014
  8. May 19, 2014
    • Tomasz Grabiec's avatar
      sched: strengthen the fence in migrate_disable() · 4dbcc248
      Tomasz Grabiec authored
      
      memory_order_acquire does not prevent previous stores from moving past
      the barrier so if the _migration_lock_counter incrementation is split
      into two accesses, this is eligible:
      
      tmp = _migration_lock_counter;
      atomic_signal_fence(std::memory_order_acquire); // load-load, load-store
      <critical instructions here>
      _migration_lock_counter = tmp + 1; // was moved past the barrier
      
      To prevent this, we need to order previous stores with future
      loads and stores, which is given only by std::memory_order_seq_cst.
      
      Signed-off-by: default avatarTomasz Grabiec <tgrabiec@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      4dbcc248
  9. May 18, 2014
  10. May 16, 2014
    • Nadav Har'El's avatar
      sched: high-resolution thread::current()->thread_clock() · c4ebb11a
      Nadav Har'El authored
      
      thread::current()->thread_clock() returns the CPU time consumed by this
      thread. A thread that wishes to measure the amount of CPU time consumed
      by some short section of code will want this clock to have high resolution,
      but in the existing code it was only updated on context switches, so shorter
      durations could not be measured with it.
      
      This patch fixes thread_clock() to also add the time that passed since
      the the time slice started.
      
      When running thread_clock() on *another* thread (not thread::current()),
      we still return a cpu time snapshot from the last context switch - even
      if the thread happens to be running now (on another CPU). Fixing that case
      is quite difficult (and will probably require additional memory-ordering
      guarantees), and anyway not very important: Usually we don't need a
      high-resolution estimate of a different thread's cpu time.
      
      Fixes #302.
      
      Reviewed-by: default avatarGleb Natapov <gleb@cloudius-systems.com>
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      c4ebb11a
    • Glauber Costa's avatar
      sched: make preempt functions inline · 97f5c29d
      Glauber Costa authored
      
      Again, we are currently calling a function everytime we disable/enable preemption
      (actually a pair of functions), where simple mov instructions would do.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      97f5c29d
    • Glauber Costa's avatar
      sched: make current inline · 19b9d16f
      Glauber Costa authored
      
      We are heavily using this function to grab the address of the current thread.
      That means a function call will be issued every time that is done, where a
      simple mov instruction would do.
      
      For objects outside the main ELF, we don't want that to be inlined, since that
      would mean the resolution would have to go through an expensive __tls_get_addr.
      So what we do is that we don't present the symbol as inline for them, and make
      sure the symbol is always generated.
      
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      19b9d16f
  11. May 15, 2014
  12. May 14, 2014
Loading