summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* Adjust some variables (mostly related to the buffer cache) that holdjhb2009-03-092-5/+5
| | | | | | | | | | | | | | | | | | | address space sizes to be longs instead of ints. Specifically, the follow values are now longs: runningbufspace, bufspace, maxbufspace, bufmallocspace, maxbufmallocspace, lobufspace, hibufspace, lorunningspace, hirunningspace, maxswzone, maxbcache, and maxpipekva. Previously, a relatively small number (~ 44000) of buffers set in kern.nbuf would result in integer overflows resulting either in hangs or bogus values of hidirtybuffers and lodirtybuffers. Now one has to overflow a long to see such problems. There was a check for a nbuf setting that would cause overflows in the auto-tuning of nbuf. I've changed it to always check and cap nbuf but warn if a user-supplied tunable would cause overflow. Note that this changes the ABI of several sysctls that are used by things like top(1), etc., so any MFC would probably require a some gross shims to allow for that. MFC after: 1 month
* Prior to r188331 a map entry's last read offset was only updated by a hardalc2009-02-251-3/+7
| | | | | | fault. In r188331 this update was relocated because of synchronization changes to a place where it would occur on both hard and soft faults. This change again restricts the update to hard faults.
* Revert the addition of the freelist argument for the vm_map_delete()kib2009-02-245-50/+31
| | | | | | | | | function, done in r188334. Instead, collect the entries that shall be freed, in the deferred_freelist member of the map. Automatically purge the deferred freelist when map is unlocked. Tested by: pho Reviewed by: alc
* Add the assertion macros for the map locks. Use them in several mapkib2009-02-241-0/+44
| | | | | | | manipulation functions. Tested by: pho Reviewed by: alc
* Update the comment after the r188334.kib2009-02-241-4/+4
| | | | Reviewed by: alc
* Change the functions to ANSI in those cases where it breaks promotionrdivacky2009-02-241-5/+2
| | | | | | | | to int rule. See ISO C Standard: SS6.7.5.3:15. Approved by: kib (mentor) Reviewed by: warner Tested by: silence on -current
* Put debug.vm_lowmem sysctl under DIAGNOSTIC.rwatson2009-02-231-0/+2
| | | | | Submitted by: sam MFC after: 3 days
* Add a debugging sysctl, debug.vm_lowmem, that when assigned a value ofrwatson2009-02-231-0/+22
| | | | | | | | 1 will trigger a pass through the VM's low-memory handlers, such as protocol and UMA drain routines. This makes it easier to exercise these otherwise rarely-invoked code paths. MFC after: 3 days
* Reduce the scope of the page queues lock in vm_object_page_remove().alc2009-02-211-1/+1
| | | | MFC after: 1 week
* Eliminate stale comments.alc2009-02-201-4/+0
|
* Comment out the assertion from r188321. It is not valid for nfs.kib2009-02-091-1/+1
| | | | Reported by: alc
* Avoid some cases of unnecessary page queues locking by vm_fault's delete-alc2009-02-091-5/+11
| | | | behind heuristic.
* Eliminate OBJ_NEEDGIANT. After r188331, OBJ_NEEDGIANT's only use is by aalc2009-02-084-10/+1
| | | | | | redundant assertion in vm_fault(). Reviewed by: kib
* Remove no longer valid comment.kib2009-02-081-3/+0
| | | | Submitted by: alc
* Improve comments, correct English.kib2009-02-081-8/+8
| | | | Submitted by: alc
* Do not call vm_object_deallocate() from vm_map_delete(), because wekib2009-02-085-14/+52
| | | | | | | | | | hold the map lock there, and might need the vnode lock for OBJT_VNODE objects. Postpone object deallocation until caller of vm_map_delete() drops the map lock. Link the map entries to be freed into the freelist, that is released by the new helper function vm_map_entry_free_freelist(). Reviewed by: tegge, alc Tested by: pho
* In vm_map_sync(), do not call vm_object_sync() while holding map lock.kib2009-02-081-2/+10
| | | | | | | | Reference object, drop the map lock, and then call vm_object_sync(). The object sync might require vnode lock for OBJT_VNODE type objects. Reviewed by: tegge Tested by: pho
* Do not sleep for vnode lock while holding map lock in vm_fault. Try tokib2009-02-083-97/+80
| | | | | | | | | | | | | | | acquire vnode lock for OBJT_VNODE object after map lock is dropped. Because we have the busy page(s) in the object, sleeping there would result in deadlock with vnode resize. Try to get lock without sleeping, and, if the attempt failed, drop the state, lock the vnode, and restart the fault handler from the start with already locked vnode. Because the vnode_pager_lock() function is inlined in vm_fault(), axe it. Based on suggestion by: alc Reviewed by: tegge, alc Tested by: pho
* Add the comments to vm_map_simplify_entry() and vmspace_fork(),kib2009-02-081-0/+20
| | | | | | | describing why several calls to vm_deallocate_object() with locked map do not result in the acquisition of the vnode lock after map lock. Suggested and reviewed by: tegge
* Lock the new map in vmspace_fork(). The newly allocated map should notkib2009-02-081-0/+5
| | | | | | | | | | | be accessible outside vmspace_fork() yet, but locking it would satisfy the protocol of the vm_map_entry_link() and other functions called from vmspace_fork(). Use trylock that is supposedly cannot fail, to silence WITNESS warning of the nested acquisition of the sx lock with the same name. Suggested and reviewed by: tegge
* Assert that vnode is exclusively locked when its vm object is resized.kib2009-02-081-0/+1
| | | | Reviewed by: tegge
* Do not leak the MAP_ENTRY_IN_TRANSITION flag when copying map entrykib2009-02-081-2/+4
| | | | | | | on fork. Otherwise, copied entry cannot be removed in the child map. Reviewed by: tegge MFC after: 2 weeks
* Style.kib2009-02-081-0/+2
|
* - Make the keg abstraction more complete. Permit a zone to have multiplejeff2009-01-254-331/+685
| | | | | | | | | | | backend kegs so it may source compatible memory from multiple backends. This is useful for cases such as NUMA or different layouts for the same memory type. - Provide a new api for adding new backend kegs to secondary zones. - Provide a new flag for adjusting the layout of zones to stagger allocations better across cache lines. Sponsored by: Nokia
* - Mark all standalone INT/LONG/QUAD sysctl's MPSAFE. This is donejhb2009-01-231-53/+53
| | | | | | | | | | inside the SYSCTL() macros and thus does not need to be done for all of the nodes scattered across the source tree. - Mark the name-cache related sysctl's (including debug.hashstat.*) MPSAFE. - Mark vm.loadavg MPSAFE. - Remove GIANT_REQUIRED from vmtotal() (everything in this routine already has sufficient locking) and mark vm.vmtotal MPSAFE. - Mark the vm.stats.(sys|vm).* sysctls MPSAFE.
* Now that vfs_markatime() no longer requires an exclusive lock due tojhb2009-01-211-2/+2
| | | | | | the VOP_MARKATIME() changes, use a shared vnode lock for mmap(). Submitted by: ups
* Extend the struct vm_page wire_count to u_int to avoid the overflowkib2009-01-032-5/+9
| | | | | | | | | | | | | | | | of the counter, that may happen when too many sendfile(2) calls are being executed with this vnode [1]. To keep the size of the struct vm_page and offsets of the fields accessed by out-of-tree modules, swap the types and locations of the wire_count and cow fields. Add safety checks to detect cow overflow and force fallback to the normal copy code for zero-copy sockets. [2] Reported by: Anton Yuzhaninov <citrin citrin ru> [1] Suggested by: alc [2] Reviewed by: alc MFC after: 2 weeks
* Resurrect shared map locks allowing greater concurrency during some mapalc2009-01-012-11/+84
| | | | | | | | | | operations, such as page faults. An earlier version of this change was ... Reviewed by: kib Tested by: pho MFC after: 6 weeks
* Update or eliminate some stale comments.alc2008-12-312-12/+5
|
* Avoid an unnecessary memory dereference in vm_map_entry_splay().alc2008-12-301-3/+4
|
* Style change to vm_map_lookup(): Eliminate a macro of dubious value.alc2008-12-301-11/+8
|
* Move the implementation of the vm map's fast path on address lookup fromalc2008-12-301-34/+23
| | | | | | | vm_map_lookup{,_locked}() to vm_map_lookup_entry(). Having the fast path in vm_map_lookup{,_locked}() limits its benefits to page faults. Moving it to vm_map_lookup_entry() extends its benefits to other operations on the vm map.
* Fix printing of KASSERT message missed in r163604.rnoland2008-12-211-1/+1
| | | | Approved by: kib
* Instead of forcing vn_start_write() to reset mp back to NULL for thekib2008-11-161-2/+1
| | | | | | | | | failed calls with non-NULL vp, explicitely clear mp after failure. Tested by: stass Reviewed by: tegge PR: 123768 MFC after: 1 week
* Support kernel crash mini dumps on ARM architecture.raj2008-11-061-1/+1
| | | | Obtained from: Juniper Networks, Semihalf
* Various comment nits, and typos.keramida2008-11-021-32/+32
|
* Update mmap() comment: no more block devices, so no more block devicerwatson2008-10-221-4/+0
| | | | | | cache coherency questions. MFC after: 3 days
* Remove the struct thread unuseful argument from bufobj interface.attilio2008-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | In particular following functions KPI results modified: - bufobj_invalbuf() - bufsync() and BO_SYNC() "virtual method" of the buffer objects set. Main consumers of bufobj functions are affected by this change too and, in particular, functions which changed their KPI are: - vinvalbuf() - g_vfs_close() Due to the KPI breakage, __FreeBSD_version will be bumped in a later commit. As a side note, please consider just temporary the 'curthread' argument passing to VOP_SYNC() (in bufsync()) as it will be axed out ASAP Reviewed by: kib Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Move the code for doing out-of-memory grass from vm_pageout_scan()kib2008-09-293-71/+87
| | | | | | | | | | | | into the separate function vm_pageout_oom(). Supply a parameter for vm_pageout_oom() describing a reason for the call. Call vm_pageout_oom() from the swp_pager_meta_build() when swap zone is exhausted. Reviewed by: alc Tested by: pho, jhb MFC after: 2 weeks
* Move CTASSERT from header file to source file, per implementation note nowemaste2008-09-262-7/+7
| | | | in the CTASSERT man page.
* Save previous content of the td_fpop before storing the currentkib2008-09-261-0/+6
| | | | | | | | | | | | | | | filedescriptor into it. Make sure that td_fpop is NULL when calling d_mmap from dev_pager_getpages(). Change guards against td_fpop field being non-NULL with private state for another device, and against sudden clearing the td_fpop. This could occur when either a driver method calls another driver through the filedescriptor operation, or a page fault happen while driver is writing to a memory backed by another driver. Noted by: rwatson Tested by: rnoland MFC after: 3 days
* Prevent an integer overflow in vm_pageout_page_stats() on machines with aalc2008-09-211-1/+2
| | | | | | | | large number of physical pages. PR: 126158 Submitted by: Dmitry Tejblum MFC after: 3 days
* Allow the d_mmap driver methods to use cdevpriv KPI during verificationkib2008-09-201-0/+2
| | | | | | | | phase of establishing mapping. Discussed with: rwatson, jhb, rnoland Tested by: rnoland MFC after: 3 days
* Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed threadattilio2008-08-283-6/+7
| | | | | | was always curthread and totally unuseful. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
* Remove unused variable nosleepwithlocks.antoine2008-08-231-7/+0
| | | | | | | PR: 126609 Submitted by: Mateusz Guzik MFC after: 1 month X-MFC: to stable/7 only, this variable is still used in stable/6
* Allow the MD UMA allocator to use VM routines like kmem_*(). Existing code ↵nwhitehorn2008-08-231-1/+1
| | | | | | requires MD allocator to be available early in the boot process, before the VM is fully available. This defines a new VM define (UMA_MD_SMALL_ALLOC_NEEDS_VM) that allows an MD UMA small allocator to become available at the same time as the default UMA allocator. Approved by: marcel (mentor)
* A bunch of formatting fixes brough to light by, or created by the Vimage commitjulian2008-08-201-0/+1
| | | | a few days ago.
* Work around differences in page allocation for initial page tables on xenkmacy2008-08-171-0/+4
| | | | MFC after: 1 month
* Fix REDZONE(9) on amd64 and perhaps other 64 bit targets -- ensure the spaceemaste2008-08-131-0/+2
| | | | | | | that redzone adds to the allocation for storing its metadata is at least as large as the metadata that it will store there. Submitted by: Nima Misaghian
* If a thread that is swapped out is made runnable, then the setrunnable()jhb2008-08-051-38/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | routine wakes up proc0 so that proc0 can swap the thread back in. Historically, this has been done by waking up proc0 directly from setrunnable() itself via a wakeup(). When waking up a sleeping thread that was swapped out (the usual case when waking proc0 since only sleeping threads are eligible to be swapped out), this resulted in a bit of recursion (e.g. wakeup() -> setrunnable() -> wakeup()). With sleep queues having separate locks in 6.x and later, this caused a spin lock LOR (sleepq lock -> sched_lock/thread lock -> sleepq lock). An attempt was made to fix this in 7.0 by making the proc0 wakeup use the ithread mechanism for doing the wakeup. However, this required grabbing proc0's thread lock to perform the wakeup. If proc0 was asleep elsewhere in the kernel (e.g. waiting for disk I/O), then this degenerated into the same LOR since the thread lock would be some other sleepq lock. Fix this by deferring the wakeup of the swapper until after the sleepq lock held by the upper layer has been locked. The setrunnable() routine now returns a boolean value to indicate whether or not proc0 needs to be woken up. The end result is that consumers of the sleepq API such as *sleep/wakeup, condition variables, sx locks, and lockmgr, have to wakeup proc0 if they get a non-zero return value from sleepq_abort(), sleepq_broadcast(), or sleepq_signal(). Discussed with: jeff Glanced at by: sam Tested by: Jurgen Weber jurgen - ish com au MFC after: 2 weeks
OpenPOWER on IntegriCloud