summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
...
* 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)
* o Acquire and release the vm_map lock instead of Giant in obreak().alc2002-06-201-11/+7
| | | | | | Consequently, use vm_map_insert() and vm_map_delete(), which expect the vm_map to be locked, instead of vm_map_find() and vm_map_remove(), which do not.
* - Move the computation of pflags out of the page allocation loop injeff2002-06-191-17/+21
| | | | | | | kmem_malloc() - zero fill pages if PG_ZERO bit is not set after allocation in kmem_malloc() Suggested by: alc, jake
* - Remove bogus use of kmem_alloc that was inherited from the old zonejeff2002-06-192-17/+18
| | | | | | | | | allocator. - Properly set M_ZERO when talking to the back end page allocators for non malloc zones. This forces us to zero fill pages when they are first brought into a cache. - Properly handle M_ZERO in uma_zalloc_internal. This fixes a problem where per cpu buckets weren't always getting zeroed.
* Teach kmem_malloc about M_ZERO.jeff2002-06-191-4/+10
|
* o Replace GIANT_REQUIRED in vm_object_coalesce() by the acquisition andalc2002-06-192-8/+10
| | | | | | | | release of Giant. o Reduce the scope of GIANT_REQUIRED in vm_map_insert(). These changes will enable us to remove the acquisition and release of Giant from obreak().
* o Remove LK_CANRECURSE from the vm_map lock.alc2002-06-181-2/+2
|
* Honor the BUCKETCACHE flag on free as well.jeff2002-06-171-4/+9
|
* - Introduce the new M_NOVM option which tells uma to only check the currentlyjeff2002-06-174-4/+21
| | | | | | | | | | | | | | | | allocated slabs and bucket caches for free items. It will not go ask the vm for pages. This differs from M_NOWAIT in that it not only doesn't block, it doesn't even ask. - Add a new zcreate option ZONE_VM, that sets the BUCKETCACHE zflag. This tells uma that it should only allocate buckets out of the bucket cache, and not from the VM. It does this by using the M_NOVM option to zalloc when getting a new bucket. This is so that the VM doesn't recursively enter itself while trying to allocate buckets for vm_map_entry zones. If there are already allocated buckets when we get here we'll still use them but otherwise we'll skip it. - Use the ZONE_VM flag on vm map entries and pv entries on x86.
* o Acquire and release Giant in vm_map_wakeup() to preventalc2002-06-171-0/+7
| | | | | | a lost wakeup(). Reviewed by: tegge
* o Remove GIANT_REQUIRED from vm_fault_user_wire().alc2002-06-162-7/+1
| | | | | | o Move pmap_pageable() outside of Giant in vm_fault_unwire(). (pmap_pageable() is a no-op on all supported architectures.) o Remove the acquisition and release of Giant from mlock().
* o Remove GIANT_REQUIRED from useracc() and vsunlock(). Neitheralc2002-06-151-3/+4
| | | | | vm_map_check_protection() nor vm_map_unwire() expect Giant to be held.
* o Remove the acquisition and release of Giant from munlock().alc2002-06-151-2/+0
| | | | Reviewed by: tegge
* o Use vm_map_wire() and vm_map_unwire() in place of vm_map_pageable() andalc2002-06-146-414/+8
| | | | | | | | | vm_map_user_pageable(). o Remove vm_map_pageable() and vm_map_user_pageable(). o Remove vm_map_clear_recursive() and vm_map_set_recursive(). (They were only used by vm_map_pageable() and vm_map_user_pageable().) Reviewed by: tegge
* o Acquire and release Giant in vm_map_unlock_and_wait().alc2002-06-121-3/+5
| | | | Submitted by: tegge
* o Properly handle a failure by vm_fault_wire() or vm_fault_user_wire()alc2002-06-111-4/+20
| | | | | | | in vm_map_wire(). o Make two white-space changes in vm_map_wire(). Reviewed by: tegge
* o Teach vm_map_delete() to respect the "in-transition" flagalc2002-06-111-0/+31
| | | | | | on a vm_map_entry by sleeping until the flag is cleared. Submitted by: tegge
* o In vm_map_entry_create(), call uma_zalloc() with M_NOWAIT on system maps.alc2002-06-101-5/+6
| | | | | | | Submitted by: tegge o Eliminate the "!mapentzone" check from vm_map_entry_create() and vm_map_entry_dispose(). Reviewed by: tegge o Fix white-space usage in vm_map_entry_create().
* Correct the logic for determining whether the per-CPU locks neediedowse2002-06-101-1/+1
| | | | | | | to be destroyed. This fixes a problem where destroying a UMA zone would fail to destroy all zone mutexes. Reviewed by: jeff
* o Add vm_map_wire() for wiring contiguous regions of either kernelalc2002-06-091-1/+159
| | | | | | | | | | | or user vm_maps. This implementation has two key benefits when compared to vm_map_{user_,}pageable(): (1) it avoids a race condition through the use of "in-transition" vm_map entries and (2) it eliminates lock recursion on the vm_map. Note: there is still an error case that requires clean up. Reviewed by: tegge
* o Simplify vm_map_unwire() by merging the second and third passesalc2002-06-081-17/+11
| | | | over the caller-specified region.
* o Remove an unnecessary call to vm_map_wakeup() from vm_map_unwire().alc2002-06-082-6/+17
| | | | | | | | o Add a stub for vm_map_wire(). Note: the description of the previous commit had an error. The in- transition flag actually blocks the deallocation of a vm_map_entry by vm_map_delete() and vm_map_simplify_entry().
* o Add vm_map_unwire() for unwiring contiguous regions of either kernelalc2002-06-072-1/+167
| | | | | | | | | | | | | | | or user vm_maps. In accordance with the standards for munlock(2), and in contrast to vm_map_user_pageable(), this implementation does not allow holes in the specified region. This implementation uses the "in transition" flag described below. o Introduce a new flag, "in transition," to the vm_map_entry. Eventually, vm_map_delete() and vm_map_simplify_entry() will respect this flag by deallocating in-transition vm_map_entrys, allowing the vm_map lock to be safely released in vm_map_unwire() and (the forthcoming) vm_map_wire(). o Modify vm_map_simplify_entry() to respect the in-transition flag. In collaboration with: tegge
* fix typo in _SYS_SYSPROTO_H_ case: s/mlockall_args/munlockall_argsalfred2002-06-061-1/+1
| | | | Submitted by: Mark Santcroos <marks@ripe.net>
* Add a comment describing a resource leak that occurs during a failure casejeff2002-06-031-0/+3
| | | | in obj_alloc.
* o Migrate vm_map_split() from vm_map.c to vm_object.c, renaming italc2002-06-023-90/+93
| | | | | to vm_object_split(). Its interface should still be changed to resemble vm_object_shadow().
* o Style fixes to vm_map_split(), including the elimination of one variablealc2002-06-021-8/+1
| | | | | | | | declaration that shadows another. Note: This function should really be vm_object_split(), not vm_map_split(). Reviewed by: md5
* o Condition vm_object_pmap_copy_1()'s compilation on the kernelalc2002-06-021-0/+2
| | | | | option ENABLE_VFS_IOOPT. Unless this option is in effect, vm_object_pmap_copy_1() is not used.
* o Remove GIANT_REQUIRED from vm_map_zfini(), vm_map_zinit(),alc2002-06-012-25/+15
| | | | | | | | | vm_map_create(), and vm_map_submap(). o Make further use of a local variable in vm_map_entry_splay() that caches a reference to one of a vm_map_entry's children. (This reduces code size somewhat.) o Revert a part of revision 1.66, deinlining vmspace_pmap(). (This function is MPSAFE.)
* o Revert a part of revision 1.66, contrary to what that commit message says,alc2002-06-012-17/+21
| | | | | | | | deinlining vm_map_entry_behavior() and vm_map_entry_set_behavior() actually increases the kernel's size. o Make vm_map_entry_set_behavior() static and add a comment describing its purpose. o Remove an unnecessary initialization statement from vm_map_entry_splay().
OpenPOWER on IntegriCloud