Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 09 Mar 1999 09:46:58 -0500
From:      Mike Tancsa <mike@sentex.net>
To:        Mark Powell <M.S.Powell@ais.salford.ac.uk>, freebsd-stable@FreeBSD.ORG
Subject:   Re: 3.1-R panic
Message-ID:  <3.0.5.32.19990309094658.04650a80@staff.sentex.ca>
In-Reply-To: <Pine.BSF.4.05.9903081039180.33701-100000@plato.salford.ac. uk>

next in thread | previous in thread | raw e-mail | index | archive | help
>options         "SOFTUPDATES"

>pseudo-device   splash

Assuming its not hardware, and it doesnt sound like it, I would try getting
rid of the softupdates option.  From a number of people who are having
panics, many have softupdates turned on.  However, I know of a lot of
people with softupdates, and they are running solid.  Still, news is fairly
disk intensive and might be triggering some deadlock somewhere. Also, the
situation below might be relavant to you...

At 04:35 PM 3/4/99 -0800, Matthew Dillon wrote:
>    The problem is a deadlock caused by the fgrep.  The fgrep is mmap()ing
>    the file, but then it does some really weird crap when dealing with
>    larger files.
>
>    It's the most idiotic code I've ever seen.  The code uses a PRIVATE+RW
>    mmap() until it gets to odd point in the file, at which point it read()'s
>    additional information from the file into the mapped space ( that might
>    contain a previous mmap'd portion of the file ).
>
>    So what happens is this:
>
>	* read() call
>	* shared lock obtained on vnode
>
>	( some other process attempts to get shared lock on vnode and
>	succeeds... for example, a namei operation is attempted by
>	another grep )
>
>	* access MMAP'd area
>	* exclusive lock attempt obtained on same vnode.  This blocks because
>	  some other process has a shared lock on the vnode.
>
>	( the other process then attempts to get an exclusive lock on the 
>	vnode this blocks.
>
>    Deadlock.  
>
>    Even worse, the gnu grep does not bother munmap()'ing the space so, in
>    fact, the deadlock can occur between two unrelated files as well as with 
>    the same file.  This is the more likely deadlock scenario.
>
>    The solution is more difficult.   We could hack an exception for PRIVATE
>    mmap's... there really is no need for the vm_fault code to lock the
vnode.
>    Howver, other situations can occur where this hack would not work.
>
>    This is 'kinda a known problem' in FreeBSD.   We really need to find a
>    solution to it.  Other similar deadlocks can occur if you mmap() one file
>    and read() or write() data from it to another file, and vise versa at
>    the same time.
>
>    Personally, I think the only real solution is to make vn_read() and 
>    vn_write() lock the uio space as well as the vnode being read or
>    written.  It would have to do it in the right order, and it would have
>    to deal with the situation where the uio space covers multiple vnodes.
>
>    Alternately, vnodes need to be redesigned without these fraggin 
>    all-encompassing locks for data R+W ops.
>
>						-Matt
>
------------------------------------------------------------------------
Mike Tancsa,                          	          tel 01.519.651.3400
Network Administrator,     			  mike@sentex.net
Sentex Communications                 		  www.sentex.net
Cambridge, Ontario Canada


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




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