summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Don't use an uninitialized field reserved for callers in the bio structuretegge2001-10-151-3/+4
| | | | | | | passed to swap_pager_strategy(). Instead, use a field reserved for drivers and initialize it before usage. Reviewed by: dillon
* Don't remove all mappings of a swapped out process if the vm map containedtegge2001-10-141-1/+5
| | | | | | wired entries. vm_fault_unwire() depends on the mapping being intact. Reviewed by: dillon
* Fix locking violations during page wiring:tegge2001-10-141-3/+32
| | | | | | | | | | | | - vm map entries are not valid after the map has been unlocked. - An exclusive lock on the map is needed before calling vm_map_simplify_entry(). Fix cleanup after page wiring failure to unwire all pages that had been successfully wired before the failure was detected. Reviewed by: dillon
* Makes contigalloc[1]() create the vm_map / underlying wired pages in thedillon2001-10-131-4/+12
| | | | | | | | | | | kernel map and object in a manner that contigfree() is actually able to free. Previously contigfree() freed up the KVA space but could not unwire & free the underlying VM pages due to mismatched pageability between the map entry and the VM pages. Submitted by: Thomas Moestl <tmoestl@gmx.net> Testing by: mark tinguely <tinguely@web.cs.ndsu.nodak.edu> MFC after: 3 days
* Finally fix the VM bug where a file whos EOF occurs in the middle of a pagedillon2001-10-121-3/+21
| | | | | | | | | | | | | | | | | would sometimes prevent a dirty page from being cleaned, even when synced, resulting in the dirty page being re-flushed to disk every 30-60 seconds or so, forever. The problem is that when the filesystem flushes a page to its backing file it typically does not clear dirty bits representing areas of the page that are beyond the file EOF. If the file is also mmap()'d and a fault is taken, vm_fault (properly, is required to) set the vm_page_t->dirty bits to VM_PAGE_BITS_ALL. This combination could leave us with an uncleanable, unfreeable page. The solution is to have the vnode_pager detect the edge case and manually clear the dirty bits representing areas beyond the file EOF. The filesystem does the rest and the page comes up clean after the write completes. MFC after: 3 days
* Change the kernel's ucred API as follows:jhb2001-10-112-21/+14
| | | | | | | | - crhold() returns a reference to the ucred whose refcount it bumps. - crcopy() now simply copies the credentials from one credential to another and has no return value. - a new crshared() primitive is added which returns true if a ucred's refcount is > 1 and false (0) otherwise.
* Add missing includes of sys/ktr.h.jhb2001-10-111-0/+1
|
* Make MAXTSIZ, DFLDSIZ, MAXDSIZ, DFLSSIZ, MAXSSIZ, SGROWSIZ loaderps2001-10-104-11/+15
| | | | | | | tunable. Reviewed by: peter MFC after: 2 weeks
* Remove the SSLEEP case from the load average computation. This hasiedowse2001-10-041-5/+0
| | | | | | | been a no-op for as long as our CVS history goes back. Processes in state SSLEEP could only be counted if p_slptime == 0, but immediately before loadav() is called, schedcpu() has just incremented p_slptime on all SSLEEP processes.
* o Modify access control checks in mmap() to use securelevel_gt() insteadrwatson2001-09-261-1/+1
| | | | | | of direct variable access. Obtained from: TrustedBSD Project
* KSE Milestone 2julian2001-09-1215-213/+263
| | | | | | | | | | | | | | 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
* Rip some well duplicated code out of cpu_wait() and cpu_exit() and movepeter2001-09-102-2/+19
| | | | | | | | | | | | it to the MI area. KSE touched cpu_wait() which had the same change replicated five ways for each platform. Now it can just do it once. The only MD parts seemed to be dealing with fpu state cleanup and things like vm86 cleanup on x86. The rest was identical. XXX: ia64 and powerpc did not have cpu_throw(), so I've put a functional stub in place. Reviewed by: jake, tmm, dillon
* Process priority is locked by the sched_lock, not the proc lock.jhb2001-09-011-2/+2
|
* make swapon() MPSAFE (will adjust syscalls.master later)dillon2001-08-311-5/+13
|
* mark obreak() and ovadvise() as being MPSAFEdillon2001-08-311-0/+6
|
* Cleanupdillon2001-08-311-27/+68
|
* Implement idle zeroing of pages. I've been tinkering with thispeter2001-08-253-72/+100
| | | | | | | | | | | | | | on and off since John Dyson left his work-in-progress. It is off by default for now. sysctl vm.zeroidle_enable=1 to turn it on. There are some hacks here to deal with the present lack of preemption - we yield after doing a small number of pages since we wont preempt otherwise. This is basically Matt's algorithm [with hysteresis] with an idle process to call it in a similar way it used to be called from the idle loop. I cleaned up the includes a fair bit here too.
* Remove support for the badly broken MAP_INHERIT (from -current only).dillon2001-08-241-4/+1
|
* Move most of the kernel submap initialization code, including thedillon2001-08-222-0/+106
| | | | | | | | timeout callwheel and buffer cache, out of the platform specific areas and into the machine independant area. i386 and alpha adjusted here. Other cpus can be fixed piecemeal. Reviewed by: freebsd-smp, jake
* KASSERT if vm_page_t->wire_count overflows.dillon2001-08-221-0/+1
|
* Limit the amount of KVM reserved for the buffer cache and for swap-metadillon2001-08-201-2/+5
| | | | | | | | | | | | | | | information. The default limits only effect machines with > 1GB of ram and can be overriden with two new kernel conf variables VM_SWZONE_SIZE_MAX and VM_BCACHE_SIZE_MAX, or with loader variables kern.maxswzone and kern.maxbcache. This has the effect of leaving more KVM available for sizing NMBCLUSTERS and 'maxusers' and should avoid tripups where a sysad adds memory to a machine and then sees the kernel panic on boot due to running out of KVM. Also change the default swap-meta auto-sizing calculation to allocate half of what it was previously allocating. The prior defaults were way too high. Note that we cannot afford to run out of swap-meta structures so we still stay somewhat conservative here.
* - Remove asleep(), await(), and M_ASLEEP.jhb2001-08-101-5/+2
| | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter
* - Remove asleep(), await(), and M_ASLEEP.jhb2001-08-102-28/+0
| | | | | | | | | - Callers of asleep() and await() have been converted to calling tsleep(). The only caller outside of M_ASLEEP was the ata driver, which called both asleep() and await() with spl-raised, so there was no need for the asleep() and await() pair. M_ASLEEP was unused. Reviewed by: jasone, peter
* Add a missing semicolon to unbreak the kernel build with INVARIANTStmm2001-08-051-1/+1
| | | | | | | | (which was unfortunately turned off in the confguration I used for the last test build). Spotted by: jake Pointy hat to: tmm
* Whitespace fixes.jhb2001-08-042-2/+2
|
* Add a zdestroy() function to the zone allocator. This is needed for thetmm2001-08-042-0/+109
| | | | | unload case of modules that use their own zones. It has been tested with the nfs module.
* Fixups for the initial allocation by dillon:alfred2001-08-021-7/+15
| | | | | | | | | | | | 1) allocate fewer buckets 2) when failing to allocate swap zone, keep reducing the zone by a third rather than a half in order to reduce the chance of allocating way too little. I also moved around some code for readability. Suggested by: dillon Reviewed by: dillon
* Oops. Last commit to vm_object.c should have got these files too.jake2001-07-313-8/+4
| | | | | | | Remove the use of atomic ops to manipulate vm_object and vm_page flags. Giant is required here, so they are superfluous. Discussed with: dillon
* Remove the use of atomic ops to manipulate vm_object and vm_page flags.jake2001-07-311-11/+6
| | | | | | Giant is required here, so they are superfluous. Discussed with: dillon
* 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.
* make vm_page_select_cache staticassar2001-07-232-2/+1
| | | | Requested by: bde
* (vm_page_select_cache): add prototypeassar2001-07-211-0/+1
|
* The i386-specific includes in this file were "fixed" by bracketing them withbenno2001-07-151-3/+3
| | | | | | | #ifndef __alpha__. Fix this for the rest of the world by turning it into #ifdef __i386__. Reviewed by: obrien
* Fix missing newline and terminator at the end of the vm.zone sysctl.des2001-07-091-2/+1
|
* Apply field bandages to the includes so compiles happen on alpha.mjacob2001-07-051-0/+6
|
* Move vm_page_zero_idle() from machine-dependant sections to adillon2001-07-051-0/+117
| | | | | machine-independant source file, vm/vm_zeroidle.c. It was exactly the same for all platforms and updating them all was getting annoying.
* Reorg vm_page.c into vm_page.c, vm_pageq.c, and vm_contig.c (for contigmalloc).dillon2001-07-046-465/+621
| | | | | | | | | | | Also removed some spl's and added some VM mutexes, but they are not actually used yet, so this commit does not really make any operational changes to the system. vm_page.c relates to vm_page_t manipulation, including high level deactivation, activation, etc... vm_pageq.c relates to finding free pages and aquiring exclusive access to a page queue (exclusivity part not yet implemented). And the world still builds... :-)
* Change inlines back into mainline code in preparation for mutexing. Also,dillon2001-07-046-840/+729
| | | | | | | | most of these inlines had been bloated in -current far beyond their original intent. Normalize prototypes and function declarations to be ANSI only (half already were). And do some general cleanup. (kernel size also reduced by 50-100K, but that isn't the prime intent)
* whitespace / register cleanupdillon2001-07-0412-80/+81
|
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-0423-658/+294
| | | | | | | | | (this commit is just the first stage). Also add various GIANT_ macros to formalize the removal of Giant, making it easy to test in a more piecemeal fashion. These macros will allow us to test fine-grained locks to a degree before removing Giant, and also after, and to remove Giant in a piecemeal fashion via sysctl's on those subsystems which the authors believe can operate without Giant.
* Fix a XXX comment by moving the initialization of the number of pbuf'sjhb2001-07-031-9/+9
| | | | | for the vnode pager to a new vnode pager init method instead of making it a hack in getpages().
* - Protect all accesses to nsw_[rw]count{,_{,a}sync} with the pbuf mutex.jhb2001-06-221-4/+4
| | | | | - Don't drop the vm mutex while grabbing the pbuf mutex to manipulate said variables.
* Introduce numerous SMP friendly changes to the mbuf allocator. Namely,bmilekic2001-06-224-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduce a modified allocation mechanism for mbufs and mbuf clusters; one which can scale under SMP and which offers the possibility of resource reclamation to be implemented in the future. Notable advantages: o Reduce contention for SMP by offering per-CPU pools and locks. o Better use of data cache due to per-CPU pools. o Much less code cache pollution due to excessively large allocation macros. o Framework for `grouping' objects from same page together so as to be able to possibly free wired-down pages back to the system if they are no longer needed by the network stacks. Additional things changed with this addition: - Moved some mbuf specific declarations and initializations from sys/conf/param.c into mbuf-specific code where they belong. - m_getclr() has been renamed to m_get_clrd() because the old name is really confusing. m_getclr() HAS been preserved though and is defined to the new name. No tree sweep has been done "to change the interface," as the old name will continue to be supported and is not depracated. The change was merely done because m_getclr() sounds too much like "m_get a cluster." - TEMPORARILY disabled mbtypes statistics displaying in netstat(1) and systat(1) (see TODO below). - Fixed systat(1) to display number of "free mbufs" based on new per-CPU stat structures. - Fixed netstat(1) to display new per-CPU stats based on sysctl-exported per-CPU stat structures. All infos are fetched via sysctl. TODO (in order of priority): - Re-enable mbtypes statistics in both netstat(1) and systat(1) after introducing an SMP friendly way to collect the mbtypes stats under the already introduced per-CPU locks (i.e. hopefully don't use atomic() - it seems too costly for a mere stat update, especially when other locks are already present). - Optionally have systat(1) display not only "total free mbufs" but also "total free mbufs per CPU pool." - Fix minor length-fetching issues in netstat(1) related to recently re-enabled option to read mbuf stats from a core file. - Move reference counters at least for mbuf clusters into an unused portion of the cluster itself, to save space and need to allocate a counter. - Look into introducing resource freeing possibly from a kproc. Reviewed by (in parts): jlemon, jake, silby, terry Tested by: jlemon (Intel & Alpha), mjacob (Intel & Alpha) Preliminary performance measurements: jlemon (and me, obviously) URL: http://people.freebsd.org/~bmilekic/mb_alloc/
* Don't lock around swap_pager_swap_init() that is only called once duringjhb2001-06-201-0/+2
| | | | | the pagedaemon's startup code since it calls malloc which results in lock order reversals.
* Put the scheduler, vmdaemon, and pagedaemon kthreads back under Giant forjhb2001-06-202-19/+1
| | | | | now. The proc locking isn't actually safe yet and won't be until the proc locking is finished.
* Cleanup the tabbingdillon2001-06-111-17/+16
|
* Two fixes to the out-of-swap process termination code. First, start killingdillon2001-06-093-3/+44
| | | | | | | | | | | processes a little earlier to avoid a deadlock. Second, when calculating the 'largest process' do not just count RSS. Instead count the RSS + SWAP used by the process. Without this the code tended to kill small inconsequential processes like, oh, sshd, rather then one of the many 'eatmem 200MB' I run on a whim :-). This fix has been extensively tested on -stable and somewhat tested on -current and will be MFCd in a few days. Shamed into fixing this by: ps
* Change the way information about swap devices is exported to be moretmm2001-06-012-28/+46
| | | | | | | | 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.
* Clean up the code exporting interrupt statistics via sysctl a bit:tmm2001-06-011-30/+0
| | | | | | | | | | | | | - move the sysctl code to kern_intr.c - do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine the length of the intrcnt array - move the declarations of intrnames, eintrnames, intrcnt and eintrcnt from machine-dependent include files to sys/interrupt.h - remove the hw.nintr sysctl, it is not needed. - fix various style bugs Requested by: bde Reviewed by: bde (some time ago)
* Don't hold the VM lock across VOP's and other things that can sleep.jhb2001-05-291-2/+19
|
OpenPOWER on IntegriCloud