Skip to content
Snippets Groups Projects
  1. May 26, 2014
  2. May 23, 2014
  3. May 22, 2014
  4. May 21, 2014
  5. 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
  6. May 18, 2014
  7. 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
  8. May 15, 2014
  9. May 14, 2014
  10. May 13, 2014
    • Glauber Costa's avatar
      netchannels: specialize new and delete operators · 8e087635
      Glauber Costa authored
      
      While running one of the redis benchmarks, I saw around 23k calls to
      malloc_large.  Among those, ~10 - 11k were 2-page sized. I managed to track it
      down to the creation of net channels. The problem here is that the net channel
      structure is slightly larger than half a page - the maximum size for small
      object pools. That will throw all allocations into malloc_large. Besides being
      slow, it also wastes a page for every net channel created, since malloc_large
      will include an extra page in the beginning of each allocation.
      
      This patch fixes this by overloading the operators new and delete for the
      netchannel structure so that we use the more efficient and less wasteful
      alloc_page.
      
      Reviewed-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarGlauber Costa <glommer@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      8e087635
  11. May 12, 2014
  12. May 08, 2014
    • Nadav Har'El's avatar
      Fix bug booting with 64 CPUs · 8dd67e0d
      Nadav Har'El authored
      
      OSv is currently limited to 64 vCPUs, because we use a 64-bit bitmask for
      wakeups (see max_cpus in sched.cc). Having exactly 64 CPUs *should* work,
      but unfortunately didn't because of a bug:
      
      cpu_set::operator++ first incremented the index, and then called advance()
      to find the following one-bit. We had a bug when the index was 63: we then
      expect operator++ to return 64 (end(), signaling the end of the iteration),
      but what happened was that after it incremented the index to 64, advance()
      wrongly handled the case idx=64 (1<<64 returns 1, unexpectedly) and moved
      it back to idx=63.
      
      The patch fixes operator++ to not call advance when idx=64 is reached,
      so now it works correctly also for idx=63, and booting with 64 CPUs now
      works.
      
      Fixes #234.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      8dd67e0d
    • Jaspal Singh Dhillon's avatar
      assert: fix __assert_fail() · 7254b4b0
      Jaspal Singh Dhillon authored
      
      This patch changes the definition of __assert_fail() in api/assert.h which
      would allow it and other header files which include it (such as debug.hh) to
      be used in mgmt submodules. Fixes conflict with declaration of
      __assert_fail() in external/x64/glibc.bin/usr/include/assert.h
      
      Signed-off-by: default avatarJaspal Singh Dhillon <jaspal.iiith@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      7254b4b0
  13. May 07, 2014
  14. May 05, 2014
  15. May 04, 2014
  16. May 03, 2014
  17. Apr 29, 2014
Loading