summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_swap.c
Commit message (Collapse)AuthorAgeFilesLines
* KSE Milestone 2julian2001-09-121-16/+16
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* make swapon() MPSAFE (will adjust syscalls.master later)dillon2001-08-311-5/+13
|
* Permit direct swapping to NFS regular files using swapon(2). Weiedowse2001-07-281-3/+10
| | | | | | | | | | already allow this for NFS swap configured via BOOTP, so it is known to work fine. For many diskless configurations is is more flexible to have the client set up swapping itself; it can recreate a sparse swap file to save on server space for example, and it works with a non-NFS root filesystem such as an in-kernel filesystem image.
* whitespace / register cleanupdillon2001-07-041-5/+5
|
* Change the way information about swap devices is exported to be moretmm2001-06-011-28/+34
| | | | | | | | canonical: define a versioned struct xswdev, and add a sysctl node handler that allows the user to get this structure for a certain device index by specifying this index as last element of the MIB. This new node handler, vm.swap_info, replaces the old vm.nswapdev and vm.swapdevX.* (where X was the index) sysctls.
* Introduce per-swap area accounting in the VM system, and exportrwatson2001-02-231-2/+32
| | | | | | | | | | | this information via the vm.nswapdev sysctl (number of swap areas) and vm.swapdevX nodes (where X is the device), which contain the MIBs dev, blocks, used, and flags. These changes are required to allow top and other userland swap-monitoring utilities to run without setgid kmem. Submitted by: Thomas Moestl <tmoestl@gmx.net> Reviewed by: freebsd-audit
* - If swap metadata does not fit into the KVM, reduce the number oftanimura2000-12-131-0/+8
| | | | | | | | | | | | | | | struct swblock entries by dividing the number of the entries by 2 until the swap metadata fits. - Reject swapon(2) upon failure of swap_zone allocation. This is just a temporary fix. Better solutions include: (suggested by: dillon) o reserving swap in SWAP_META_PAGES chunks, and o swapping the swblock structures themselves. Reviewed by: alfred, dillon
* The swap bitmap allocator was not calculating the bitmap size properlydillon2000-10-131-3/+17
| | | | | | | | | | | | | | | in the face of non-stripe-aligned swap areas. The bug could cause a panic during boot. Refuse to configure a swap area that is too large (67 GB or so) Properly document the power-of-2 requirement for SWB_NPAGES. The patch is slightly different then the one Tor enclosed in the P.R., but accomplishes the same thing. PR: kern/20273 Submitted by: Tor.Egge@fast.no
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <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
* Remove unneeded #include <vm/vm_zone.h>phk2000-04-301-1/+0
| | | | Generated by: src/tools/tools/kerninclude
* Complete the bio/buf divorce for all code below devfs::strategyphk2000-04-151-3/+3
| | | | | | | | | | 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
* Move B_ERROR flag to b_ioflags and call it BIO_ERROR.phk2000-04-021-3/+3
| | | | | | | | | | | | | (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.
* Revert spelling mistake I made in the previous commitcharnier2000-03-271-1/+1
| | | | Requested by: Alan and Bruce
* Spellingcharnier2000-03-261-1/+1
|
* Rename the existing BUF_STRATEGY() to DEV_STRATEGY()phk2000-03-201-1/+1
| | | | | | | | 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-201-1/+1
| | | | | | | | | | | | | | | | | | | | | 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.
* 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>
* Give vn_isdisk() a second argument where it can return a suitable errno.phk2000-01-101-2/+1
| | | | Suggested by: bde
* Fix the swap backed vn case - this was broken by my rev 1.128 topeter1999-12-281-9/+42
| | | | | | | | | | | | | | | | | | 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
|
* Report swapdevices as cdevs rather than bdevs.phk1999-11-291-1/+1
| | | | Remove unused dev2budev() function.
* Isolate the swapdev_vp "not quite" vnode in the only source file whichphk1999-11-221-35/+4
| | | | | | needs it now that /dev/drum is gone. Reviewed by: eivind, peter
* Remove the non-functional "swap device" userland front-end to thepeter1999-11-181-75/+3
| | | | | | | | | | | | | | | | | | | | | multiplexed underlying swap devices (/dev/drum). The only thing it did was to allow root to open /dev/drum, but not do anything with it. Various utilities used to grovel around in here, but Matt has written a much nicer (and clean) front-end to this for libkvm, and nothing uses the old system any more. The VM system was calling VOP_STRATEGY() on the vp of the first underlying swap device (not the /dev/drum one, the first real device), and using the VOP system to indirectly (and only) call swstrategy() to choose an underlying device and enqueue it on that device. I have changed it to avoid diverting through the VOP system and to call the only possible target directly, saving a little bit of time and some complexity. In all, nothing much changes, except some scaffolding to support the roundabout way of calling swstrategy() is gone. Matt gave me the ok to do this some time ago, and I apologize for taking so long to get around to it.
* Fix a panic(8) implementation:phk1999-10-081-5/+17
| | | | | | | hexdump -C < /dev/drum by simply refusing to do I/O from userland. a panic. I'm not sure we even need /dev/drum anymore, it seems to have been broken for a long time thi
* Introduce swopen to prevent blockdevice opens and insist on minor==0.phk1999-10-041-1/+17
|
* Give the swap device a D_DISK flag against my better judgement.phk1999-10-041-1/+1
| | | | TODO: add an open routing which fails for bdev opens.
* Remove five now unused fields from struct cdevsw. They should neverphk1999-09-251-5/+0
| | | | | | | | have been there in the first place. A GENERIC kernel shrinks almost 1k. Add a slightly different safetybelt under nostop for tty drivers. Add some missing FreeBSD tags
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Simplify the handling of VCHR and VBLK vnodes using the new dev_t:phk1999-08-261-6/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Make the alias list a SLIST. Drop the "fast recycling" optimization of vnodes (including the returning of a prexisting but stale vnode from checkalias). It doesn't buy us anything now that we don't hardlimit vnodes anymore. Rename checkalias2() and checkalias() to addalias() and addaliasu() - which takes dev_t and udev_t arg respectively. Make the revoke syscalls use vcount() instead of VALIASED. Remove VALIASED flag, we don't need it now and it is faster to traverse the much shorter lists than to maintain the flag. vfs_mountedon() can check the dev_t directly, all the vnodes point to the same one. Print the devicename in specfs/vprint(). Remove a couple of stale LFS vnode flags. Remove unimplemented/unused LK_DRAINED;
* When the SYSINIT() was removed, it was replaced with a make_dev on-demandgreen1999-08-241-1/+2
| | | | | | | | | | | creation of /dev/drum via calling swapon. However, the make_dev has a bogus (insofar that it hasn't been added yet) cdevsw, so later we end up crashing with a null pointer dereference on the swap vp's specinfo. The specinfo points to a dev_t with a major of 254 (uninitialized), and we get a crash on its d_strategy being called. The simple solution to this is to call cdevsw_add before the make_dev is ever used. This fixes the panic which occurred upon swapping.
* Convert DEVFS hooks in (most) drivers to make_dev().phk1999-08-231-33/+6
| | | | | | | | | | | | | | | | Diskslice/label code not yet handled. Vinum, i4b, alpha, pc98 not dealt with (left to respective Maintainers) Add the correct hook for devfs to kern_conf.c The net result of this excercise is that a lot less files depends on DEVFS, and devtoname() gets more sensible output in many cases. A few drivers had minor additional cleanups performed relating to cdevsw registration. A few drivers don't register a cdevsw{} anymore, but only use make_dev().
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-131-4/+4
|
* Decommision miscfs/specfs/specdev.h. Most of it goes into <sys/conf.h>,phk1999-08-081-4/+2
| | | | | | a few lines into <sys/vnode.h>. Add a few fields to struct specinfo, paving the way for the fun part.
* Make a dev2budev() function, and use it. This refixes pstat (working, broken,green1999-07-201-2/+2
| | | | | | | working, broken, working) and savecore (working, working, broken, working, working). Sorta Reviewed by: phk
* Add a field to struct swdevt to avoid a bogus udev2dev() call.phk1999-07-171-2/+3
|
* I have not one single time remembered the name of this function correctlyphk1999-07-171-2/+2
| | | | so obviously I gave it the wrong name. s/umakedev/makeudev/g
* add unused argument to udev2dev() to make kernel compiledache1999-07-071-2/+2
|
* Reinstate the previous fix for the broken export of a dev_t in sw_dev, convertmsmith1999-07-071-3/+3
| | | | back to a dev_t when the value is actually used.
* Back out previous commit. It was wrong, and caused panics.green1999-07-071-1/+1
|
* swdevt should contain a udev_t not a devt. This resulted in bogusmsmith1999-07-061-2/+2
| | | | | | swap device name reporting. Submitted by: Bill Swingle <unfurl@freebsd.org>
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-2/+2
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Shorten a detour around dev_t to get a udev_t created.phk1999-06-011-3/+2
|
* Simplify cdevsw registration.phk1999-05-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-7/+22
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Fix a udev_t/dev_t mismatch which prevent paging from working.phk1999-05-121-2/+2
|
* No point in swapdev being a static global when used only locally.phk1999-05-091-2/+2
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-4/+4
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-071-4/+4
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-16/+2
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
OpenPOWER on IntegriCloud