Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 23:24:17 -0800 (PST)
From:      John Baldwin <jhb@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/alpha/include mutex.h src/sys/i386/include mutex.h src/sys/ia64/include mutex.h src/sys/kern kern_mutex.c kern_fork.c src/sys/sys proc.h
Message-ID:  <200103090724.f297OIk50706@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
jhb         2001/03/08 23:24:17 PST

  Modified files:
    sys/alpha/include    mutex.h 
    sys/i386/include     mutex.h 
    sys/ia64/include     mutex.h 
    sys/kern             kern_mutex.c kern_fork.c 
    sys/sys              proc.h 
  Log:
  Fix mtx_legal2block.  The only time that it is bad to block on a mutex is
  if we hold a spin mutex, since we can trivially get into deadlocks if we
  start switching out of processes that hold spinlocks.  Checking to see if
  interrupts were disabled was a sort of cheap way of doing this since most
  of the time interrupts were only disabled when holding a spin lock.  At
  least on the i386.  To fix this properly, use a per-process counter
  p_spinlocks that counts the number of spin locks currently held, and
  instead of checking to see if interrupts are disabled in the witness code,
  check to see if we hold any spin locks.  Since child processes always
  start up with the sched lock magically held in fork_exit(), we initialize
  p_spinlocks to 1 for child processes.  Note that proc0 doesn't go through
  fork_exit(), so it starts with no spin locks held.
  
  Consulting from:	cp
  
  Revision  Changes    Path
  1.21      +1 -3      src/sys/alpha/include/mutex.h
  1.30      +0 -1      src/sys/i386/include/mutex.h
  1.11      +1 -2      src/sys/ia64/include/mutex.h
  1.57      +9 -3      src/sys/kern/kern_mutex.c
  1.106     +5 -1      src/sys/kern/kern_fork.c
  1.154     +2 -1      src/sys/sys/proc.h


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103090724.f297OIk50706>