Commit Graph

63 Commits

Author SHA1 Message Date
David Greenman 4590fd3a2a Fixed init functions argument type - caddr_t -> void *. Fixed a couple of
compiler warnings.
1995-09-09 18:10:37 +00:00
John Dyson c83ebe7781 Added VOP_GETPAGES/VOP_PUTPAGES and also the "backwards" block count
for VOP_BMAP.  Updated affected filesystems...
1995-09-04 00:21:16 +00:00
John Dyson 8c601f7da8 Improvements to the cluster code, minor vfs_bio efficiency:
Better performance -- more aggressive read-ahead
	under certain circumstanses.

	Mods to support clustering on small
	( < PAGE_SIZE) block size filesystems (e.g. ext2fs,
	msdosfs.)
1995-09-03 19:56:15 +00:00
Julian Elischer 2b14f991e6 Reviewed by: julian with quick glances by bruce and others
Submitted by:	terry (terry lambert)
This is  a composite of 3 patch sets submitted by terry.
they are:
New low-level init code that supports loadbal modules better
some cleanups in the namei code to help terry in 16-bit character support
some changes to the mount-root code to make it a little more
modular..

NOTE: mounting root off cdrom or NFS MIGHT be broken as I haven't been able
to test those cases..

certainly mounting root of disk still works just fine..
mfs should work but is untested. (tomorrows task)

The low level init stuff includes a total rewrite of init_main.c
to make it possible for new modules to have an init phase by simply
adding an entry to a TEXT_SET (or is it DATA_SET) list. thus a new module can
be added to the kernel without editing any other files other than the
'files' file.
1995-08-28 09:19:25 +00:00
David Greenman 9f95e53cff Another minor optimization, this time to incore(). 1995-08-24 13:59:14 +00:00
David Greenman ff3aaf2582 Minor optimization. 1995-08-24 13:28:16 +00:00
David Greenman d63abe4172 Resize both VMIO and non-VMIO buffers if the size changes. 1995-08-06 12:10:39 +00:00
Bruce Evans 28f8db1403 Eliminate sloppy common-style declarations. There should be none left for
the LINT configuation.
1995-07-29 11:44:31 +00:00
David Greenman 23953f95f6 Killed bogus casts in tsleep/wakeup calls. 1995-07-25 05:41:57 +00:00
David Greenman cd9015557e Fixed broken offset use in vfs_unbusy_pages() which resulted in several
different types of panics/inconsistencies with NFS clients.
Cleared PG_WANTED where appropriate.
Added checks for buffer busy in allocbuf and biodone.

Reviewed by:	John Dyson
1995-07-25 05:03:06 +00:00
David Greenman 23f762689d Panic if no object in biodone. Slightly optimized allocbuf() again. 1995-07-24 03:16:41 +00:00
David Greenman be49bd16c6 Added some additional diagnostic information output when panicing in
biodone().
1995-07-23 19:37:52 +00:00
David Greenman 31de6175b7 Fixed two cases where some parans were missing, resulting in some bogus
logic. Slightly simplified allocbuf().
1995-07-23 18:49:48 +00:00
David Greenman 44918dfed7 Re-lookup the buffer if the vnode isn't locked. The previous check for
VBLK vnodes isn't adequate since all NFS nodes aren't locked, either. The
result is a race condition that would lead to duplicate buffers at the
same block offset.

Submitted by:	John Dyson
1995-07-21 04:55:45 +00:00
David Greenman 1ce781c3af Fixed "bufspace" calculation. It was lossy in some circumstances of the
buffer resizing and caused a "newbuf" deadlock.

Reviewed by:	John Dyson & David Greenman
Submitted by:	Peter Wemm
1995-07-17 06:26:07 +00:00
David Greenman 8393c48a22 Resize buffers if they aren't the correct size. Several months ago we
made a change to NFS that caused buffers at EOF to be variable size. This
had the undesired side-effect of breaking delayed writes on NFS. This
fixes it.

Submitted by:	John Dyson
1995-07-15 16:01:46 +00:00
David Greenman aa2cabb958 1) Converted v_vmdata to v_object.
2) Removed unnecessary vm_object_lookup()/pager_cache(object, TRUE) pairs
   after vnode_pager_alloc() calls - the object is already guaranteed to be
   persistent.
3) Removed some gratuitous casts.
1995-06-28 12:01:13 +00:00
Rodney W. Grimes 9b2e535452 Remove trailing whitespace. 1995-05-30 08:16:23 +00:00
David Greenman 61f5d51062 Changes to fix the following bugs:
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
1995-05-21 21:39:31 +00:00
Rodney W. Grimes b2b795f07c Fix -Wformat warnings from LINT kernel. 1995-05-11 19:26:53 +00:00
David Greenman fc3d49a9dc Check for curproc != NULL before dereferencing it. 1995-04-30 05:09:13 +00:00
David Greenman 5baf11ce97 Removed unused & empty bufstats() function. 1995-04-16 12:02:42 +00:00
David Greenman cece489df8 Killed gratuitous b_vp=NULL in bufinit. The entire buffer is already
bzero()'d.
1995-04-16 11:45:30 +00:00
David Greenman d94a4c0434 1) Check for curproc != NULL in bread/bwrite. John convinced me that this
is necessary in order for panic+sync to work. Will also gloss over a panic
that Jordan was having with the install floppies that remains unexplainable.
2) Handle "bogus_page" a little better.
3) Set page protection to VM_PROT_NONE if the entire page has become !valid.

Submitted by:	John Dyson (2&3), me (1).
1995-04-16 05:11:14 +00:00
David Greenman 213fd1b6e8 Changes from John Dyson and myself:
Fixed remaining known bugs in the buffer IO and VM system.

vfs_bio.c:
Fixed some race conditions and locking bugs. Improved performance
by removing some (now) unnecessary code and fixing some broken
logic.
Fixed process accounting of # of FS outputs.
Properly handle NFS interrupts (B_EINTR).

(various)
Replaced calls to clrbuf() with calls to an optimized routine
call vfs_bio_clrbuf().

(various FS sync)
Sync out modified vnode_pager backed pages.

ffs_vnops.c:
Do two passes: Sync out file data first, then indirect blocks.

vm_fault.c:
Fixed deadly embrace caused by acquiring locks in the wrong order.

vnode_pager.c:
Changed to use buffer I/O system for writing out modified pages. This
should fix the problem with the modification date previous not getting
updated. Also dramatically simplifies the code. Note that this is
going to change in the future and be implemented via VOP_PUTPAGES().

vm_object.c:
Fixed a pile of bugs related to cleaning (vnode) objects. The performance
of vm_object_page_clean() is terrible when dealing with huge objects,
but this will change when we implement a binary tree to keep the object
pages sorted.

vm_pageout.c:
Fixed broken clustering of pageouts. Fixed race conditions and other
lockup style bugs in the scanning of pages. Improved performance.
1995-04-09 06:02:46 +00:00
David Greenman 6e14d964ac Removed some redundant 'vmio' checks. 1995-03-27 00:11:45 +00:00
David Greenman f57459b632 Removed third arg (vmio) to allocbuf() that was added with the original
merged cache changes, and figure it out based on the B_VMIO buffer flag.
Fixes a problem where delayed write VMIO buffers would sometimes get
recopied into kernel-alloced memory.

Submitted by:	John Dyson
1995-03-26 23:29:13 +00:00
Bruce Evans b5e8ce9f12 Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'.  Fix all the bugs found.  There were no serious
ones.
1995-03-16 18:17:34 +00:00
David Greenman 5dcf309046 Removed most of the special policy regarding the seperation of VMIO and
dir/metadata buffers as it seems to have anomolous effects.
1995-03-07 19:53:27 +00:00
David Greenman 9bd1697199 Added some more of John's "anti-chatter" fixes - set the page activation
count to 0 after activating the page; the previous behavior biased the
pages too high in some cases.

Submitted by:	John Dyson
1995-03-04 15:16:07 +00:00
David Greenman 22470903a0 Fixes from John Dyson to work around vnode lock hang. Basically, remove
the VOP_BMAP calls, and add one to bdwrite.

Submitted by:	John Dyson
1995-03-03 22:13:16 +00:00
David Greenman fde2cdc48a Various changes from John and myself that do the following:
New functions create - vm_object_pip_wakeup and pagedaemon_wakeup that
are used to reduce the actual number of wakeups.
New function vm_page_protect which is used in conjuction with some new
page flags to reduce the number of calls to pmap_page_protect.
Minor changes to reduce unnecessary spl nesting.
Rewrote vm_page_alloc() to improve readability.
Various other mostly cosmetic changes.
1995-03-01 22:08:55 +00:00
David Greenman 4494100855 Fixed thrashing buffer problem.
Submitted by:	John Dyson
1995-02-25 01:46:26 +00:00
David Greenman 701d45805b Added some code to make sure that buffers associated with directories and
metadata aren't thrashed by regular file I/O.
Added mechanism to limit the amount of outstanding I/O on a given vnode.
Pagedaemon wakeup policy changed to skew priority a little in favor of
file caching.
Slight code reorganization to improve clarity.
Added a few more comments.

Submitted by:	John Dyson
1995-02-22 09:30:13 +00:00
David Greenman 7a53944444 Only do object paging_in_progress wakeups if someone is waiting on this
condition.
Added some comments.

Submitted by:	John Dyson
1995-02-22 09:16:07 +00:00
David Greenman 0e65588688 Only clear B_VMIO in brelse() - a bunch of special processing is required
whenever this happens, and that wasn't occurring in some cases.
1995-02-18 02:55:09 +00:00
David Greenman b82c50c4e6 Make B_NOCACHE and B_INVAL buffers work correctly - throw away the data in
the page cache.

Submitted by:	John Dyson
1995-02-03 03:35:56 +00:00
David Greenman 6a1c735df7 Fix problem with freeing busy pages reported by Nick Sayer.
Submitted by:	 John Dyson
1995-01-26 03:34:31 +00:00
David Greenman 9532143ae6 Fixed a variety of deadlock and panic bugs, removed the bypass code, and
implemented the ability to limit bufferspace by memory consumed. (vfs_bio.c)
Fixed recently introduced bugs that caused extra I/O to happen in some
cases. (vfs_cluster.c)

Submitted by:	John Dyson
1995-01-24 10:00:46 +00:00
Andrey A. Chernov 60efec1dab Restore original fix from ohki, not check m for NULL it is already done
in the code above.
Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
1995-01-21 06:32:26 +00:00
Andrey A. Chernov f76c8e8cc3 Change if (m->valid == 0) to if (m && m->valid == 0) 1995-01-20 23:30:42 +00:00
Bill Paul fc042b6935 Submitted by: ohki@gssm.otsuka.tsukuba.ac.jp
When using cp to copy a file under the following circumstanes:

- original file in on an NFS filesystem
- destination file is on the same NFS filesystem
- the file is less than 8Mbytes in size
- the file is larger than 65536 bytes in size

the cp process can get frozen in device-wait and never wake up (cp uses
mmap() in this case).
A small change to allocbuf() fixes this.
1995-01-20 20:11:31 +00:00
David Greenman 761dd66739 Attempt to close a hole using splhigh/splx. There still appears to be a
serious one in the same area that I don't have time to fix.
1995-01-15 09:35:58 +00:00
David Greenman c3d05da5e3 MFS doesn't bother to associate a struct mount with the vnode...so work
around this by not trying to cluster this type of I/O.

Submitted by:	John Dyson
1995-01-11 01:53:18 +00:00
David Greenman 5943df8331 PG_FAKE is no longer used - so don't bother to clear it. 1995-01-10 09:20:34 +00:00
David Greenman 480dff540b Fixed some formatting weirdness that I overlooked in the previous commit. 1995-01-10 07:32:52 +00:00
David Greenman 0d94caffca These changes embody the support of the fully coherent merged VM buffer cache,
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
1995-01-09 16:06:02 +00:00
David Greenman e03b612d87 Only VM_WAIT if curproc != pageproc. A deadlock can occur otherwise.
Submitted by:	John Dyson
1994-10-23 20:52:11 +00:00
David Greenman 08d7d166b8 Removed references to bclnlist which we don't use/support/need. 1994-10-18 06:55:57 +00:00
David Greenman 8e58bf6875 Stuff object into v_vmdata rather than pager. Not important which at
the moment, but will be in the future. Other changes mostly cosmetic,
but are made for future VMIO considerations.

Submitted by:	John Dyson
1994-10-05 09:48:45 +00:00