Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Feb 1999 02:24:07 -0500 (EST)
From:      "John S. Dyson" <dyson@iquest.net>
To:        luoqi@watermarkgroup.com (Luoqi Chen)
Cc:        green@unixhelp.org, kan@sti.cz, freebsd-current@FreeBSD.ORG
Subject:   Re: Filesystem deadlock
Message-ID:  <199902230724.CAA02628@y.dyson.net>
In-Reply-To: <199902230712.CAA02316@lor.watermarkgroup.com> from Luoqi Chen at "Feb 23, 99 02:12:50 am"

next in thread | previous in thread | raw e-mail | index | archive | help
Luoqi Chen said:
> > 
> This seems to be the good old vnode deadlock during vm_fault() that has been
> reported a couple of times, and there's still no satisfactory solution to it:
> fgrep does something like this: (don't ask me why)
> 
> 	addr = mmap(0, len, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, offset);
> 	read(fd, addr, count);
> 
> the read() syscall first locks the vnode, read the data from disk, then copy
> the data to buffer at addr, now if addr is not in core, there'll be a page
> fault and the fault handler vm_fault will try to lock the vnode pager backing
> the page at addr, which is already locked, deadlock. This deadlock then
> propagates all the way back to the root vnode and the whole system would
> freeze.
>
I believe that I had a pseudo-fix to that, and it might have been removed.
(In non-multithreaded kernels, when having to do things like the above,
 allowing recursive locks under certain circumstances can solve the problem.
 The key is to avoid the case where it covers up real bugs.)

-- 
John                  | Never try to teach a pig to sing,
dyson@iquest.net      | it makes one look stupid
jdyson@nc.com         | and it irritates the pig.


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




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