summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_object.h
Commit message (Collapse)AuthorAgeFilesLines
* - Add VM_OBJECT_TRYLOCK().alc2003-06-041-0/+1
|
* - Add vm object locking to vm_object_deallocate(). (Still morealc2003-06-041-5/+0
| | | | | | changes are required.) - Remove special-case macros for kmem object locking. They are no longer used.
* Change kernel_object and kmem_object to (&kernel_object_store) andalc2003-06-011-2/+5
| | | | | (&kmem_object_store), respectively. This allows the address of these objects to be resolved at link-time rather than run-time.
* Reduce the size of a vm object by converting its shadow list from a TAILQalc2003-05-181-2/+2
| | | | | | to a LIST. Approved by: re (rwatson)
* - Define VM_OBJECT_LOCK_INIT().alc2003-04-281-0/+2
| | | | | - Avoid repeatedly mtx_init()ing and mtx_destroy()ing the vm_object's lock using UMA's uminit callback, in this case, vm_object_zinit().
* - Convert vm_object_pip_wait() from using tsleep() to msleep().alc2003-04-261-1/+1
| | | | | - Make vm_object_pip_sleep() static. - Lock the vm_object when performing vm_object_pip_wait().
* Add VM_OBJECT_LOCKED().alc2003-04-221-0/+1
|
* - Lock the vm_object when performing vm_object_pip_wakeupn().alc2003-04-191-0/+2
| | | | | - Assert that the vm_object lock is held in vm_object_pip_wakeupn(). - Add a new macro VM_OBJECT_LOCK_ASSERT().
* Add new macros for locking and unlocking a vm object.alc2003-04-131-0/+3
|
* Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.alc2003-03-061-4/+0
| | | | Discussed on: arch@
* Fuse two #ifdefs with identical conditions.alc2003-02-251-3/+0
|
* - Remove vm_object_init2(). It is unused.alc2002-12-291-1/+0
| | | | | | - Add a mtx_destroy() to vm_object_collapse(). (This allows a bzero() to migrate from _vm_object_allocate() to vm_object_zinit(), where it will be performed less often.)
* Add a mutex to struct vm_object. Initialize and destroy that mutexalc2002-12-201-2/+7
| | | | | at appropriate times. For the moment, the mutex is only used on the kmem_object.
* Remove the hash_rand field from struct vm_object. As of revision 1.215 ofalc2002-12-191-1/+0
| | | | vm/vm_page.c, it is unused.
* Remove dead code that hasn't been needed since the demise of share mapsalc2002-11-131-2/+0
| | | | in various revisions of vm/vm_map.c between 1.148 and 1.153.
* Replace the vm_page hash table with a per-vmobject splay tree. There shoulddillon2002-10-181-0/+1
| | | | | | | | | | | | | | | | be no major change in performance from this change at this time but this will allow other work to progress: Giant lock removal around VM system in favor of per-object mutexes, ranged fsyncs, more optimal COMMIT rpc's for NFS, partial filesystem syncs by the syncer, more optimal object flushing, etc. Note that the buffer cache is already using a similar splay tree mechanism. Note that a good chunk of the old hash table code is still in the tree. Alan or I will remove it prior to the release if the new code does not introduce unsolvable bugs, else we can revert more easily. Submitted by: alc (this is Alan's code) Approved by: re
* Reduce namespace pollution.alc2002-09-211-3/+0
| | | | Submitted by: bde
* o Resurrect vm_object_lock() and vm_object_unlock() from revision 1.19.alc2002-08-241-0/+6
| | | | (For now, they simply acquire and release Giant.)
* At long last, commit the zero copy sockets code.ken2002-06-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Complete the initial set of VM changes required to support fulliedowse2002-06-251-3/+3
| | | | | | | | | | | 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().
* o Migrate vm_map_split() from vm_map.c to vm_object.c, renaming italc2002-06-021-0/+1
| | | | | to vm_object_split(). Its interface should still be changed to resemble vm_object_shadow().
* o Move vm_freeze_copyopts() from vm_map.{c.h} to vm_object.{c,h}. It's plainlyalc2002-05-061-0/+1
| | | | an operation on a vm_object and belongs in the latter place.
* o Make _vm_object_allocate() and vm_object_allocate() callablealc2002-05-041-2/+5
| | | | | | without holding Giant. o Begin documenting the trivial cases of the locking protocol on vm_object.
* Reintroduce locking on accesses to vm_object_list.alc2002-04-201-0/+1
|
* Implement kern.maxvnodes. adjusting kern.maxvnodes now actually has adillon2001-10-261-0/+1
| | | | | | | | | | | | | | | | real effect. Optimize vfs_msync(). Avoid having to continually drop and re-obtain mutexes when scanning the vnode list. Improves looping case by 500%. Optimize ffs_sync(). Avoid having to continually drop and re-obtain mutexes when scanning the vnode list. This makes a couple of assumptions, which I believe are ok, in regards to vnode stability when the mount list mutex is held. Improves looping case by 500%. (more optimization work is needed on top of these fixes) MFC after: 1 week
* Oops. Last commit to vm_object.c should have got these files too.jake2001-07-311-1/+0
| | | | | | | 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
* Change inlines back into mainline code in preparation for mutexing. Also,dillon2001-07-041-95/+26
| | | | | | | | 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)
* With Alfred's permission, remove vm_mtx in favor of a fine-grained approachdillon2001-07-041-28/+20
| | | | | | | | | (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.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-191-7/+28
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* use TAILQ_FOREACH, fix a comment's locationalfred2001-04-151-2/+0
|
* Make the arguments match the functionality of the functions.obrien2000-08-261-5/+5
|
* Minor cleanups:peter2000-07-281-11/+0
| | | | | | - remove unused variables (fix warnings) - use a more consistant ansi style rather than a mixture - remove dead #if 0 code and declarations
* This is a cleanup patch to Peter's new OBJT_PHYS VM object typedillon2000-05-291-0/+2
| | | | | | | | | | | | | | | | | and sysv shared memory support for it. It implements a new PG_UNMANAGED flag that has slightly different characteristics from PG_FICTICIOUS. A new sysctl, kern.ipc.shm_use_phys has been added to enable the use of physically-backed sysv shared memory rather then swap-backed. Physically backed shm segments are not tracked with PV entries, allowing programs which use a large shm segment as a rendezvous point to operate without eating an insane amount of KVM in the PV entry management. Read: Oracle. Peter's OBJT_PHYS object will also allow us to eventually implement page-table sharing and/or 4MB physical page support for such segments. We're half way there.
* Back out the previous change to the queue(3) interface.jake2000-05-261-8/+8
| | | | | | It was not discussed and should probably not happen. Requested by: msmith and others
* Change the way that the queue(3) structures are declared; don't assume thatjake2000-05-231-8/+8
| | | | | | | | the type argument to *_HEAD and *_ENTRY is a struct. Suggested by: phk Reviewed by: phk Approved by: mdodd
* Checkpoint of a new physical memory backed object type, that does notpeter2000-05-211-1/+11
| | | | | | | | | | | | | have pv_entries. This is intended for very special circumstances, eg: a certain database that has a 1GB shm segment mapped into 300 processes. That would consume 2GB of kvm just to hold the pv_entries alone. This would not be used on systems unless the physical ram was available, as it's not pageable. This is a work-in-progress, but is a useful and functional checkpoint. Matt has got some more fixes for it that will be committed soon. Reviewed by: dillon
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-4/+4
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC todillon1999-12-121-2/+3
| | | | | | | | | | | | | | | | | madvise(). This feature prevents the update daemon from gratuitously flushing dirty pages associated with a mapped file-backed region of memory. The system pager will still page the memory as necessary and the VM system will still be fully coherent with the filesystem. Modifications made by other means to the same area of memory, for example by write(), are unaffected. The feature works on a page-granularity basis. MAP_NOSYNC allows one to use mmap() to share memory between processes without incuring any significant filesystem overhead, putting it in the same performance category as SysV Shared memory and anonymous memory. Reviewed by: julian, alc, dg
* Shrink "struct vm_object" by not spending a full 32 bitsalc1999-10-271-2/+2
| | | | on "objtype_t".
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Move the memory access behavior information provided by madvisealc1999-08-011-6/+1
| | | | | | from the vm_object to the vm_map. Submitted by: dillon
* Remove vm_object::last_read. It is used by the old swap pager, butalc1999-07-161-2/+1
| | | | | | not by the new one, i.e., vm/swap_pager.c rev 1.108. Reviewed by: dillon@backplane.com
* Change the data type used to represent page color in the vm_objectalc1999-07-101-2/+2
| | | | | to be the same as that used in the vm_page. (This change also shrinks the vm_object.)
* Remove vm_object::cache_count and vm_object::wired_count. They arealc1999-06-201-3/+1
| | | | | | not used. (Nor is there any planned use by John who introduced them.) Reviewed by: "John S. Dyson" <toor@dyson.iquest.net>
* Remove some unused function and variable declarations.alc1999-06-191-4/+1
|
* Revamp vm_object_[q]collapse(). Despite the complexity of this patch,dillon1999-02-081-2/+1
| | | | | | no major operational changes were made. The three core object->memq loops were moved into a single inline procedure and various operational characteristics of the collapse function were documented.
* The vm_object structure is now somewhat smaller due to the removaldillon1999-01-211-1/+1
| | | | | | | | | of most of the swap-pager-specific fields, the removal of the id, and the removal of paging_offset. A new inline, vm_object_pip_wakeupn() has been added to subtract an arbitrary number n from the paging_in_progress count and then wakeup waiters as necessary. n may be 0, resulting in a 'flash'.
* This is a rather large commit that encompasses the new swapper,dillon1999-01-211-16/+43
| | | | | | | | | | changes to the VM system to support the new swapper, VM bug fixes, several VM optimizations, and some additional revamping of the VM code. The specific bug fixes will be documented with additional forced commits. This commit is somewhat rough in regards to code cleanup issues. Reviewed by: "John S. Dyson" <root@dyson.iquest.net>, "David Greenman" <dg@root.com>
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-241-9/+24
| | | | | | | | | | Add some overflow checks to read/write (from bde). Change all modifications to vm_page::flags, vm_page::busy, vm_object::flags and vm_object::paging_in_progress to use operations which are not interruptable. Reviewed by: Bruce Evans <bde@zeta.org.au>
* Protect all modifications to paging_in_progress with splvm(). The i386dfr1998-08-061-1/+12
| | | | | | | | | managed to avoid corruption of this variable by luck (the compiler used a memory read-modify-write instruction which wasn't interruptable) but other architectures cannot. With this change, I am now able to 'make buildworld' on the alpha (sfx: the crowd goes wild...)
OpenPOWER on IntegriCloud