aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/mman.h
Commit message (Collapse)AuthorAgeFilesLines
* Add a new file operations hook for mmap operations. File type-specificJohn Baldwin2015-06-041-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | logic is now placed in the mmap hook implementation rather than requiring it to be placed in sys/vm/vm_mmap.c. This hook allows new file types to support mmap() as well as potentially allowing mmap() for existing file types that do not currently support any mapping. The vm_mmap() function is now split up into two functions. A new vm_mmap_object() function handles the "back half" of vm_mmap() and accepts a referenced VM object to map rather than a (handle, handle_type) tuple. vm_mmap() is now reduced to converting a (handle, handle_type) tuple to a a VM object and then calling vm_mmap_object() to handle the actual mapping. The vm_mmap() function remains for use by other parts of the kernel (e.g. device drivers and exec) but now only supports mapping vnodes, character devices, and anonymous memory. The mmap() system call invokes vm_mmap_object() directly with a NULL object for anonymous mappings. For mappings using a file descriptor, the descriptors fo_mmap() hook is invoked instead. The fo_mmap() hook is responsible for performing type-specific checks and adjustments to arguments as well as possibly modifying mapping parameters such as flags or the object offset. The fo_mmap() hook routines then call vm_mmap_object() to handle the actual mapping. The fo_mmap() hook is optional. If it is not set, then fo_mmap() will fail with ENODEV. A fo_mmap() hook is implemented for regular files, character devices, and shared memory objects (created via shm_open()). While here, consistently use the VM_PROT_* constants for the vm_prot_t type for the 'prot' variable passed to vm_mmap() and vm_mmap_object() as well as the vm_mmap_vnode() and vm_mmap_cdev() helper routines. Previously some places were using the mmap()-specific PROT_* constants instead. While this happens to work because PROT_xx == VM_PROT_xx, using VM_PROT_* is more correct. Differential Revision: https://reviews.freebsd.org/D2658 Reviewed by: alc (glanced over), kib MFC after: 1 month Sponsored by: Chelsio Notes: svn path=/head/; revision=283998
* Retire the unimplemented MAP_RENAME and MAP_NORESERVE flags to mmap(2).John Baldwin2014-10-181-2/+2
| | | | | | | | | | | Older binaries are still permitted to use these flags. PR: 193961 (exp-run in ports) Differential Revision: https://reviews.freebsd.org/D848 Reviewed by: kib Notes: svn path=/head/; revision=273250
* Add a new fo_fill_kinfo fileops method to add type-specific information toJohn Baldwin2014-09-221-1/+0
| | | | | | | | | | | | | | | | | struct kinfo_file. - Move the various fill_*_info() methods out of kern_descrip.c and into the various file type implementations. - Rework the support for kinfo_ofile to generate a suitable kinfo_file object for each file and then convert that to a kinfo_ofile structure rather than keeping a second, different set of code that directly manipulates type-specific file information. - Remove the shm_path() and ksem_info() layering violations. Differential Revision: https://reviews.freebsd.org/D775 Reviewed by: kib, glebius (earlier version) Notes: svn path=/head/; revision=271976
* Add the new shm_ino field to struct shmfd. Missed in 270823.John Baldwin2014-08-291-0/+1
| | | | | | | | Reported by: peter Pointy hat to: jhb Notes: svn path=/head/; revision=270825
* Add MAP_EXCL flag for mmap(2). It should be combined with MAP_FIXED,Konstantin Belousov2014-06-191-0/+1
| | | | | | | | | | | | | | and prevents the request from deleting existing mappings in the region, failing instead. Reviewed by: alc Discussed with: jhb Tested by: markj, pho (previous version, as part of the bigger patch) Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=267630
* Add a mmap flag (MAP_32BIT) on 64-bit platforms to request that a mapping useJohn Baldwin2013-09-091-0/+3
| | | | | | | | | | | | | | | | an address in the first 2GB of the process's address space. This flag should have the same semantics as the same flag on Linux. To facilitate this, add a new parameter to vm_map_find() that specifies an optional maximum virtual address. While here, fix several callers of vm_map_find() to use a VMFS_* constant for the findspace argument instead of TRUE and FALSE. Reviewed by: alc Approved by: re (kib) Notes: svn path=/head/; revision=255426
* Implement read(2)/write(2) and neccessary lseek(2) for posix shmfd.Konstantin Belousov2013-08-211-0/+7
| | | | | | | | | | | | | | | | Add MAC framework entries for posix shm read and write. Do not allow implicit extension of the underlying memory segment past the limit set by ftruncate(2) by either of the syscalls. Read and write returns short i/o, lseek(2) fails with EINVAL when resulting offset does not fit into the limit. Discussed with: alc Tested by: pho Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=254603
* Add new mmap(2) flags to permit applications to request specific virtualJohn Baldwin2013-08-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | address alignment of mappings. - MAP_ALIGNED(n) requests a mapping aligned on a boundary of (1 << n). Requests for n >= number of bits in a pointer or less than the size of a page fail with EINVAL. This matches the API provided by NetBSD. - MAP_ALIGNED_SUPER is a special case of MAP_ALIGNED. It can be used to optimize the chances of using large pages. By default it will align the mapping on a large page boundary (the system is free to choose any large page size to align to that seems best for the mapping request). However, if the object being mapped is already using large pages, then it will align the virtual mapping to match the existing large pages in the object instead. - Internally, VMFS_ALIGNED_SPACE is now renamed to VMFS_SUPER_SPACE, and VMFS_ALIGNED_SPACE(n) is repurposed for specifying a specific alignment. MAP_ALIGNED(n) maps to using VMFS_ALIGNED_SPACE(n), while MAP_ALIGNED_SUPER maps to VMFS_SUPER_SPACE. - mmap() of a device object now uses VMFS_OPTIMAL_SPACE rather than explicitly using VMFS_SUPER_SPACE. All device objects are forced to use a specific color on creation, so VMFS_OPTIMAL_SPACE is effectively equivalent. Reviewed by: alc MFC after: 1 month Notes: svn path=/head/; revision=254430
* Export some more useful info about shared memory objects to userlandJohn Baldwin2012-04-011-1/+5
| | | | | | | | | | | | | | | | | | | | | | via procstat(1) and fstat(1): - Change shm file descriptors to track the pathname they are associated with and add a shm_path() method to copy the path out to a caller-supplied buffer. - Use the fo_stat() method of shared memory objects and shm_path() to export the path, mode, and size of a shared memory object via struct kinfo_file. - Add a struct shmstat to the libprocstat(3) interface along with a procstat_get_shm_info() to export the mode and size of a shared memory object. - Change procstat to always print out the path for a given object if it is valid. - Teach fstat about shared memory objects and to display their path, mode, and size. MFC after: 2 weeks Notes: svn path=/head/; revision=233760
* Add a helper API to allow in-kernel code to map portions of shared memoryJohn Baldwin2011-12-141-0/+5
| | | | | | | | | objects created by shm_open(2) into the kernel's address space. This provides a convenient way for creating shared memory buffers between userland and the kernel without requiring custom character devices. Notes: svn path=/head/; revision=228509
* Add the MAP_PREFAULT_READ option to mmap(2).Alan Cox2010-08-281-0/+1
| | | | | | | Reviewed by: jhb, kib Notes: svn path=/head/; revision=211937
* Add MAP_ANONYMOUS.Ed Schouten2009-11-061-0/+3
| | | | | | | | | | | Many operating systems also provide MAP_ANONYMOUS. It's not hard to support this ourselves, we'd better add it to make it more likely for applications to work out of the box. Reviewed by: alc (mman.h) Notes: svn path=/head/; revision=198973
* Add getpagesizes(3). This functions either the number of supported pageAlan Cox2009-09-191-0/+1
| | | | | | | | | | sizes or some number of the sizes themselves. It is functionally compatible with a function by the same name under Solaris. Reviewed by: jhb Notes: svn path=/head/; revision=197331
* Add support to mincore for detecting whether a page is part of aPaul Saab2008-03-281-0/+1
| | | | | | | | | "super" page or not. Reviewed by: alc, ups Notes: svn path=/head/; revision=177680
* Add a new file descriptor type for IPC shared memory objects and use it toJohn Baldwin2008-01-081-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | implement shm_open(2) and shm_unlink(2) in the kernel: - Each shared memory file descriptor is associated with a swap-backed vm object which provides the backing store. Each descriptor starts off with a size of zero, but the size can be altered via ftruncate(2). The shared memory file descriptors also support fstat(2). read(2), write(2), ioctl(2), select(2), poll(2), and kevent(2) are not supported on shared memory file descriptors. - shm_open(2) and shm_unlink(2) are now implemented as system calls that manage shared memory file descriptors. The virtual namespace that maps pathnames to shared memory file descriptors is implemented as a hash table where the hash key is generated via the 32-bit Fowler/Noll/Vo hash of the pathname. - As an extension, the constant 'SHM_ANON' may be specified in place of the path argument to shm_open(2). In this case, an unnamed shared memory file descriptor will be created similar to the IPC_PRIVATE key for shmget(2). Note that the shared memory object can still be shared among processes by sharing the file descriptor via fork(2) or sendmsg(2), but it is unnamed. This effectively serves to implement the getmemfd() idea bandied about the lists several times over the years. - The backing store for shared memory file descriptors are garbage collected when they are not referenced by any open file descriptors or the shm_open(2) virtual namespace. Submitted by: dillon, peter (previous versions) Submitted by: rwatson (I based this on his version) Reviewed by: alc (suggested converting getmemfd() to shm_open()) Notes: svn path=/head/; revision=175164
* Namespace issues.David Schultz2005-04-021-12/+21
| | | | Notes: svn path=/head/; revision=144531
* Remove mlockall() and munlockall() from the list of unimplementedMaxime Henrion2004-04-271-2/+2
| | | | | | | | | syscalls in a comment, we have them since quite some time now. Noticed by: Stefan Farfeleder <stefan@fafoe.narf.at> Notes: svn path=/head/; revision=128680
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-071-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127976
* Add the mlockall() and munlockall() system calls.Bruce M Simpson2003-08-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | - All those diffs to syscalls.master for each architecture *are* necessary. This needed clarification; the stub code generation for mlockall() was disabled, which would prevent applications from linking to this API (suggested by mux) - Giant has been quoshed. It is no longer held by the code, as the required locking has been pushed down within vm_map.c. - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES to express their intention explicitly. - Inspected at the vmstat, top and vm pager sysctl stats level. Paging-in activity is occurring correctly, using a test harness. - The RES size for a process may appear to be greater than its SIZE. This is believed to be due to mappings of the same shared library page being wired twice. Further exploration is needed. - Believed to back out of allocations and locks correctly (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC). PR: kern/43426, standards/54223 Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks Notes: svn path=/head/; revision=118771
* Add the POSIX 1003.1-2001 posix_madvise() interface.Bruce M Simpson2003-08-091-2/+12
| | | | | | | | | PR: standards/54634 Reviewed by: das Approved by: jake (mentor) Notes: svn path=/head/; revision=118684
* Add a facility allowing processes to inform the VM subsystem they areWes Peters2003-03-311-0/+1
| | | | | | | | | | | critical and should not be killed when pageout is looking for more memory pages in all the wrong places. Reviewed by: arch@ Sponsored by: St. Bernard Software Notes: svn path=/head/; revision=112881
* mlockall() and munlockall() are unimplemented; remove their prototypes.Mike Barcroft2002-09-131-8/+2
| | | | Notes: svn path=/head/; revision=103304
* o Fix namespace issues in <sys/mman.h>.Mike Barcroft2002-08-231-24/+55
| | | | | | | | | | | o Move mode_t details from <sys/types.h> into <sys/_types.h>. o Add primitives for sharing the mode_t and off_t typedefs. o Add typedefs mode_t, off_t, and size_t to <sys/mman.h>. PR: 21644 Notes: svn path=/head/; revision=102325
* Remove __PAlfred Perlstein2002-03-191-13/+13
| | | | Notes: svn path=/head/; revision=92719
* Add INHERIT_XXX defines for minherit() system call.Matthew Dillon2001-08-241-1/+8
| | | | | | | Remove MAP_INHERIT - it is no longer supported. Notes: svn path=/head/; revision=82295
* Remove MAP_NOEXTEND. It came from 4.4-lite and not only was neverMatthew Dillon2001-08-241-1/+1
| | | | | | | | implemented, but mmap()'s default behavior is *already* to not extend files. Only write() or ftruncate() can extend a file. Notes: svn path=/head/; revision=82285
* Add MAP_NOCORE to mmap(2), and MADV_NOCORE and MADV_CORE to madvise(2).Paul Saab2000-02-281-1/+8
| | | | | | | | | | | | | | | This This feature allows you to specify if mmap'd data is included in an application's corefile. Change the type of eflags in struct vm_map_entry from u_char to vm_eflags_t (an unsigned int). Reviewed by: dillon,jdp,alfred Approved by: jkh Notes: svn path=/head/; revision=57550
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"Peter Wemm1999-12-291-2/+2
| | | | | | | | | 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. Notes: svn path=/head/; revision=55205
* Add MAP_NOSYNC feature to mmap(), and MADV_NOSYNC and MADV_AUTOSYNC toMatthew Dillon1999-12-121-0/+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 Notes: svn path=/head/; revision=54467
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Mostly remove the VM_STACK OPTION.Julian Elischer1999-01-261-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the definitions of a few items so that structures are the same whether or not the option itself is enabled. This allows people to enable and disable the option without recompilng the world. As the author says: |I ran into a problem pulling out the VM_STACK option. I was aware of this |when I first did the work, but then forgot about it. The VM_STACK stuff |has some code changes in the i386 branch. There need to be corresponding |changes in the alpha branch before it can come out completely. what is done: | |1) Pull the VM_STACK option out of the header files it appears in. This |really shouldn't affect anything that executes with or without the rest |of the VM_STACK patches. The vm_map_entry will then always have one |extra element (avail_ssize). It just won't be used if the VM_STACK |option is not turned on. | |I've also pulled the option out of vm_map.c. This shouldn't harm anything, |since the routines that are enabled as a result are not called unless |the VM_STACK option is enabled elsewhere. | |2) Add what appears to be appropriate code the the alpha branch, still |protected behind the VM_STACK switch. I don't have an alpha machine, |so we would need to get some testers with alpha machines to try it out. | |Once there is some testing, we can consider making the change permanent |for both i386 and alpha. | [..] | |Once the alpha code is adequately tested, we can pull VM_STACK out |everywhere. | Submitted by: "Richard Seaman, Jr." <dick@tar.com> Notes: svn path=/head/; revision=43209
* Add (but don't activate) code for a special VM option to makeJulian Elischer1999-01-061-1/+4
| | | | | | | | | | | | | | | | downward growing stacks more general. Add (but don't activate) code to use the new stack facility when running threads, (specifically the linux threads support). This allows people to use both linux compiled linuxthreads, and also the native FreeBSD linux-threads port. The code is conditional on VM_STACK. Not using this will produce the old heavily tested system. Submitted by: Richard Seaman <dick@tar.com> Notes: svn path=/head/; revision=42360
* Finish _POSIX_PRIORITY_SCHEDULING. Needs P1003_1B andPeter Dufault1998-03-281-5/+5
| | | | | | | | | | | | | | | | | | | _KPOSIX_PRIORITY_SCHEDULING options to work. Changes: Change all "posix4" to "p1003_1b". Misnamed files are left as "posix4" until I'm told if I can simply delete them and add new ones; Add _POSIX_PRIORITY_SCHEDULING system calls for FreeBSD and Linux; Add man pages for _POSIX_PRIORITY_SCHEDULING system calls; Add options to LINT; Minor fixes to P1003_1B code during testing. Notes: svn path=/head/; revision=34925
* Reviewed by: bdePeter Dufault1998-03-081-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes to support building with _POSIX_SOURCE set to 199309L: 1. Add sys/_posix.h to handle those preprocessor defs that POSIX says have effects when defined before including any header files; 2. Change POSIX4_VISIBLE back to _POSIX4_VISIBLE 3. Add _POSIX4_VISIBLE_HISTORICALLY for pre-existing BSD features now defined in POSIX. These show up when: _POSIX_SOURCE and _POSIX_C_SOURCE are not set or _POSIX_C_SOURCE is set >= 199309L and vanish when: _POSIX_SOURCE is set or _POSIX_C_SOURCE is < 199309L. 4. Explain these in man 9 posix4; 5. Include _posix.h and conditionalize on new feature test. Notes: svn path=/head/; revision=34319
* Reviewed by: msmith, bde long agoPeter Dufault1998-03-041-4/+22
| | | | | | | | POSIX.4 headers and sysctl variables. Nothing should change unless POSIX4 is defined or _POSIX_VERSION is set to 199309. Notes: svn path=/head/; revision=34030
* Convert caddr_t --> void * for sys/mman.h functions.Alexander Langer1997-12-311-11/+11
| | | | | | | | | | | | | | | | | | | mlock, mmap, mprotect, msync, munlock, and munmap are defined by POSIX as taking void *. The const modifier has been added to mlock, munlock, and mprotect as the standard dictates. minherit comes from OpenBSD and has been updated to conform with their recent change to void *. madvise and mincore are not defined by POSIX, but their arguments have been modified to be consistent with the POSIX-defined functions. mincore takes a const pointer, but madvise does not due to the MADV_FREE case. Discussed with: bde Notes: svn path=/head/; revision=32131
* Define MS_SYNC for compatibility.John Dyson1997-12-021-1/+2
| | | | Notes: svn path=/head/; revision=31497
* #ifdef'ed the declaration of lseek() so that -Wredundant-decls doesn'tBruce Evans1997-04-131-1/+4
| | | | | | | | | | | cause noise. Duplicated the lseek() redeclaration hack for all functions involving off_t's (ftruncate(), mmap() and truncate()) to help broken programs work. Notes: svn path=/head/; revision=24896
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notPeter Wemm1997-02-221-1/+1
| | | | | | | ready for it yet. Notes: svn path=/head/; revision=22975
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* POSIX.4 defines MAP_FAILED to be the error return from mmap().Alexander Langer1996-12-121-1/+6
| | | | Notes: svn path=/head/; revision=20346
* Initial support for MADV_FREE, support for pages that we don't careJohn Dyson1996-05-231-1/+2
| | | | | | | | | about the contents anymore. This gives us alot of the advantage of freeing individual pages through munmap, but with almost none of the overhead. Notes: svn path=/head/; revision=15873
* Initial support for mincore and madvise. Both are almost fullyJohn Dyson1996-05-191-1/+10
| | | | | | | | supported, except madvise does not page in with MADV_WILLNEED, and MADV_DONTNEED doesn't force dirty pages out. Notes: svn path=/head/; revision=15819
* Merge in Lite2: sync up comments.Jeffrey Hsu1996-03-111-6/+6
| | | | | | | Reviewed by: davidg & bde Notes: svn path=/head/; revision=14482
* Remove redundant comment about the 'int len' variables that should bePeter Wemm1996-03-021-2/+1
| | | | | | | changed to size_t's. Notes: svn path=/head/; revision=14327
* Change madvise prototype from 'int len' to 'size_t len'. All the otherPeter Wemm1996-03-021-2/+4
| | | | | | | | m* syscalls were prototyped as size_t already. Add missing mincore() and minherit() prototypes, as suggested by bde. Notes: svn path=/head/; revision=14323
* Add definition of PROT_NONE=0 for compatibility with SunOS/Solaris/Linux ...Stefan Eßer1995-11-301-1/+2
| | | | | | | Reviewed by: julian Notes: svn path=/head/; revision=12548
* NOTE: libkvm, w, ps, 'top', and any other utility which depends on structDavid Greenman1995-07-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | proc or any VM system structure will have to be rebuilt!!! Much needed overhaul of the VM system. Included in this first round of changes: 1) Improved pager interfaces: init, alloc, dealloc, getpages, putpages, haspage, and sync operations are supported. The haspage interface now provides information about clusterability. All pager routines now take struct vm_object's instead of "pagers". 2) Improved data structures. In the previous paradigm, there is constant confusion caused by pagers being both a data structure ("allocate a pager") and a collection of routines. The idea of a pager structure has escentially been eliminated. Objects now have types, and this type is used to index the appropriate pager. In most cases, items in the pager structure were duplicated in the object data structure and thus were unnecessary. In the few cases that remained, a un_pager structure union was created in the object to contain these items. 3) Because of the cleanup of #1 & #2, a lot of unnecessary layering can now be removed. For instance, vm_object_enter(), vm_object_lookup(), vm_object_remove(), and the associated object hash list were some of the things that were removed. 4) simple_lock's removed. Discussion with several people reveals that the SMP locking primitives used in the VM system aren't likely the mechanism that we'll be adopting. Even if it were, the locking that was in the code was very inadequate and would have to be mostly re-done anyway. The locking in a uni-processor kernel was a no-op but went a long way toward making the code difficult to read and debug. 5) Places that attempted to kludge-up the fact that we don't have kernel thread support have been fixed to reflect the reality that we are really dealing with processes, not threads. The VM system didn't have complete thread support, so the comments and mis-named routines were just wrong. We now use tsleep and wakeup directly in the lock routines, for instance. 6) Where appropriate, the pagers have been improved, especially in the pager_alloc routines. Most of the pager_allocs have been rewritten and are now faster and easier to maintain. 7) The pagedaemon pageout clustering algorithm has been rewritten and now tries harder to output an even number of pages before and after the requested page. This is sort of the reverse of the ideal pagein algorithm and should provide better overall performance. 8) Unnecessary (incorrect) casts to caddr_t in calls to tsleep & wakeup have been removed. Some other unnecessary casts have also been removed. 9) Some almost useless debugging code removed. 10) Terminology of shadow objects vs. backing objects straightened out. The fact that the vm_object data structure escentially had this backwards really confused things. The use of "shadow" and "backing object" throughout the code is now internally consistent and correct in the Mach terminology. 11) Several minor bug fixes, including one in the vm daemon that caused 0 RSS objects to not get purged as intended. 12) A "default pager" has now been created which cleans up the transition of objects to the "swap" type. The previous checks throughout the code for swp->pg_data != NULL were really ugly. This change also provides the rudiments for future backing of "anonymous" memory by something other than the swap pager (via the vnode pager, for example), and it allows the decision about which of these pagers to use to be made dynamically (although will need some additional decision code to do this, of course). 13) (dyson) MAP_COPY has been deprecated and the corresponding "copy object" code has been removed. MAP_COPY was undocumented and non- standard. It was furthermore broken in several ways which caused its behavior to degrade to MAP_PRIVATE. Binaries that use MAP_COPY will continue to work correctly, but via the slightly different semantics of MAP_PRIVATE. 14) (dyson) Sharing maps have been removed. It's marginal usefulness in a threads design can be worked around in other ways. Both #12 and #13 were done to simplify the code and improve readability and maintain- ability. (As were most all of these changes) TODO: 1) Rewrite most of the vnode pager to use VOP_GETPAGES/PUTPAGES. Doing this will reduce the vnode pager to a mere fraction of its current size. 2) Rewrite vm_fault and the swap/vnode pagers to use the clustering information provided by the new haspage pager interface. This will substantially reduce the overhead by eliminating a large number of VOP_BMAP() calls. The VOP_BMAP() filesystem interface should be improved to provide both a "behind" and "ahead" indication of contiguousness. 3) Implement the extended features of pager_haspage in swap_pager_haspage(). It currently just says 0 pages ahead/behind. 4) Re-implement the swap device (swstrategy) in a more elegant way, perhaps via a much more general mechanism that could also be used for disk striping of regular filesystems. 5) Do something to improve the architecture of vm_object_collapse(). The fact that it makes calls into the swap pager and knows too much about how the swap pager operates really bothers me. It also doesn't allow for collapsing of non-swap pager objects ("unnamed" objects backed by other pagers). Notes: svn path=/head/; revision=9507
* Prototype for madvise() is missing from sys/mman.hNate Williams1995-05-141-1/+2
| | | | | | | Submitted by: Kai Vorma <vode@snakemail.hut.fi> Notes: svn path=/head/; revision=8519
* Fixed msync() prototype.David Greenman1995-03-251-2/+2
| | | | Notes: svn path=/head/; revision=7363