summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* vm_map_growstack uses vmspace::vm_ssize as though it containedalc1999-06-171-6/+6
| | | | the stack size in bytes when in fact it is the stack size in pages.
* vm_map_insert sometimes extends an existing vm_map entry, rather thanalc1999-06-171-3/+7
| | | | | | | creating a new entry. vm_map_stack and vm_map_growstack can panic when a new entry isn't created. Fixed vm_map_stack and vm_map_growstack. Also, when extending the stack, always set the protection to VM_PROT_ALL.
* Move vm_map_stack and vm_map_growstack after the definitionalc1999-06-171-204/+204
| | | | | of the vm_map_clip_end macro. (The next commit will modify vm_map_stack and vm_map_growstack to use vm_map_clip_end.)
* Remove some unused declarations and duplicate initialization.alc1999-06-171-6/+2
|
* vm_map_protect:alc1999-06-121-2/+2
| | | | | The wrong vm_map_entry is used to determine if writes must not be allowed due to COW.
* Add a function kmem_alloc_nofault() - same as kmem_alloc_pageable(), butdt1999-06-082-2/+27
| | | | | | create a nofault entry. It will be used to allocate kmem for upages. (I am not too happy with all this, but it's better than nothing).
* vm_mmap:alc1999-06-051-3/+4
| | | | | | | Insure that device mappings get MAP_PREFAULT(_PARTIAL) set, so that 4M page mappings are used when possible. Reviewed by: Luoqi Chen <luoqi@watermarkgroup.com>
* Shorten a detour around dev_t to get a udev_t created.phk1999-06-011-3/+2
|
* Simplify cdevsw registration.phk1999-05-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing. cdevsw_add() will print an message if the d_maj field looks bogus. Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL. Move bdevsw() and devsw() functions to kern/kern_conf.c Bump __FreeBSD_version to 400006 This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions if_xe.c bogusly accessed cdevsw[], author/maintainer please fix. I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
* This commit should be a extensive NO-OP:phk1999-05-301-7/+22
| | | | | | | | | | | | | Reformat and initialize correctly all "struct cdevsw". Initialize the d_maj and d_bmaj fields. The d_reset field was not removed, although it is never used. I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way. Vinum and i4b not modified, patches emailed to respective authors.
* Addendum to 1.155. Verify the existence of the object before checkingalc1999-05-301-2/+3
| | | | its reference count.
* Avoid the creation of unnecessary shadow objects.alc1999-05-282-4/+20
|
* vm_map_insert:alc1999-05-181-47/+38
| | | | | General cleanup. Eliminate coalescing checks that are duplicated by vm_object_coalesce.
* Add the options MAP_PREFAULT and MAP_PREFAULT_PARTIAL to vm_map_find/insert,alc1999-05-173-12/+11
| | | | | | | eliminating the need for the pmap_object_init_pt calls in imgact_* and mmap. Reviewed by: David Greenman <dg@root.com>
* Remove prototypes for functions that don't exist anymore (vm_map.h).alc1999-05-164-28/+22
| | | | | | | | | | | | | | | | Remove a useless argument from vm_map_madvise's interface (vm_map.c, vm_map.h, and vm_mmap.c). Remove a redundant test in vm_uiomove (vm_map.c). Make two changes to vm_object_coalesce: 1. Determine whether the new range of pages actually overlaps the existing object's range of pages before calling vm_object_page_remove. (Prior to this change almost 90% of the calls to vm_object_page_remove were to remove pages that were beyond the end of the object.) 2. Free any swap space allocated to removed pages.
* Fix confusion of size of transfer with size of the pager.dt1999-05-151-3/+4
| | | | | PR: 11658 Broken in: 1.89 (1998/03/07)
* Simplify vm_map_find/insert's interface: remove the MAP_COPY_NEEDED option.alc1999-05-143-11/+9
| | | | | | | It never makes sense to specify MAP_COPY_NEEDED without also specifying MAP_COPY_ON_WRITE, and vice versa. Thus, MAP_COPY_ON_WRITE suffices. Reviewed by: David Greenman <dg@root.com>
* Casting handles from void * to uintptr_t on the way to dev_t becamebde1999-05-131-3/+3
| | | | especially bogus when dev_t became a pointer.
* Device pager's handle is dev_t not udev_t.luoqi1999-05-131-3/+3
|
* Fix a udev_t/dev_t mismatch which prevent paging from working.phk1999-05-121-2/+2
|
* Divorce "dev_t" from the "major|minor" bitmap, which is now calledphk1999-05-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | udev_t in the kernel but still called dev_t in userland. Provide functions to manipulate both types: major() umajor() minor() uminor() makedev() umakedev() dev2udev() udev2dev() For now they're functions, they will become in-line functions after one of the next two steps in this process. Return major/minor/makedev to macro-hood for userland. Register a name in cdevsw[] for the "filedescriptor" driver. In the kernel the udev_t appears in places where we have the major/minor number combination, (ie: a potential device: we may not have the driver nor the device), like in inodes, vattr, cdevsw registration and so on, whereas the dev_t appears where we carry around a reference to a actual device. In the future the cdevsw and the aliased-from vnode will be hung directly from the dev_t, along with up to two softc pointers for the device driver and a few houskeeping bits. This will essentially replace the current "alias" check code (same buck, bigger bang). A little stunt has been provided to try to catch places where the wrong type is being used (dev_t vs udev_t), if you see something not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if it makes a difference. If it does, please try to track it down (many hands make light work) or at least try to reproduce it as simply as possible, and describe how to do that. Without DEVT_FASCIST I belive this patch is a no-op. Stylistic/posixoid comments about the userland view of the <sys/*.h> files welcome now, from userland they now contain the end result. Next planned step: make all dev_t's refer to the same devsw[] which means convert BLK's to CHR's at the perimeter of the vnodes and other places where they enter the game (bootdev, mknod, sysctl).
* No point in swapdev being a static global when used only locally.phk1999-05-091-2/+2
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-082-7/+7
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-071-4/+4
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Introduce two functions: physread() and physwrite() and use these directlyphk1999-05-071-16/+2
| | | | | | in *devsw[] rather than the 46 local copies of the same functions. (grog will do the same for vinum when he has time)
* Add brackets to silence egcs and help clarity.peter1999-05-061-3/+3
|
* remove b_proc from struct buf, it's (now) unused.phk1999-05-063-14/+8
| | | | Reviewed by: dillon, bde
* Don't ignore mmap() address hint below the text section.luoqi1999-05-061-2/+4
|
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-7/+9
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* The VFS/BIO subsystem contained a number of hacks in order to optimizealc1999-05-026-22/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | piecemeal, middle-of-file writes for NFS. These hacks have caused no end of trouble, especially when combined with mmap(). I've removed them. Instead, NFS will issue a read-before-write to fully instantiate the struct buf containing the write. NFS does, however, optimize piecemeal appends to files. For most common file operations, you will not notice the difference. The sole remaining fragment in the VFS/BIO system is b_dirtyoff/end, which NFS uses to avoid cache coherency issues with read-merge-write style operations. NFS also optimizes the write-covers-entire-buffer case by avoiding the read-before-write. There is quite a bit of room for further optimization in these areas. The VM system marks pages fully-valid (AKA vm_page_t->valid = VM_PAGE_BITS_ALL) in several places, most noteably in vm_fault. This is not correct operation. The vm_pager_get_pages() code is now responsible for marking VM pages all-valid. A number of VM helper routines have been added to aid in zeroing-out the invalid portions of a VM page prior to the page being marked all-valid. This operation is necessary to properly support mmap(). The zeroing occurs most often when dealing with file-EOF situations. Several bugs have been fixed in the NFS subsystem, including bits handling file and directory EOF situations and buf->b_flags consistancy issues relating to clearing B_ERROR & B_INVAL, and handling B_DONE. getblk() and allocbuf() have been rewritten. B_CACHE operation is now formally defined in comments and more straightforward in implementation. B_CACHE for VMIO buffers is based on the validity of the backing store. B_CACHE for non-VMIO buffers is based simply on whether the buffer is B_INVAL or not (B_CACHE set if B_INVAL clear, and vise-versa). biodone() is now responsible for setting B_CACHE when a successful read completes. B_CACHE is also set when a bdwrite() is initiated and when a bwrite() is initiated. VFS VOP_BWRITE routines (there are only two - nfs_bwrite() and bwrite()) are now expected to set B_CACHE. This means that bowrite() and bawrite() also set B_CACHE indirectly. There are a number of places in the code which were previously using buf->b_bufsize (which is DEV_BSIZE aligned) when they should have been using buf->b_bcount. These have been fixed. getblk() now clears B_DONE on return because the rest of the system is so bad about dealing with B_DONE. Major fixes to NFS/TCP have been made. A server-side bug could cause requests to be lost by the server due to nfs_realign() overwriting other rpc's in the same TCP mbuf chain. The server's kernel must be recompiled to get the benefit of the fixes. Submitted by: Matthew Dillon <dillon@apollo.backplane.com>
* s/static foo_devsw_installed = 0;/static int foo_devsw_installed;/.dt1999-04-281-2/+2
| | | | (Edited automatically)
* Suser() simplification:phk1999-04-272-7/+6
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Make pmap_collect() an official pmap interface.dt1999-04-232-3/+3
|
* unifdef -DVM_STACK - it's been on for a while for x86 and was checkedpeter1999-04-191-9/+3
| | | | and appeared to be working for the Alpha some time ago.
* Move the declaration of faultin() from the vm headers to proc.h, sincepeter1999-04-131-2/+1
| | | | it is now referenced from a macro there (PHOLD()).
* Staticizeeivind1999-04-111-2/+2
|
* Convert usage of vm_page_bits() to the new convention ("Inputs are requireddt1999-04-101-2/+2
| | | | to range within a page").
* Lock vnode correctly for VOP_OPEN.eivind1999-04-101-1/+5
| | | | Discussed with: alc, dillon
* Don't forcibly kill processes that are locked in-core via PHOLD - it waspeter1999-04-061-2/+3
| | | | just checking P_NOSWAP before.
* Only use p->p_lock (manage by PHOLD()/PRELE()) - P_NOSWAP/P_PHYSIO is nopeter1999-04-061-2/+2
| | | | longer set.
* Catch a case spotted by Tor where files mmapped could leave garbage in thejulian1999-04-054-38/+157
| | | | | | | | | | | | unallocated parts of the last page when the file ended on a frag but not a page boundary. Delimitted by tags PRE_MATT_MMAP_EOF and POST_MATT_MMAP_EOF, in files alpha/alpha/pmap.c i386/i386/pmap.c nfs/nfs_bio.c vm/pmap.h vm/vm_page.c vm/vm_page.h vm/vnode_pager.c miscfs/specfs/spec_vnops.c ufs/ufs/ufs_readwrite.c kern/vfs_bio.c Submitted by: Matt Dillon <dillon@freebsd.org> Reviewed by: Alan Cox <alc@freebsd.org>
* Two changes to vm_map_delete:alc1999-04-041-13/+10
| | | | | | | | | | | | | | 1. Don't bother checking object->ref_count == 1 in order to set OBJ_ONEMAPPING. It's a waste of time. If object->ref_count == 1, vm_map_entry_delete will "run-down" the object and its pages. 2. If object->ref_count == 1, ignore OBJ_ONEMAPPING. Wait for vm_map_entry_delete to "run-down" the object and its pages. Otherwise, we're calling two different procedures to delete the object's pages. Note: "vmstat -s" will once again show a non-zero value for "pages freed by exiting processes".
* Mainly, eliminate the comments about share maps. (We don't have share mapsalc1999-03-271-33/+7
| | | | | any more.) Also, eliminate an incorrect comment that says that we don't coalesce vm_map_entry's. (We do.)
* Correct a comment.eivind1999-03-271-2/+2
|
* Two changes:alc1999-03-211-19/+24
| | | | | | | | | | Remove more (redundant) map timestamp increments from properly synchronized routines. (Changed: vm_map_entry_link, vm_map_entry_unlink, and vm_map_pageable.) Micro-optimize vm_map_entry_link and vm_map_entry_unlink, eliminating unnecessary dereferences. At the same time, converted them from macros to inline functions.
* Construct the free queue(s) in descending order (by physicalalc1999-03-191-2/+8
| | | | | | address) so that the first 16MB of physical memory is allocated last rather than first. On large-memory machines, this avoids the exhaustion of low physical memory before isa_dmainit has run.
* Correct a problem in kmem_malloc: A kmem_malloc allowing "wait" mayalc1999-03-161-3/+5
| | | | | | block (VM_WAIT) holding the map lock. This is bad. For example, a subsequent kmem_malloc by an interrupt handler on the same map may find the lock held and panic in the lockmgr.
* Two changes:alc1999-03-151-10/+5
| | | | | | | | | | In general, vm_map_simplify_entry should be performed INSIDE the loop that traverses the map, not outside. (Changed: vm_map_inherit, vm_map_pageable.) vm_fault_unwire doesn't acquire the map lock (or block holding it). Thus, vm_map_set/clear_recursive shouldn't be called. (Changed: vm_map_user_pageable, vm_map_pageable.)
* Fix breakage in last commitjulian1999-03-151-3/+3
| | | | Submitted by: Brian Feldman <green@unixhelp.org>
* A bit of a hack, but allows the vn device to be a module again.julian1999-03-141-1/+15
| | | | Submitted by: Matt Dillon <dillon@freebsd.org>
OpenPOWER on IntegriCloud