DragonFly BSD
DragonFly commits List (threaded) for 2005-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

cvs commit: src/sys/kern kern_shutdown.c

From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Jul 2005 19:47:36 -0700 (PDT)

dillon      2005/07/17 19:47:36 PDT

DragonFly src repository

  Modified files:
    sys/kern             kern_shutdown.c 
  DELAY() is a spin loop, we can't use it any more because shutdown
  depends on other threads working.  Not only does the syncer and buffer
  flusher need to work (else they might get stuck holding a lock on a buffer),
  but the scheduler helper threads and device helper threads must also continue
  to operate to be able to successfully flush the buffer cache.   In addition,
  busy looping while holding the BGL can seriously deadlock SMP machines, so
  even if it was (sometimes) possible to get away with using DELAY on UP boxes,
  it's simply impossible on an SMP box.
  So change the DELAY's to tsleep's in the shutdown code.  The current thread
  is also given a very high priority (higher then an interrupt thread,
  in fact), to try to ensure it gets through the shutdown procedure even if
  the system is fried.  For the moment we do not move the thread to cpu #0.
  This puts us in a somewhat awkwar situation when handling panics, but I don't
  see that we have much of a choice.
  Reported-by: Peter Avalos, David Rhodus, and numerous other people over time.
  Revision  Changes    Path
  1.21      +10 -3     src/sys/kern/kern_shutdown.c


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]