aboutsummaryrefslogtreecommitdiff
path: root/sys/nfsclient/nfs_bio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Improve the queuing algorithms used by NFS' asynchronous i/o. TheDoug Rabson1996-11-061-35/+85
| | | | | | | | | | | | | | | | | | | | | existing mechanism uses a global queue for some buffers and the vp->b_dirtyblkhd queue for others. This turns sequential writes into randomly ordered writes to the server, affecting both read and write performance. The existing mechanism also copes badly with hung servers, tending to block accesses to other servers when all the iods are waiting for a hung server. The new mechanism uses a queue for each mount point. All asynchronous i/o goes through this queue which preserves the ordering of requests. A simple mechanism ensures that the iods are shared out fairly between active mount points. This removes the sysctl variable vfs.nfs.dwrite since the new queueing mechanism removes the old delayed write code completely. This should go into the 2.2 branch. Notes: svn path=/head/; revision=19449
* If a large (>4096 bytes) directory was modified, the old directoryDoug Rabson1996-10-211-2/+6
| | | | | | | | | | | | contents are discarded, including the cached seek cookies. Unfortunately, if the directory was larger than NFS_DIRBLKSIZ, then this confused nfs_readdirrpc(), making it appear as if the directory was truncated. Reviewed by: Karl Denninger <karl@Mcs.Net> Notes: svn path=/head/; revision=19070
* Staticized `nfs_dwrite'.Bruce Evans1996-10-121-2/+2
| | | | Notes: svn path=/head/; revision=18888
* This fixes a problem with the nfs socket handling code which happensDoug Rabson1996-10-111-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | if a single process is performing a large number of requests (in this case writing a large file). The writing process could monopolise the recieve lock and prevent any other processes from recieving their replies. It also adds a new sysctl variable 'vfs.nfs.dwrite' which controls the behaviour which originally pointed out the problem. When a process writes to a file over NFS, it usually arranges for another process (the 'iod') to perform the request. If no iods are available, then it turns the write into a 'delayed write' which is later picked up by the next iod to do a write request for that file. This can cause that particular iod to do a disproportionate number of requests from a single process which can harm performance on some NFS servers. The alternative is to perform the write synchronously in the context of the original writing process if no iod is avaiable for asynchronous writing. The 'delayed write' behaviour is selected when vfs.nfs.dwrite=1 and the non-delayed behaviour is selected when vfs.nfs.dwrite=0. The default is vfs.nfs.dwrite=1; if many people tell me that performance is better if vfs.nfs.dwrite=0 then I will change the default. Submitted by: Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp> Notes: svn path=/head/; revision=18866
* In sys/time.h, struct timespec is defined as:Nate Williams1996-09-191-5/+5
| | | | | | | | | | | | | | | | | /* * Structure defined by POSIX.4 to be like a timeval. */ struct timespec { time_t ts_sec; /* seconds */ long ts_nsec; /* and nanoseconds */ }; The correct names of the fields are tv_sec and tv_nsec. Reminded by: James Drobina <jdrobina@infinet.com> Notes: svn path=/head/; revision=18397
* Various fixes from frank@fwi.uva.nl (Frank van der Linden) viaDoug Rabson1996-07-161-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rick@snowhite.cis.uoguelph.ca: 1. Clear B_NEEDCOMMIT in nfs_write to make sure that dirty data is correctly send to the server. If a buffer was dirtied when it was in the B_DELWRI+B_NEEDCOMMIT state, the state of the buffer was left unchanged and when the buffer was later cleaned, just a commit rpc was made to the server to complete the previous write. Clearing B_NEEDCOMMIT ensures that another write is made to the server. 2. If a server returned a server (for whatever reason) returned an answer to a write RPC that implied that fewer bytes than requested were written, bad things would happen. 3. The setattr operation passed on the atime in stead of the mtime to the server. The fix is trivial. 4. XIDs always started at 0, but this caused some servers (older DEC OSF/1 3.0 so I've been told) who had very long-lasting XID caches to get confused if, after a reboot of a BSD client, RPCs came in with a XID that had in the past been used before from that client. Patch is to use the current time in seconds as a starting point for XIDs. The patch below is not perfect, because it requires the root fs to be mounted first. This is because of the check BSD systems do, comparing FS time to system time. Reviewed by: Bruce Evans, Terry Lambert. Obtained from: frank@fwi.uva.nl (Frank van der Linden) via rick@snowhite.cis.uoguelph.ca Notes: svn path=/head/; revision=17186
* Clear flags before using an inactive buffer. This is a kludge, butPaul Traina1996-06-081-1/+2
| | | | | | | | | matches the code in bread(). Reviewed by: bde Notes: svn path=/head/; revision=16192
* Add a check to prevent a computation from underflowing and causingMike Pritchard1996-01-241-3/+4
| | | | | | | | | | | | | | | | a panic due to an attaempt to allocate a buffer for a terabyte or so of data when an attempt is made to create sparse data (e.g. a holey file) more than 1 block past the end of the file. Note: some other areas of this code need to be looked at, since they might cause problems when the file size exceeds 2GB, due to storing results in ints when the computations are being done with quad sized variables. Reviewed by: bde Notes: svn path=/head/; revision=13612
* Staticize.Poul-Henning Kamp1995-12-171-3/+3
| | | | Notes: svn path=/head/; revision=12911
* Untangled the vm.h include file spaghetti.David Greenman1995-12-071-1/+3
| | | | Notes: svn path=/head/; revision=12662
* Completed function declarations and/or added prototypes and/or movedBruce Evans1995-12-031-2/+4
| | | | | | | prototypes to the right place. Notes: svn path=/head/; revision=12588
* Second batch of cleanup changes.Poul-Henning Kamp1995-10-291-4/+2
| | | | | | | | This time mostly making a lot of things static and some unused variables here and there. Notes: svn path=/head/; revision=11921
* Add support for amd direct maps.Doug Rabson1995-08-241-2/+2
| | | | | | | Reviewed by: Thomas Graichen <graichen@sirius.physik.fu-berlin.de> Notes: svn path=/head/; revision=10219
* Use a consistent blocksize for sizing bufs to avoid panicing the bio system.Doug Rabson1995-07-071-4/+4
| | | | Notes: svn path=/head/; revision=9428
* Changes to support version 3 of the NFS protocol.Doug Rabson1995-06-271-111/+181
| | | | | | | | | | | | | | | | | | | | | The version 2 support has been tested (client+server) against FreeBSD-2.0, IRIX 5.3 and FreeBSD-current (using a loopback mount). The version 2 support is stable AFAIK. The version 3 support has been tested with a loopback mount and minimally against an IRIX 5.3 server. It needs more testing and may have problems. I have patched amd to support the new variable length filehandles although it will still only use version 2 of the protocol. Before booting a kernel with these changes, nfs clients will need to at least build and install /usr/sbin/mount_nfs. Servers will need to build and install /usr/sbin/mountd. NFS diskless support is untested. Obtained from: Rick Macklem <rick@snowhite.cis.uoguelph.ca> Notes: svn path=/head/; revision=9336
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8876
* Changes to fix the following bugs:David Greenman1995-05-211-34/+64
| | | | | | | | | | | | | | | | | | 1) Files weren't properly synced on filesystems other than UFS. In some cases, this lead to lost data. Most likely would be noticed on NFS. The fix is to make the VM page sync/object_clean general rather than in each filesystem. 2) Mixing regular and mmaped file I/O on NFS was very broken. It caused chunks of files to end up as zeroes rather than the intended contents. The fix was to fix several race conditions and to kludge up the "b_dirtyoff" and "b_dirtyend" that NFS relies upon - paying attention to page modifications that occurred via the mmapping. Reviewed by: David Greenman Submitted by: John Dyson Notes: svn path=/head/; revision=8692
* Various fixes from John Dyson:David Greenman1995-04-161-39/+19
| | | | | | | | | | | 1) Rewrote screwy code that uses an incore buffer without making it busy. 2) Use B_CACHE instead of B_DONE in cases where it is appropriate. 3) Minor code optimization. This *might* fix kern/345 submitted by Heikki Suonsivu. Notes: svn path=/head/; revision=7871
* Removed obsolete vtrace() remnants.David Greenman1995-03-041-2/+1
| | | | Notes: svn path=/head/; revision=6875
* Removed a pile of vfs_unbusy_pages()...both unnecessary and wrong - resultedDavid Greenman1995-02-031-6/+3
| | | | | | | | | | in serious system instability. Changed a B_INVAL to a B_NOCACHE so that buffer data is properly disposed of. Submitted by: John Dyson, Rick Macklin, and ohki@gssm.otsuka.tsukuba.ac.jp Notes: svn path=/head/; revision=6148
* Added two missing brelse() calls.David Greenman1995-01-101-1/+5
| | | | | | | Submitted by: rick@snowhite.cis.uoguelph.ca Notes: svn path=/head/; revision=5471
* These changes embody the support of the fully coherent merged VM buffer cache,David Greenman1995-01-091-18/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | much higher filesystem I/O performance, and much better paging performance. It represents the culmination of over 6 months of R&D. The majority of the merged VM/cache work is by John Dyson. The following highlights the most significant changes. Additionally, there are (mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to support the new VM/buffer scheme. vfs_bio.c: Significant rewrite of most of vfs_bio to support the merged VM buffer cache scheme. The scheme is almost fully compatible with the old filesystem interface. Significant improvement in the number of opportunities for write clustering. vfs_cluster.c, vfs_subr.c Upgrade and performance enhancements in vfs layer code to support merged VM/buffer cache. Fixup of vfs_cluster to eliminate the bogus pagemove stuff. vm_object.c: Yet more improvements in the collapse code. Elimination of some windows that can cause list corruption. vm_pageout.c: Fixed it, it really works better now. Somehow in 2.0, some "enhancements" broke the code. This code has been reworked from the ground-up. vm_fault.c, vm_page.c, pmap.c, vm_object.c Support for small-block filesystems with merged VM/buffer cache scheme. pmap.c vm_map.c Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of kernel PTs. vm_glue.c Much simpler and more effective swapping code. No more gratuitous swapping. proc.h Fixed the problem that the p_lock flag was not being cleared on a fork. swap_pager.c, vnode_pager.c Removal of old vfs_bio cruft to support the past pseudo-coherency. Now the code doesn't need it anymore. machdep.c Changes to better support the parameter values for the merged VM/buffer cache scheme. machdep.c, kern_exec.c, vm_glue.c Implemented a seperate submap for temporary exec string space and another one to contain process upages. This eliminates all map fragmentation problems that previously existed. ffs_inode.c, ufs_inode.c, ufs_readwrite.c Changes for merged VM/buffer cache. Add "bypass" support for sneaking in on busy buffers. Submitted by: John Dyson and David Greenman Notes: svn path=/head/; revision=5455
* This is a bunch of changes from NetBSD. There are a couple of bug-fixes.Poul-Henning Kamp1994-10-171-4/+29
| | | | | | | | | | But mostly it is changes to use the list-maintenance macros instead of doing the pointer-gymnastics by hand. Obtained from: NetBSD Notes: svn path=/head/; revision=3664
* Prototyping and general gcc-shutting up. Gcc has one warning now which looksPoul-Henning Kamp1994-10-021-18/+47
| | | | | | | bad, I will get to it eventually, unless somebody beats me to it. Notes: svn path=/head/; revision=3305
* Fix up some sloppy coding practices:Garrett Wollman1994-08-181-2/+2
| | | | | | | | | | | | | | | - Delete redundant declarations. - Add -Wredundant-declarations to Makefile.i386 so they don't come back. - Delete sloppy COMMON-style declarations of uninitialized data in header files. - Add a few prototypes. - Clean up warnings resulting from the above. NB: ioconf.c will still generate a redundant-declaration warning, which is unavoidable unless somebody volunteers to make `config' smarter. Notes: svn path=/head/; revision=2112
* Changed B_AGE policy to work correctly in a world with relatively largeDavid Greenman1994-08-081-3/+1
| | | | | | | buffer caches. The old policy generally ended up caching nothing. Notes: svn path=/head/; revision=1937
* Added $Id$David Greenman1994-08-021-0/+1
| | | | Notes: svn path=/head/; revision=1817
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.Rodney W. Grimes1994-05-251-3/+7
| | | | | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman Notes: svn path=/head/; revision=1549
* BSD 4.4 Lite Kernel SourcesRodney W. Grimes1994-05-241-0/+799
Notes: svn path=/head/; revision=1541