summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
...
* o Lock some page queue accesses, in particular, those by vm_page_unwire().alc2002-07-132-1/+8
|
* o Assert GIANT_REQUIRED on system maps in _vm_map_lock(),alc2002-07-122-9/+6
| | | | | | | | | | _vm_map_lock_read(), and _vm_map_trylock(). Submitted by: tegge o Remove GIANT_REQUIRED from kmem_alloc_wait() and kmem_free_wakeup(). (This clears the way for exec_map accesses to move outside of Giant. The exec_map is not a system map.) o Remove some premature MPSAFE comments. Reviewed by: tegge
* Re-enable the idle page-zeroing code. Remove all IPIs from the idledillon2002-07-121-4/+0
| | | | | | | | | | | | | | | | | page-zeroing code as well as from the general page-zeroing code and use a lazy tlb page invalidation scheme based on a callback made at the end of mi_switch. A number of people came up with this idea at the same time so credit belongs to Peter, John, and Jake as well. Two-way SMP buildworld -j 5 tests (second run, after stabilization) 2282.76 real 2515.17 user 704.22 sys before peter's IPI commit 2266.69 real 2467.50 user 633.77 sys after peter's commit 2232.80 real 2468.99 user 615.89 sys after this commit Reviewed by: peter, jhb Approved by: peter
* Avoid a vm_page_lookup() - that uses a spinlock protected hash. We canpeter2002-07-121-2/+5
| | | | just use the object's memq for our nefarious purposes.
* o Lock some (unfortunately, not yet all) accesses to the page queues.alc2002-07-121-2/+2
|
* o Lock accesses to the page queues.alc2002-07-121-2/+3
|
* o Add a "needs wakeup" flag to the vm_map for use by kmem_alloc_wait()alc2002-07-113-6/+13
| | | | | | | and kmem_free_wakeup(). Previously, kmem_free_wakeup() always called wakeup(). In general, no one was sleeping. o Export vm_map_unlock_and_wait() and vm_map_wakeup() from vm_map.c for use in vm_kern.c.
* o Lock accesses to the page queues in vm_object_terminate().alc2002-07-091-1/+3
| | | | o Eliminate some unnecessary 64-bit arithmetic in vm_object_split().
* vm_page_queue_free_mtx is a spin mutex, not a normal sleep mutex.peter2002-07-081-4/+4
| | | | | | | | | | | | | I do not know why this didn't panic my box, but I have most certainly been using it: peter@overcee[3:14pm]~src/sys/i386/i386-110> sysctl -a | grep zero vm.stats.misc.zero_page_count: 2235 vm.stats.misc.cnt_prezero: 638951 vm.idlezero_enable: 1 vm.idlezero_maxrun: 16 Submitted by: Tor.Egge@cvsup.no.freebsd.org Approved by: Tor's patches are never wrong. :-)
* Turn the zeroidle process off for SMP systems, there is still a possiblepeter2002-07-081-0/+4
| | | | | | | | TLB problem when bouncing from one cpu to another (the original cpu will not have purged its TLB if the it simply went idle). Pointed out by: Tor.Egge@cvsup.no.freebsd.org Approved by: Tor is never wrong. :-)
* Add a special page zero entry point intended to be called via the singlepeter2002-07-082-7/+10
| | | | | | | | | | | | | | | threaded VM pagezero kthread outside of Giant. For some platforms, this is really easy since it can just use the direct mapped region. For others, IPI sending is involved or there are other issues, so grab Giant when needed. We still have preemption issues to deal with, but Alan Cox has an interesting suggestion on how to minimize the problem on x86. Use Luigi's hack for preserving the (lack of) priority. Turn the idle zeroing back on since it can now actually do something useful outside of Giant in many cases.
* Avoid vm_page_lookup() [grabs a spinlock] and just process the upagepeter2002-07-081-14/+9
| | | | | | object memq instead. Suggested by: alc
* Collect all the (now equivalent) pmap_new_proc/pmap_dispose_proc/peter2002-07-073-11/+154
| | | | | | | | | | | | | pmap_swapin_proc/pmap_swapout_proc functions from the MD pmap code and use a single equivalent MI version. There are other cleanups needed still. While here, use the UMA zone hooks to keep a cache of preinitialized proc structures handy, just like the thread system does. This eliminates one dependency on 'struct proc' being persistent even after being freed. There are some comments about things that can be factored out into ctor/dtor functions if it is worth it. For now they are mostly just doing statistics to get a feel of how it is working.
* o Lock accesses to the free queue(s) in vm_page_zero_idle().alc2002-07-071-0/+4
|
* o Traverse the object's memq rather than repeatedly calling vm_page_lookup()alc2002-07-071-5/+2
| | | | in vm_object_split().
* - Hold a lock on the vnode acquired from the file table across the call tojeff2002-07-061-3/+14
| | | | | | vm_mmap() as well as the GETATTR etc. - If the handle is a vnode in vm_mmap() assert that it is locked. - Wiggle Giant around a little to account for the extra vnode operation.
* Remove bogus vm_page_wakeup() in vm_page_cowfault() that will cause panicsgallatin2002-07-051-1/+0
| | | | | | | in the zero-copy send path if a process attempts to write to a page which is still in flight. reviewed by: ken
* Fix a lock order reversal in uma_zdestroy. The uma_mtx needs to be held acrossjeff2002-07-051-4/+4
| | | | | | calls to zone_drain(). Noticed by: scottl
* o Lock accesses to the free page queues in contigmalloc1().alc2002-07-051-0/+2
|
* Remove unnecessary includes.jeff2002-07-052-4/+0
|
* o Resurrect vm_page_lock_queues(), vm_page_unlock_queues(), and the freealc2002-07-042-5/+28
| | | | | | queue lock (revision 1.33 of vm/vm_page.c removed them). o Make the free queue lock a spin lock because it's sometimes acquired inside of a critical section.
* A small cleanup.julian2002-07-041-1/+0
|
* Don;t call teh thread setup routines from here..julian2002-07-041-1/+0
| | | | they are already called when uma calls thread_init()
* o Make the reservation of KVA space for kernel map entries a functionalc2002-07-031-1/+2
| | | | | | | | of the KVA space's size in addition to the amount of physical memory and reduce it by a factor of two. Under the old formula, our reservation amounted to one kernel map entry per virtual page in the KVA space on a 4GB i386.
* Actually use the fini callback.jeff2002-07-031-0/+1
| | | | | Pointy hat to: me :-( Noticed By: Julian
* - Use (OFF_TO_IDX(off) - pi) instead of (OFF_TO_IDX(off - IDX_TO_OFF(pi))).robert2002-07-011-5/+7
| | | | - Reformat a comment.
* o Remove some long dead code: from revision 1.41 of vm/vm_pager.calc2002-07-012-22/+0
| | | | | 3+ years ago. o Remove some unused prototypes.
* Change the type of `tscan' in vm_object_page_clean() to vm_pindex_t,iedowse2002-06-291-1/+1
| | | | as it stores an absolute page index that may not fit in a vm_offset_t.
* Part 1 of KSE-IIIjulian2002-06-295-55/+97
| | | | | | | | | | | | | The ability to schedule multiple threads per process (one one cpu) by making ALL system calls optionally asynchronous. to come: ia64 and power-pc patches, patches for gdb, test program (in tools) Reviewed by: Almost everyone who counts (at various times, peter, jhb, matt, alfred, mini, bernd, and a cast of thousands) NOTE: this is still Beta code, and contains lots of debugging stuff. expect slight instability in signals..
* Avoid using the 64-bit vm_pindex_t in a few places where 64-bitiedowse2002-06-263-16/+19
| | | | | | | | | | | | | types are not required, as the overhead is unnecessary: o In the i386 pmap_protect(), `sindex' and `eindex' represent page indices within the 32-bit virtual address space. o In swp_pager_meta_build() and swp_pager_meta_ctl(), use a temporary variable to store the low few bits of a vm_pindex_t that gets used as an array index. o vm_uiomove() uses `osize' and `idx' for page offsets within a map entry. o In vm_object_split(), `idx' is a page offset within a map entry.
* Use an explicit cast to avoid relying on sign extension to do theiedowse2002-06-261-2/+2
| | | | | | right thing in code such as `vm_pindex_t x = ~SWAP_META_MASK'. Reviewed by: dillon
* At long last, commit the zero copy sockets code.ken2002-06-265-5/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MAKEDEV: Add MAKEDEV glue for the ti(4) device nodes. ti.4: Update the ti(4) man page to include information on the TI_JUMBO_HDRSPLIT and TI_PRIVATE_JUMBOS kernel options, and also include information about the new character device interface and the associated ioctls. man9/Makefile: Add jumbo.9 and zero_copy.9 man pages and associated links. jumbo.9: New man page describing the jumbo buffer allocator interface and operation. zero_copy.9: New man page describing the general characteristics of the zero copy send and receive code, and what an application author should do to take advantage of the zero copy functionality. NOTES: Add entries for ZERO_COPY_SOCKETS, TI_PRIVATE_JUMBOS, TI_JUMBO_HDRSPLIT, MSIZE, and MCLSHIFT. conf/files: Add uipc_jumbo.c and uipc_cow.c. conf/options: Add the 5 options mentioned above. kern_subr.c: Receive side zero copy implementation. This takes "disposable" pages attached to an mbuf, gives them to a user process, and then recycles the user's page. This is only active when ZERO_COPY_SOCKETS is turned on and the kern.ipc.zero_copy.receive sysctl variable is set to 1. uipc_cow.c: Send side zero copy functions. Takes a page written by the user and maps it copy on write and assigns it kernel virtual address space. Removes copy on write mapping once the buffer has been freed by the network stack. uipc_jumbo.c: Jumbo disposable page allocator code. This allocates (optionally) disposable pages for network drivers that want to give the user the option of doing zero copy receive. uipc_socket.c: Add kern.ipc.zero_copy.{send,receive} sysctls that are enabled if ZERO_COPY_SOCKETS is turned on. Add zero copy send support to sosend() -- pages get mapped into the kernel instead of getting copied if they meet size and alignment restrictions. uipc_syscalls.c:Un-staticize some of the sf* functions so that they can be used elsewhere. (uipc_cow.c) if_media.c: In the SIOCGIFMEDIA ioctl in ifmedia_ioctl(), avoid calling malloc() with M_WAITOK. Return an error if the M_NOWAIT malloc fails. The ti(4) driver and the wi(4) driver, at least, call this with a mutex held. This causes witness warnings for 'ifconfig -a' with a wi(4) or ti(4) board in the system. (I've only verified for ti(4)). ip_output.c: Fragment large datagrams so that each segment contains a multiple of PAGE_SIZE amount of data plus headers. This allows the receiver to potentially do page flipping on receives. if_ti.c: Add zero copy receive support to the ti(4) driver. If TI_PRIVATE_JUMBOS is not defined, it now uses the jumbo(9) buffer allocator for jumbo receive buffers. Add a new character device interface for the ti(4) driver for the new debugging interface. This allows (a patched version of) gdb to talk to the Tigon board and debug the firmware. There are also a few additional debugging ioctls available through this interface. Add header splitting support to the ti(4) driver. Tweak some of the default interrupt coalescing parameters to more useful defaults. Add hooks for supporting transmit flow control, but leave it turned off with a comment describing why it is turned off. if_tireg.h: Change the firmware rev to 12.4.11, since we're really at 12.4.11 plus fixes from 12.4.13. Add defines needed for debugging. Remove the ti_stats structure, it is now defined in sys/tiio.h. ti_fw.h: 12.4.11 firmware. ti_fw2.h: 12.4.11 firmware, plus selected fixes from 12.4.13, and my header splitting patches. Revision 12.4.13 doesn't handle 10/100 negotiation properly. (This firmware is the same as what was in the tree previously, with the addition of header splitting support.) sys/jumbo.h: Jumbo buffer allocator interface. sys/mbuf.h: Add a new external mbuf type, EXT_DISPOSABLE, to indicate that the payload buffer can be thrown away / flipped to a userland process. socketvar.h: Add prototype for socow_setup. tiio.h: ioctl interface to the character portion of the ti(4) driver, plus associated structure/type definitions. uio.h: Change prototype for uiomoveco() so that we'll know whether the source page is disposable. ufs_readwrite.c:Update for new prototype of uiomoveco(). vm_fault.c: In vm_fault(), check to see whether we need to do a page based copy on write fault. vm_object.c: Add a new function, vm_object_allocate_wait(). This does the same thing that vm_object allocate does, except that it gives the caller the opportunity to specify whether it should wait on the uma_zalloc() of the object structre. This allows vm objects to be allocated while holding a mutex. (Without generating WITNESS warnings.) vm_object_allocate() is implemented as a call to vm_object_allocate_wait() with the malloc flag set to M_WAITOK. vm_object.h: Add prototype for vm_object_allocate_wait(). vm_page.c: Add page-based copy on write setup, clear and fault routines. vm_page.h: Add page based COW function prototypes and variable in the vm_page structure. Many thanks to Drew Gallatin, who wrote the zero copy send and receive code, and to all the other folks who have tested and reviewed this code over the years.
* Enforce RLIMIT_VMEM on growable mappings (aka the primary stack or anydillon2002-06-261-0/+14
| | | | | | MAP_STACK mapping). Suggested by: alc
* Part I of RLIMIT_VMEM implementation. Implement core functionality fordillon2002-06-262-0/+12
| | | | | | | | | | | | a new resource limit that covers a process's entire VM space, including mmap()'d space. (Part II will be additional code to check RLIMIT_VMEM during exec() but it needs more fleshing out). PR: kern/18209 Submitted by: Andrey Alekseyev <uitm@zenon.net>, Dmitry Kim <jason@nichego.net> MFC after: 7 days
* Complete the initial set of VM changes required to support fulliedowse2002-06-253-8/+8
| | | | | | | | | | | 64-bit file sizes. This step simply addresses the remaining overflows, and does attempt to optimise performance. The details are: o Use a 64-bit type for the vm_object `size' and the size argument to vm_object_allocate(). o Use the correct type for index variables in dev_pager_getpages(), vm_object_page_clean() and vm_object_page_remove(). o Avoid an overflow in the i386 pmap_object_init_pt().
* Turn VM_ALLOC_ZERO into a flag.jeff2002-06-252-5/+7
| | | | | Submitted by: tegge Reviewed by: dillon
* Reduce the amount of code that runs with the zone lock held in slab_zalloc().jeff2002-06-251-6/+8
| | | | This allows us to run the zone initialization functions without any locks held.
* o Eliminate vmspace::vm_minsaddr. It's initialized but never used.alc2002-06-251-5/+5
| | | | | o Replace stale comments in vmspace by "const until freed" annotations on some fields.
* o Remove GIANT_REQUIRED from kmem_alloc_pageable(), kmem_alloc_nofault(),alc2002-06-231-7/+8
| | | | | and kmem_free(). (Annotate as MPSAFE.) o Remove incorrect casts from kmem_alloc_pageable() and kmem_alloc_nofault().
* o Remove the unnecessary acquisition and release of Giant around fdrop()alc2002-06-231-2/+3
| | | | in mmap(2).
* o Reduce the scope of Giant in vm_mmap() to just the code that manipulatesalc2002-06-221-4/+2
| | | | a vnode. (Thus, MAP_ANON and MAP_STACK never acquire Giant.)
* o Replace mtx_assert(&Giant, MA_OWNED) in dev_pager_alloc()alc2002-06-221-11/+17
| | | | | | with the acquisition and release of Giant. (Annotate as MPSAFE.) o Reorder the sanity checks in dev_pager_alloc() to reduce the time that Giant is held.
* o In vm_map_insert(), replace GIANT_REQUIRED by the acquisition andalc2002-06-221-5/+6
| | | | | | | | release of Giant around the direct manipulation of the vm_object and the optional call to pmap_object_init_pt(). o In vm_map_findspace(), remove GIANT_REQUIRED. Instead, acquire and release Giant around the occasional call to pmap_growkernel(). o In vm_map_find(), remove GIANT_REQUIRED.
* o Replace GIANT_REQUIRED in swap_pager_alloc() by the acquisition andalc2002-06-221-3/+4
| | | | release of Giant. (Annotate as MPSAFE.)
* o Remove GIANT_REQUIRED from phys_pager_alloc(). If handle isn't NULL,alc2002-06-221-3/+8
| | | | | acquire and release Giant. If handle is NULL, Giant isn't needed. o Annotate phys_pager_alloc() and phys_pager_dealloc() as MPSAFE.
* o Replace GIANT_REQUIRED in vnode_pager_alloc() by the acquisition andalc2002-06-221-6/+5
| | | | | | | release of Giant. (Annotate as MPSAFE.) o Also, in vnode_pager_alloc(), remove an unnecessary re-initialization of struct vm_object::flags and move a statement that is duplicated in both branches of an if-else.
* o Remove GIANT_REQUIRED from vslock().alc2002-06-221-1/+10
| | | | | | o Annotate kernacc(), useracc(), and vslock() as MPSAFE. Motivated by: alfred
* o Remove GIANT_REQUIRED from vm_map_stack().alc2002-06-211-2/+0
|
* o Remove GIANT_REQUIRED from vm_pager_allocate() and vm_pager_deallocate().alc2002-06-211-3/+0
|
* o Remove an incorrect cast from obreak(). This cast would,alc2002-06-201-5/+5
| | | | | | | | | | | for example, break an sbrk(>=4GB) on 64-bit architectures even if the resource limit allowed it. o Correct an off-by-one error. o Correct a spelling error in a comment. o Reorder an && expression so that the commonly FALSE expression comes first. Submitted by: bde (bullets 1 and 2)
OpenPOWER on IntegriCloud