summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_swap.c
Commit message (Collapse)AuthorAgeFilesLines
* Don't #include <sys/fcntl.h> in <sys/file.h> if KERNEL is defined.bde1997-03-231-2/+2
| | | | | Fixed everything that depended on getting fcntl.h stuff from the wrong place. Most things don't depend on file.h stuff at all.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* The way we get a vnode for swapdev is not quite kosher. In particularphk1996-10-271-4/+18
| | | | | | it breaks in the DEVFS_ROOT case. replicate a bit too much of bdevvp() in here to circumvent the problem. The real problem is the magic that lives in bdevsw[1].
* Don't use NULL in non-pointer contexts.bde1996-07-121-2/+2
|
* Undid last revision. It duplicated part of second last revision.bde1996-03-281-5/+1
|
* devfs_add_devsw() -> devfs_add_devswf modificationsscrappy1996-03-281-1/+5
| | | | Reviewed by: julian@freebsd.org
* Added drum device.bde1996-03-271-1/+12
| | | | Submitted by: partly by "Marc G. Fournier" <scrappy@ki.net>
* In order to fix some concurrency problems with the swap pager earlydyson1996-03-031-1/+2
| | | | | | | on in the FreeBSD development, I had made a global lock around the rlist code. This was bogus, and now the lock is maintained on a per resource list basis. This now allows the rlist code to be used for almost any non-interrupt level application.
* i386/i386/conf.c is no longer needed.. remove it from files.i386julian1995-12-211-3/+16
| | | | | | | | | | | redistribute a few last routines to beter places and shoot the file I haven't act actually 'deleted' the file yet togive people time to have done a config.. I.e. they are likely to have done one in a week or so so I'll remove it then.. it's now empty. makes the question of a USL copyright rather moot.
* Another mega commit to staticize things.phk1995-12-141-2/+4
|
* devsw tables are now arrays of POINTERS to struct [cb]devswjulian1995-12-131-3/+3
| | | | | | | | | seems to work hre just fine though I can't check every file that changed due to limmited h/w, however I've checked enught to be petty happy withe hte code.. WARNING... struct lkm[mumble] has changed so it might be an idea to recompile any lkm related programs
* Replaced nxdump by nodump (if the dump function gets called, then thebde1995-12-101-2/+2
| | | | | | device must be configured, so ENXIO is a bogus errno). Replaced zerosize by nopsize. zerosize was a temporary alias.
* Julian forgot to make the *devsw structures static.phk1995-12-081-3/+3
|
* Pass 3 of the great devsw changesjulian1995-12-081-33/+13
| | | | | | | | | | | | | | | | | | | | | | | most devsw referenced functions are now static, as they are in the same file as their devsw structure. I've also added DEVFS support for nearly every device in the system, however many of the devices have 'incorrect' names under DEVFS because I couldn't quickly work out the correct naming conventions. (but devfs won't be coming on line for a month or so anyhow so that doesn't matter) If you "OWN" a device which would normally have an entry in /dev then search for the devfs_add_devsw() entries and munge to make them right.. check out similar devices to see what I might have done in them in you can't see what's going on.. for a laugh compare conf.c conf.h defore and after... :) I have not doen DEVFS entries for any DISKSLICE devices yet as that will be a much more complicated job.. (pass 5 :) pass 4 will be to make the devsw tables of type (cdevsw * ) rather than (cdevsw) seems to work here.. complaints to the usual places.. :)
* Untangled the vm.h include file spaghetti.dg1995-12-071-1/+3
|
* If you're going to mechanically replicate something in 50 filesjulian1995-11-291-2/+2
| | | | it's best to not have a (compiles cleanly) typo in it! (sigh)
* OK, that's it..julian1995-11-291-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | That's EVERY SINGLE driver that has an entry in conf.c.. my next trick will be to define cdevsw[] and bdevsw[] as empty arrays and remove all those DAMNED defines as well.. Each of these drivers has a SYSINIT linker set entry that comes in very early.. and asks teh driver to add it's own entry to the two devsw[] tables. some slight reworking of the commits from yesterday (added the SYSINIT stuff and some usually wrong but token DEVFS entries to all these devices. BTW does anyone know where the 'ata' entries in conf.c actually reside? seems we don't actually have a 'ataopen() etc... If you want to add a new device in conf.c please make sure I know so I can keep it up to date too.. as before, this is all dependent on #if defined(JREMOD) (and #ifdef DEVFS in parts)
* Remove unused vars & funcs, make things static, protoize a little bit.phk1995-11-201-8/+4
|
* Included <sys/sysproto.h> to get central declarations for syscall argsbde1995-11-121-1/+4
| | | | | | | | | | structs and prototypes for syscalls. Ifdefed duplicated decentralized declarations of args structs. It's convenient to have this visible but they are hard to maintain. Some are already different from the central declarations. 4.4lite2 puts them in comments in the function headers but I wanted to avoid the large changes for that.
* Eliminate sloppy common-style declarations. There should be none left forbde1995-07-291-3/+1
| | | | the LINT configuation.
* NOTE: libkvm, w, ps, 'top', and any other utility which depends on structdg1995-07-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proc or any VM system structure will have to be rebuilt!!! Much needed overhaul of the VM system. Included in this first round of changes: 1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages, haspage, and sync operations are supported. The haspage interface now provides information about clusterability. All pager routines now take struct vm_object's instead of "pagers". 2) Improved data structures. In the previous paradigm, there is constant confusion caused by pagers being both a data structure ("allocate a pager") and a collection of routines. The idea of a pager structure has escentially been eliminated. Objects now have types, and this type is used to index the appropriate pager. In most cases, items in the pager structure were duplicated in the object data structure and thus were unnecessary. In the few cases that remained, a un_pager structure union was created in the object to contain these items. 3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now be removed. For instance, vm_object_enter(), vm_object_lookup(), vm_object_remove(), and the associated object hash list were some of the things that were removed. 4) simple_lock's removed. Discussion with several people reveals that the SMP locking primitives used in the VM system aren't likely the mechanism that we'll be adopting. Even if it were, the locking that was in the code was very inadequate and would have to be mostly re-done anyway. The locking in a uni-processor kernel was a no-op but went a long way toward making the code difficult to read and debug. 5) Places that attempted to kludge-up the fact that we don't have kernel thread support have been fixed to reflect the reality that we are really dealing with processes, not threads. The VM system didn't have complete thread support, so the comments and mis-named routines were just wrong. We now use tsleep and wakeup directly in the lock routines, for instance. 6) Where appropriate, the pagers have been improved, especially in the pager_alloc routines. Most of the pager_allocs have been rewritten and are now faster and easier to maintain. 7) The pagedaemon pageout clustering algorithm has been rewritten and now tries harder to output an even number of pages before and after the requested page. This is sort of the reverse of the ideal pagein algorithm and should provide better overall performance. 8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup have been removed. Some other unnecessary casts have also been removed. 9) Some almost useless debugging code removed. 10) Terminology of shadow objects vs. backing objects straightened out. The fact that the vm_object data structure escentially had this backwards really confused things. The use of "shadow" and "backing object" throughout the code is now internally consistent and correct in the Mach terminology. 11) Several minor bug fixes, including one in the vm daemon that caused 0 RSS objects to not get purged as intended. 12) A "default pager" has now been created which cleans up the transition of objects to the "swap" type. The previous checks throughout the code for swp->pg_data != NULL were really ugly. This change also provides the rudiments for future backing of "anonymous" memory by something other than the swap pager (via the vnode pager, for example), and it allows the decision about which of these pagers to use to be made dynamically (although will need some additional decision code to do this, of course). 13) (dyson) MAP_COPY has been deprecated and the corresponding "copy object" code has been removed. MAP_COPY was undocumented and non- standard. It was furthermore broken in several ways which caused its behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will continue to work correctly, but via the slightly different semantics of MAP_PRIVATE. 14) (dyson) Sharing maps have been removed. It's marginal usefulness in a threads design can be worked around in other ways. Both #12 and #13 were done to simplify the code and improve readability and maintain- ability. (As were most all of these changes) TODO: 1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing this will reduce the vnode pager to a mere fraction of its current size. 2) Rewrite vm_fault and the swap/vnode pagers to use the clustering information provided by the new haspage pager interface. This will substantially reduce the overhead by eliminating a large number of VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be improved to provide both a "behind" and "ahead" indication of contiguousness. 3) Implement the extended features of pager_haspage in swap_pager_haspage(). It currently just says 0 pages ahead/behind. 4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps via a much more general mechanism that could also be used for disk striping of regular filesystems. 5) Do something to improve the architecture of vm_object_collapse(). The fact that it makes calls into the swap pager and knows too much about how the swap pager operates really bothers me. It also doesn't allow for collapsing of non-swap pager objects ("unnamed" objects backed by other pagers).
* Remove trailing whitespace.rgrimes1995-05-301-2/+2
|
* Removed check for sw_dev == NODEV; this is a normal condition for swapdg1995-05-251-3/+2
| | | | | | | over NFS and was gratuitously panicing when it happens. Reviewed by: John Dyson Submitted by: Pierre Beyssac via Poul-Henning Kamp
* NFS diskless operation was broken because swapdev_vp wasn't initialized.dg1995-05-191-1/+6
| | | | | | | These changes solve the problem in a general way by moving the initialization out of the individual fs_mountroot's and into swaponvp(). Submitted by: Poul-Henning Kamp
* Fixed a bug that managed to slip in during Poul's dynamic swap partitiondg1995-05-181-17/+11
| | | | | | | | changes. The check for nswap was bogus, but the code was so convoluted that it was difficult to tell. It's better now. :-) Reviewed by: David Greenman (extensively), and John Dyson Submitted by: Poul-Henning Kamp, w/tweaks by me.
* Changed swap partition handling/allocation so that it doesn'tdg1995-05-141-117/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | require specific partitions be mentioned in the kernel config file ("swap on foo" is now obsolete). From Poul-Henning: The visible effect is this: As default, unless options "NSWAPDEV=23" is in your config, you will have four swap-devices. You can swapon(2) any block device you feel like, it doesn't have to be in the kernel config. There is a performance/resource win available by getting the NSWAPDEV right (but only if you have just one swap-device ??), but using that as default would be too restrictive. The invisible effect is that: Swap-handling disappears from the $arch part of the kernel. It gets a lot simpler (-145 lines) and cleaner. Reviewed by: John Dyson, David Greenman Submitted by: Poul-Henning Kamp, with minor changes by me.
* I'm about to jump on the swap-initialization, and having talkedphk1995-05-121-132/+1
| | | | | | | | | | | | | | | with davidg about it, I hereby kill two undocumented misfeatures: The code to skip a miniroot in the swapdev is not particular useful, and if we need it we need it to be done properly, ie size the fs and skip all of it not some hardcoded size, and subtract what we skip from the length in the first place. The SEQSWAP dies too. It's not the way to do it, it doesn't work, and nobody have expressed any great desire for it to work. The way to implement it correctly would be a second argument to swapon(2) to give a priority/policy information. Low priority swapdevs can be made so by adding them at a far offset (0x80000000 kind of thing), with almost no modification to the strategy routine (in particular a offset per swapdev). But until the need is obvious, it will not be done.
* Add and move declarations to fix all of the warnings from `gcc -Wimplicit'bde1995-03-161-1/+3
| | | | | | (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.
* Fixed some formatting weirdness that I overlooked in the previous commit.dg1995-01-101-2/+2
|
* These changes embody the support of the fully coherent merged VM buffer cache,dg1995-01-091-46/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Preallocate the first swap block to work around a failure with swap startingdg1994-11-221-2/+2
| | | | | at physical block 0. Note that this will show up in pstat -s and swapinfo as space "in use". In reality, the space is simply never made available.
* Contrary to my last commit here: NFS-swap is enabled automatically.phk1994-10-221-1/+15
|
* Fixed a comment from the previous commit.dg1994-10-221-4/+4
|
* ATTENTION!phk1994-10-211-9/+4
| | | | | | | | | | | | | | From now on, >all< swapdevices must be activated with "swapon". If you havn't got it, add this line to /etc/fstab: /dev/wd0b none swap sw 0 0 ne sec Reason: We want our GENERIC* kernels to have a large selection of swap-devices, but on the other hand, we don't want to use a wd0b as swap when we boot of a floppy. This way, we will never use a unexpected swapdevice. Nothing else has changed.
* Got rid of map.h. It's a leftover from the rmap code, and we use rlists.dg1994-10-091-4/+4
| | | | Changed swapmap into swaplist.
* Cosmetics: unused vars, ()'s, #include's &c &c to silence gcc.phk1994-10-091-10/+15
| | | | Reviewed by: davidg
* Removed unimplemented subr_rmap.c and unused references to it.dg1994-09-251-24/+1
|
* Fixed problem with no swap on boot device, but there is some on andg1994-09-111-3/+7
| | | | | alternate device (as specified via kernel config file)...that casues the machine to panic.
* Incorporated post 1.1.5 work from John Dyson. This includes performancedg1994-08-061-13/+3
| | | | | | | | | improvements via the new routines pmap_qenter/pmap_qremove and pmap_kenter/ pmap_kremove. These routine allow fast mapping of pages for those architectures that have "normal" MMUs. Also included is a fix to the pageout daemon to properly check a queue end condition. Submitted by: John Dyson
* Added $Id$dg1994-08-021-0/+1
|
* The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.rgrimes1994-05-251-2/+14
| | | | | Reviewed by: Rodney W. Grimes Submitted by: John Dyson and David Greenman
* BSD 4.4 Lite Kernel Sourcesrgrimes1994-05-241-0/+427
OpenPOWER on IntegriCloud