cvs commit: src/sys/nfsclient nfs_bio.c nfs_vfsops.c nfsargs.h nfsmount.h src/sys/sys buf.h bufobj.h src/sys/kern vfs_bio.c

Alfred Perlstein alfred at freebsd.org
Sat Jun 11 03:49:30 GMT 2005


Returning EAGAIN from a disk IO seems bogus, are you sure it makes
sense to do that when IO_NDELAY is set?  Shouldn't it just be ignored
like other FSes do?

* Brian Feldman <green at FreeBSD.org> [050610 16:50] wrote:
> green       2005-06-10 23:50:41 UTC
> 
>   FreeBSD src repository
> 
>   Modified files:
>     sys/nfsclient        nfs_bio.c nfs_vfsops.c nfsargs.h 
>                          nfsmount.h 
>     sys/sys              buf.h bufobj.h 
>     sys/kern             vfs_bio.c 
>   Log:
>   Fix a serious deadlock with the NFS client.  Given a large enough
>   atomic write request, it can fill the buffer cache with the entirety
>   of that write in order to handle retries.  However, it never drops
>   the vnode lock, or else it wouldn't be atomic, so it ends up waiting
>   indefinitely for more buf memory that cannot be gotten as it has it
>   all, and it waits in an uncancellable state.
>   
>   To fix this, hibufspace is exported and scaled to a reasonable
>   fraction.  This is used as the limit of how much of an atomic write
>   request by the NFS client will be handled asynchronously.  If the
>   request is larger than this, it will be turned into a synchronous
>   request which won't deadlock the system.  It's possible this value is
>   far off from what is required by some, so it shall be tunable as soon
>   as mount_nfs(8) learns of the new field.
>   
>   The slowdown between an asynchronous and a synchronous write on NFS
>   appears to be on the order of 2x-4x.
>   
>   General nod by: gad
>   MFC after:      2 weeks
>   More testing:   wes
>   PR:             kern/79208
>   
>   Revision  Changes    Path
>   1.489     +1 -1      src/sys/kern/vfs_bio.c
>   1.151     +65 -0     src/sys/nfsclient/nfs_bio.c
>   1.177     +9 -0      src/sys/nfsclient/nfs_vfsops.c
>   1.68      +2 -2      src/sys/nfsclient/nfsargs.h
>   1.30      +1 -0      src/sys/nfsclient/nfsmount.h
>   1.186     +1 -0      src/sys/sys/buf.h
>   1.15      +2 -2      src/sys/sys/bufobj.h

-- 
- Alfred Perlstein
- email: bright at mu.org cell: 408-480-4684


More information about the cvs-src mailing list