Skip to content
Snippets Groups Projects
  1. Jul 28, 2013
  2. Jul 27, 2013
  3. Jul 17, 2013
  4. Jul 15, 2013
  5. Jul 12, 2013
  6. Jul 11, 2013
    • Nadav Har'El's avatar
      Fix missed wakeups in so_wake_poll · fd28e12d
      Nadav Har'El authored
      This patch fixes two bugs in so_wake_poll(), which caused us missing
      some poll wakeups, resulting in poll()s that never wake up. This can be
      seen as a hang in the following simple loop exercising memcached:
               (while :; do; echo "stats" | nc 192.168.122.100 11211; done)
      
      The two fixes are:
      
      1. If so_wake_poll() decides *not* to call poll_wake() - because it sees
         zero data on this packet - it mustn't reset the SB_SEL flag on the
         socket, or we will ignore the next event even when it does have data.
      
      2. To see if the socket is readable, we need to call soreadable(), not
         soreadabledata() - the former adds the connection close event to the
         readability. See sopoll_generic(), which also sets a readability
         event in that case.
      fd28e12d
    • Glauber Costa's avatar
      xen: include xen files · bf2061fb
      Glauber Costa authored
      verbatim header files import, plus the code in build.mk to find them
      bf2061fb
  7. Jul 09, 2013
    • Nadav Har'El's avatar
      Fix thread-exit issues in msleep/wakeup · 87c7f232
      Nadav Har'El authored
      wakeup() and wakeup_one() dropped the lock before waking the thread(s).
      But if a thread timed out at the same time we are planning to wake it,
      and if the thread imediately exited, our attempt to wake() it could crash.
      
      Therefore wakeup() needs to continue holding the lock until after the
      wake(). When msleep() times out, before it returns it reacquires the
      lock, ensuring it cannot return before a concurrent wakeup() does
      its wakes.
      
      Note that in the ordinary wakeup() case (not racing with a timeout),
      we are *not* negatively affected by holding the lock while wake()ing
      because the waking msleep() does not try to reacquire the lock in the
      non-timeout case.
      
      Additionally, we use wake_with() instead of separate set and wake
      instructions. Without wake_with() we have the (exceedingly rare)
      possibility that merely setting _awake=true causes msleep() to
      return, and its caller then decides to exit the thread, the
      wake() right after the _awake=true would crash.
      87c7f232
Loading