Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2000 09:58:48 -0800
From:      Alfred Perlstein <bright@wintelcom.net>
To:        Matt Dillon <dillon@earth.backplane.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: bwillwrite() not right.
Message-ID:  <20001127095848.E8051@fw.wintelcom.net>
In-Reply-To: <200011270853.eAR8rH229425@earth.backplane.com>; from dillon@earth.backplane.com on Mon, Nov 27, 2000 at 12:53:17AM -0800
References:  <20001126232117.C8051@fw.wintelcom.net> <200011270853.eAR8rH229425@earth.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Matt Dillon <dillon@earth.backplane.com> [001127 00:53] wrote:
> :bwillwrite() is called in kern/sys_generic.c:dofilewrite()
> :
> :bwillwrite() is meant as a quick stop before doing any vnode
> :ops to flush dirty buffers to prevent a deadlock.
> :
> :However:
> :1) afaik only VNODES have backing buffers, so stalling socket/pipes
> :   doesn't gain us anything
> :2) writev() doesn't call bwillwrite()
> :
> :shouldn't the code be changed like so:
> 
>     Hmm..  Well, your suggestion is certainly better then what it is doing
>     now.   bwillwrite() is somewhat of a hack, I just haven't gotten around
>     to replacing it with something better.  What it is approximating is an
>     attempt to block on low-memory prior to locking a vnode so we do not
>     wind up blocking on low-memory later on when the lock is being held
>     (which could prevent the pageout daemon from paging pages associated
>     with that vnode out, thus causing a deadlock).
> 
>     When you feel comfortable with it in your own testing, go ahead and
>     commit it to -current.  But give it at least a good week's worth of
>     testing (or longer) before MFCing it to -stable.

Hrm, on further thought bwillwrite would be helpful for sockets when
the free mbufs gets low, but for now I'll just test this patch
and probably have it committed by tomorrow night.

thanks,
-Alfred


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




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