- Store threads on sleep queues in FIFO order rather than sorted by   priority.  The sleep queues don't get updated when the priority of   threads changes, so sleepq_signal() might not always wakeup the   highest priority thread.  Updating the queues when thread priorities   change cannot be easily done due to lock orders, so instead we do an   O(n) walk of the queue for a sleepq_signal() operation instead of O(1).   On the other hand, adding a thread to a sleep queue now goes from O(n)   to O(1) so it ends up as an even tradeoff.  The correctness here with   regards to priorities is actually fairly important.  msleep() gives   interactive threads their priority "boost" after they are placed on the   queue, but before this fix that "boost" wasn't used to determine the   highest priority thread that sleepq_signal() awoke. - Fix up some comments.
- Store threads on sleep queues in FIFO order rather than sorted by
  priority.  The sleep queues don't get updated when the priority of
  threads changes, so sleepq_signal() might not always wakeup the
  highest priority thread.  Updating the queues when thread priorities
  change cannot be easily done due to lock orders, so instead we do an
  O(n) walk of the queue for a sleepq_signal() operation instead of O(1).
  On the other hand, adding a thread to a sleep queue now goes from O(n)
  to O(1) so it ends up as an even tradeoff.  The correctness here with
  regards to priorities is actually fairly important.  msleep() gives
  interactive threads their priority "boost" after they are placed on the
  queue, but before this fix that "boost" wasn't used to determine the
  highest priority thread that sleepq_signal() awoke.
- Fix up some comments.

Inspired by:	ups, bde

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase