summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Make the arguments match the functionality of the functions.obrien2000-08-262-7/+7
|
* Minor cleanups:peter2000-07-282-55/+19
| | | | | | - remove unused variables (fix warnings) - use a more consistant ansi style rather than a mixture - remove dead #if 0 code and declarations
* Clean up the snapshot code so that it no longer depends on the use ofmckusick2000-07-261-1/+1
| | | | | | | | | | | | | | the SF_IMMUTABLE flag to prevent writing. Instead put in explicit checking for the SF_SNAPSHOT flag in the appropriate places. With this change, it is now possible to rename and link to snapshot files. It is also possible to set or clear any of the owner, group, or other read bits on the file, though none of the write or execute bits can be set. There is also an explicit test to prevent the setting or clearing of the SF_SNAPSHOT flag via chflags() or fchflags(). Note also that the modify time cannot be changed as it needs to accurately reflect the time that the snapshot was taken. Submitted by: Robert Watson <rwatson@FreeBSD.org>
* Add snapshots to the fast filesystem. Most of the changes supportmckusick2000-07-112-1/+16
| | | | | | | | | | | | | | | | | | | | the gating of system calls that cause modifications to the underlying filesystem. The gating can be enabled by any filesystem that needs to consistently suspend operations by adding the vop_stdgetwritemount to their set of vnops. Once gating is enabled, the function vfs_write_suspend stops all new write operations to a filesystem, allows any filesystem modifying system calls already in progress to complete, then sync's the filesystem to disk and returns. The function vfs_write_resume allows the suspended write operations to begin again. Gating is not added by default for all filesystems as for SMP systems it adds two extra locks to such critical kernel paths as the write system call. Thus, gating should only be added as needed. Details on the use and current status of snapshots in FFS can be found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness is not included here. Unless and until you create a snapshot file, these changes should have no effect on your system (famous last words).
* #elsif -> #elifalfred2000-07-111-8/+8
| | | | Noticed by: green
* Support for unsigned integer and long sysctl variables. Update thejhb2000-07-051-48/+48
| | | | | | | | | SYSCTL_LONG macro to be consistent with other integer sysctl variables and require an initial value instead of assuming 0. Update several sysctl variables to use the unsigned types. PR: 15251 Submitted by: Kelly Yancey <kbyanc@posi.net>
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-042-3/+3
| | | | Pointed out by: bde
* Replace the PQ_*CACHE options with a single PQ_CACHESIZE option that youjhb2000-07-041-24/+31
| | | | | | | set equal to the number of kilobytes in your cache. The old options are still supported for backwards compatibility. Submitted by: Kelly Yancey <kbyanc@posi.net>
* Simplify and rationalise the management of the vnode free listmckusick2000-07-041-6/+2
| | | | (preparing the code to add snapshots).
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-032-3/+3
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Nifty idea from Jeroen van Gelderen; don't call a routine to check ifmarkm2000-06-251-1/+2
| | | | | | we are using the /dev/zero device, just check a flag (supplied by /dev/zero). Reviewed by: dfr
* Add missing increment of allocation counter.hsu2000-06-051-0/+2
|
* This is a cleanup patch to Peter's new OBJT_PHYS VM object typedillon2000-05-297-34/+92
| | | | | | | | | | | | | | | | | and sysv shared memory support for it. It implements a new PG_UNMANAGED flag that has slightly different characteristics from PG_FICTICIOUS. A new sysctl, kern.ipc.shm_use_phys has been added to enable the use of physically-backed sysv shared memory rather then swap-backed. Physically backed shm segments are not tracked with PV entries, allowing programs which use a large shm segment as a rendezvous point to operate without eating an insane amount of KVM in the PV entry management. Read: Oracle. Peter's OBJT_PHYS object will also allow us to eventually implement page-table sharing and/or 4MB physical page support for such segments. We're half way there.
* Brucify the pmap_enter_temporary() changes.dfr2000-05-291-1/+1
|
* Fix bug in vm_pageout_page_stats() that always resulted in a fulldillon2000-05-291-0/+2
| | | | | | | scan of the active queue. This fix is not expected to have any noticeable impact on performance. Noticed by: Rik van Riel <riel@conectiva.com.br>
* Add a new pmap entry point, pmap_enter_temporary() to be used duringdfr2000-05-281-0/+1
| | | | | | | dumps to create temporary page mappings. This replaces the use of CADDR1 which is fairly x86 specific. Reviewed by: dillon
* Back out the previous change to the queue(3) interface.jake2000-05-263-12/+12
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-233-12/+12
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Checkpoint of a new physical memory backed object type, that does notpeter2000-05-215-3/+237
| | | | | | | | | | | | | have pv_entries. This is intended for very special circumstances, eg: a certain database that has a 1GB shm segment mapped into 300 processes. That would consume 2GB of kvm just to hold the pv_entries alone. This would not be used on systems unless the physical ram was available, as it's not pageable. This is a work-in-progress, but is a useful and functional checkpoint. Matt has got some more fixes for it that will be committed soon. Reviewed by: dillon
* Implement an optimization of the VM<->pmap API. Pass vm_page_t's directlypeter2000-05-2110-47/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to various pmap_*() functions instead of looking up the physical address and passing that. In many cases, the first thing the pmap code was doing was going to a lot of trouble to get back the original vm_page_t, or it's shadow pv_table entry. Inspired by: John Dyson's 1998 patches. Also: Eliminate pv_table as a seperate thing and build it into a machine dependent part of vm_page_t. This eliminates having a seperate set of structions that shadow each other in a 1:1 fashion that we often went to a lot of trouble to translate from one to the other. (see above) This happens to save 4 bytes of physical memory for each page in the system. (8 bytes on the Alpha). Eliminate the use of the phys_avail[] array to determine if a page is managed (ie: it has pv_entries etc). Store this information in a flag. Things like device_pager set it because they create vm_page_t's on the fly that do not have pv_entries. This makes it easier to "unmanage" a page of physical memory (this will be taken advantage of in subsequent commits). Add a function to add a new page to the freelist. This could be used for reclaiming the previously wasted pages left over from preloaded loader(8) files. Reviewed by: dillon
* Fixed bug in madvise() / MADV_WILLNEED. When the request is offsetdillon2000-05-141-1/+5
| | | | | | | from the base of the first map_entry the call to pmap_object_init_pt() uses the wrong start VA. MFC to follow. PR: i386/18095
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-054-0/+4
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* Convert the vm_pager_strategy() interface to take a struct bio instead ofphk2000-05-033-84/+62
| | | | | | a struct buf. Don't try to examine B_ASYNC, it is a layering violation to do so. The only current user of this interface is vn(4) which, since it emulates a disk interface, operates on struct bio already.
* Move and staticize the bufchain functions so they become local to thephk2000-05-013-137/+137
| | | | only piece of code using them. This will ease a rewrite of them.
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Implement POSIX.1b shared memory objects. In this implementation,wollman2000-04-221-0/+10
| | | | | | | | shared memory objects are regular files; the shm_open(3) routine uses fcntl(2) to set a flag on the descriptor which tells mmap(2) to automatically apply MAP_NOSYNC. Not objected to by: bde, dillon, dufault, jasone
* vm_object_shadow: Remove an incorrect assertion. In obscure circumstancesalc2000-04-191-3/+0
| | | | | vm_object_shadow can be called on an object with ref_count > 1 and OBJ_ONEMAPPING set. This isn't really a problem for vm_object_shadow.
* Remove unneeded <sys/buf.h> includes.phk2000-04-181-1/+0
| | | | | Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks by 924 bytes.
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-153-10/+10
| | | | | | | | | | Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case. CCD not converted yet, casts to struct buf (still safe) atapi-cd casts to struct buf to examine B_PHYS
* Fix _zget() so that it checks the return from kmem_alloc(), to avoidmsmith2000-04-041-3/+9
| | | | | zttempting to bzero NULL when the kernel map fills up. _zget() will now return NULL as it seems it was originally intended to do.
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-024-22/+22
| | | | | | | | | | | | | (Much of this done by script) Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED. Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack. Add bio_queue field for struct bio aware disksort. Address a lot of stylistic issues brought up by bde.
* Add necessary spl protection for swapper. The problem was located bydillon2000-03-273-3/+19
| | | | | Alfred while testing his SPLASSERT stuff. This is not a complete fix, more protections are probably needed.
* Revert spelling mistake I made in the previous commitcharnier2000-03-2717-18/+18
| | | | Requested by: Alan and Bruce
* Spellingcharnier2000-03-2617-39/+39
|
* Fix one place which knew that B_WRITE was zero.phk2000-03-221-1/+2
| | | | | | Fix a stylistic mistake of mine while here. Found by: Stephen Hocking <shocking@prth.pgs.com>
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-204-7/+7
| | | | | | | | substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo) substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo) This patch is machine generated except for the ccd.c and buf.h parts.
* Remove B_READ, B_WRITE and B_FREEBUF and replace them with a newphk2000-03-204-18/+18
| | | | | | | | | | | | | | | | | | | | | field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set. B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes. Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL. Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading. This change is a step in the direction towards a stackable BIO capability. A lot of this patch were machine generated (Thanks to style(9) compliance!) Vinum users: Greg has not had time to test this yet, be careful.
* Eliminate the undocumented, experimental, non-delivering and highlyphk2000-03-163-30/+0
| | | | dangerous MAX_PERF option.
* Remove unused 3rd argument from vsunlock() which abused B_WRITE.phk2000-03-132-6/+2
|
* Add MAP_NOCORE to mmap(2), and MADV_NOCORE and MADV_CORE to madvise(2).ps2000-02-283-20/+37
| | | | | | | | | | | | This This feature allows you to specify if mmap'd data is included in an application's corefile. Change the type of eflags in struct vm_map_entry from u_char to vm_eflags_t (an unsigned int). Reviewed by: dillon,jdp,alfred Approved by: jkh
* Fix null-pointer dereference crash when the system is intentionallydillon2000-02-163-5/+50
| | | | | | | | | | | | | | | | run out of KVM through a mmap()/fork() bomb that allocates hundreds of thousands of vm_map_entry structures. Add panic to make null-pointer dereference crash a little more verbose. Add a new sysctl, vm.max_proc_mmap, which specifies the maximum number of mmap()'d spaces (discrete vm_map_entry's in the process). The value defaults to around 9000 for a 128MB machine. The test is scaled for the number of processes sharing a vmspace (aka linux threads). Setting the value to 0 disables the feature. PR: kern/16573 Approved by: jkh
* The swapdev_vp changes made to rip out the swap specfs interactiondillon2000-01-251-8/+8
| | | | | | | | also broke diskless swapping. Moving the swapdev_vp initialization to more commonly run code solves the problem. PR: kern/16165 Additional testing by: David Gilbert <dgilbert@velocet.ca>
* Fix a deadlock between msync(..., MS_INVALIDATE) and vm_fault. Thedillon2000-01-211-25/+29
| | | | | | | | | | invalidation code cannot wait for paging to complete while holding a vnode lock, so we don't wait. Instead we simply allow the lower level code to simply block on any busy pages it encounters. I think Yahoo may be the only entity in the entire world that actually uses this msync feature :-). Bug reported by: Paul Saab <paul@mu.org>
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-2/+1
| | | | Suggested by: bde
* Use MAP_NOSYNC for vnodes without any links in their filesystem.guido2000-01-031-0/+7
| | | | | | | | | This is necessary for vmware: it does not use an anonymous mmap for the memory of the virtual system. In stead it creates a temp file an unlinks it. For a 50 MB file, this results in a ot of syncing every 30 seconds. Reviewed by: Matthew Dillon <dillon@backplane.com>
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-2911-18/+18
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Fix the swap backed vn case - this was broken by my rev 1.128 topeter1999-12-282-22/+50
| | | | | | | | | | | | | | | | | | swap_pager.c and related commits. Essentially swap_pager.c is backed out to before the changes, but swapdev_vp is converted into a real vnode with just VOP_STRATEGY(). It no longer abuses specfs vnops and no longer needs a dev_t and /dev/drum (or /dev/swapdev) for the intermediate layer. This essentially restores the vnode interface as the interface to the bottom of the swap pager, and vm_swap.c provides a clean vnode interface. This will need to be revisited when we swap to files (vnodes) - which is the other reason for keeping the vnode interface between the swap pager and the swap devices. OK'ed by: dillon
* Introduce NDFREE (and remove VOP_ABORTOP)eivind1999-12-151-0/+2
|
* Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC todillon1999-12-128-21/+82
| | | | | | | | | | | | | | | | | madvise(). This feature prevents the update daemon from gratuitously flushing dirty pages associated with a mapped file-backed region of memory. The system pager will still page the memory as necessary and the VM system will still be fully coherent with the filesystem. Modifications made by other means to the same area of memory, for example by write(), are unaffected. The feature works on a page-granularity basis. MAP_NOSYNC allows one to use mmap() to share memory between processes without incuring any significant filesystem overhead, putting it in the same performance category as SysV Shared memory and anonymous memory. Reviewed by: julian, alc, dg
* Lock reporting and assertion changes.eivind1999-12-112-2/+2
| | | | | | | | | | | | | | | * lockstatus() and VOP_ISLOCKED() gets a new process argument and a new return value: LK_EXCLOTHER, when the lock is held exclusively by another process. * The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them * Extend the vnode_if.src format to allow more exact specification than locked/unlocked. This commit should not do any semantic changes unless you are using DEBUG_VFS_LOCKS. Discussed with: grog, mch, peter, phk Reviewed by: peter
OpenPOWER on IntegriCloud