Skip to content
Snippets Groups Projects
  1. Jan 15, 2014
    • Eduardo Piva's avatar
      debug: Change calls to printf on boot messages · f37b7e53
      Eduardo Piva authored
      
      Change some printf calls on boot messages, so it will call
      the apropriate debug function. This will enable OSv
      to operate on silent mode.
      
      Added debug.h header so we can link debug functions to C files.
      
      Fixes #118
      
      Signed-off-by: default avatarEduardo Piva <efpiva@gmail.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      f37b7e53
    • Nadav Har'El's avatar
      Document clock::time() and fix its implementation on kvmclock · ae65b676
      Nadav Har'El authored
      
      Our clock::time() function returns the current wall-clock time (number of
      nanoseconds since the Unix epoch). We never clearly documented this, so this
      patch adds this documentation.
      
      Moreover, in kvmclock, we assumed that the host never adjusts its
      wall-clock time, which is not a good assumption because it prevents us
      from benefiting from NTP running on the host. As Avi Kivity explains:
      
         "For the wall clock, you need to sample the wall clock base every time,
          since it can be changed by the host."
      
      So this patch changes kvmclock::time() to sample the wall-clock-at-boot
      reported by the paravirtual clock, on every time() call, and not just once.
      
      The downsite of this patch is that clock::get::time(), and therefore
      nanotime(), become a bit slower on kvmclock, as they need to sample
      the wall_clock_boot() every time, require a couple of barriers and
      arithmetic operations. But note that we shouldn't even be using the
      non-monotonic clock::get::time() for our timers - we should be using the
      monotonic clock::get::uptime() - and when we switch to using that we'll
      get back the bit of performance lost in this patch.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      ae65b676
  2. Jan 10, 2014
  3. Jan 07, 2014
    • Nadav Har'El's avatar
      Exile spinlock to a separate file · 8fcad509
      Nadav Har'El authored
      
      In very early OSv history, the spinlock was used in the mutex's
      implementation so it made sense to put it in mutex.cc and mutex.h.
      
      But now that the spinlock is all that's left in mutex.cc (the real mutex
      is in lfmutex.cc), rename this file spinlock.cc. Also, move the spinlock
      definitions from <osv/mutex.h> to a new <osv/spinlock.h>, so if someone
      wants to make the grave mistake of using a spinlock - they will at least
      need to explicitly include this header file.
      
      Currently, the only remaining user of the spinlock is the console.
      Using a spinlock (and not a mutex) in the console allows printing debug
      messages while preemption is disabled. Arguably, this use-case is no
      longer important (we have tracepoints), so in the future we can consider
      dropping the spinlock completely.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
      8fcad509
  4. Jan 01, 2014
    • Nadav Har'El's avatar
      file: reduce boiler-plate code in special files · 9478a14d
      Nadav Har'El authored
      
      Each implementation of "struct file" needs to implement 8 different file
      operations. Most special file implementations, such as pipe, socketpair,
      epoll and timerfd, don't support many of these operations. We had in
      unsupported.h functions that can be reused for the unsupported operation,
      but this resulted in a lot of ugly boiler-plate code.
      
      Instead, this patch switches to a cleaner, more C++-like, method:
      It defines a new "file" subclass, called "special_file", which implements
      all file operations except close(), with a default implementation identical
      to the old unsupported.h implementations.
      
      The files of pipe(), socketpair(), timerfd() and epoll_create() now inherit
      from special_file, and only override the file operations they really want
      to implement.
      
      Signed-off-by: default avatarNadav Har'El <nyh@cloudius-systems.com>
      Signed-off-by: default avatarAvi Kivity <avi@cloudius-systems.com>
      9478a14d
  5. Dec 31, 2013
  6. Dec 30, 2013
  7. Dec 27, 2013
  8. Dec 26, 2013
  9. Dec 24, 2013
  10. Dec 23, 2013
  11. Dec 20, 2013
  12. Dec 19, 2013
Loading