summaryrefslogtreecommitdiffstats
path: root/sys/vm
Commit message (Collapse)AuthorAgeFilesLines
* KNFize, by bde.eivind1999-01-106-28/+27
|
* Split DIAGNOSTIC -> DIAGNOSTIC, INVARIANTS, and INVARIANT_SUPPORT aseivind1999-01-088-74/+42
| | | | | | | | | discussed on -hackers. Introduce 'KASSERT(assertion, ("panic message", args))' for simple check + panic. Reviewed by: msmith
* Changes to the LINUX_THREADS support to only allocate extra memory forjulian1999-01-071-1/+10
| | | | | | | | | | | | | | | | | | | | | | shared signal handling when there is shared signal handling being used. This removes the main objection to making the shared signal handling a standard ability in rfork() and friends and 'unconditionalising' this code. (i.e. the allocation of an extra 328 bytes per process). Signal handling information remains in the U area until such a time as it's reference count would be incremented to > 1. At that point a new struct is malloc'd and maintained in KVM so that it can be shared between the processes (threads) using it. A function to check the reference count and move the struct back to the U area when it drops back to 1 is also supplied. Signal information is therefore now swapable for all processes that are not sharing that information with other processes. THis should addres the concerns raised by Garrett and others. Submitted by: "Richard Seaman, Jr." <dick@tar.com>
* Add (but don't activate) code for a special VM option to makejulian1999-01-064-4/+235
| | | | | | | | | | | | | 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>
* Ifdefed conditionally used simplock variables.bde1999-01-021-1/+3
|
* Don't free swap in swap_pager_getpages(): this code probably cause thedt1998-12-291-23/+1
| | | | | | | | | | | "dying daemons" problem. (I thought this code was introduced in rev.1.80, but it just relaxed the condition.) Also, kill related "suggest more swap space" warning (also introduced in 1.80). It was confusing, to say the least... Requested by: msmith Not objected by: dg
* Update comments to routines in vm_page.c, most especially whether adillon1998-12-231-19/+106
| | | | | routine can block or not as part of a general effort to carefully document blocking/non-blocking calls in the kernel.
* Fix two bogons created by 'patch(1)' in my last commit.julian1998-12-191-6/+8
|
* Reviewed by: Luoqi Chen, Jordan Hubbardjulian1998-12-191-1/+8
| | | | | | | | | | | | Submitted by: "Richard Seaman, Jr." <lists@tar.com> Obtained from: linux :-) Code to allow Linux Threads to run under FreeBSD. By default not enabled This code is dependent on the conditional COMPAT_LINUX_THREADS (suggested by Garret) This is not yet a 'real' option but will be within some number of hours.
* Don't disable mmap with large file offset.dt1998-12-091-3/+2
|
* The "easy" fixes for compiling the kernel -Wunused: remove unreferenced staticarchie1998-12-071-2/+1
| | | | and local variables, goto labels, and functions declared but not defined.
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-3/+4
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* In vnode_pager_input_old, set auio.uio_procp = curprocrvb1998-12-041-2/+2
| | | | vs auio.uio_procp = (struct proc *) 0
* Add missing splvm protection around unqueue call. Without this, the pagedg1998-11-251-4/+4
| | | | queues would eventually get corrupted.
* Fixed a null pointer panic in spc_free(). swap_pager_putpages()bde1998-11-191-7/+9
| | | | | | | | | | | almost always causes this panic for the curproc != pageproc case. This case apparently doesn't happen in normal operation, but it happens when vm_page_alloc_contig() is called when there is a memory hogging application that hasn't already been paged out. PR: 8632 Reviewed by: info@opensound.com (Dev Mazumdar), dg Broken in: rev.1.89 (1998/02/23)
* Closed a small race condition between wiring/unwiring pages that involveddg1998-11-111-4/+4
| | | | the page's wire_count.
* add #include <sys/kernel.h> where it's needed by MALLOC_DEFINE()peter1998-11-101-1/+2
|
* * Fix a couple of places in the device pager where an address wasdfr1998-11-081-3/+4
| | | | | | | | | | | truncated to 32 bits. * Change the calling convention of the device mmap entry point to pass a vm_offset_t instead of an int for the offset allowing devices with a larger memory map than (1<<32) to be supported on the alpha (/dev/mem is one such). These changes are required to allow the X server to mmap the various I/O regions used for device port and memory access on the alpha.
* Implemented zero-copy TCP/IP extensions via sendfile(2) - send adg1998-11-051-3/+1
| | | | | | | | | | | file to a stream socket. sendfile(2) is similar to implementations in HP-UX, Linux, and other systems, but the API is more extensive and addresses many of the complaints that the Apache Group and others have had with those other implementations. Thanks to Marc Slemko of the Apache Group for helping me work out the best API for this. Anyway, this has the "net" result of speeding up sends of files over TCP/IP sockets by about 10X (that is to say, uses 1/10th of the CPU cycles) when compared to a traditional read/write loop.
* Add John Dyson's SYSCTL descriptions, and an export of more stats topeter1998-10-313-16/+118
| | | | | a sysctl hierarchy (vm.stats.*). SYSCTL descriptions are only present in source, they do not get compiled into the binaries taking up memory.
* Use TAILQ macros for clean/dirty block list processing. Set b_xflagspeter1998-10-312-5/+5
| | | | rather than abusing the list next pointer with a magic number.
* Fixed wrong comments in and about vm_page_deactivate().dg1998-10-281-13/+3
|
* Added a second argument, "activate" to the vm_page_unwire() call so thatdg1998-10-283-11/+19
| | | | the caller can select either inactive or active queue to put the page on.
* Added needed splvm() protection around object page traversal indg1998-10-271-1/+4
| | | | vm_object_terminate().
* Don't follow null bdevsw pointers. The `major(dev) < nblkdev' test rottedbde1998-10-251-7/+4
| | | | | | | | | | | | when bdevsw[] became sparse. We still depend on magic to avoid having to check that (v_rdev) device numbers in vnodes are not NODEV. Removed a redundant `major(dev) < nblkdev' test instead of updating it. Don't follow a garbage bdevsw pointer for attempts to swap on empty regular files. This case currently can't happen. Swapping on regular files is ifdefed out in swapon() and isn't attempted for empty files in nfs_mountroot().
* Nitpicking and dusting performed on a train. Removes trivial warningsphk1998-10-255-23/+9
| | | | about unused variables, labels and other lint.
* Oops, revert part of last fix. vm_pager_dealloc() can't be called untildg1998-10-231-7/+8
| | | | | after the pages are removed from the object...so fix the problem by not printing the diagnostic for wired fictitious pages (which is normal).
* Fixed two bugs in recent commit: in vm_object_terminate, vm_pager_deallocdg1998-10-231-8/+10
| | | | | | | | needs to be called prior to freeing remaining pages in the object so that the device pager has an opportunity to grab its "fake" pages. Also, in the case of wired pages, the page must be made busy prior to calling vm_page_remove. This is a difference from 2.2.x that I overlooked when I brought these changes forward.
* Make the VM system handle the case where a terminating object containsdg1998-10-221-43/+31
| | | | | | legitimately wired pages. Currently we print a diagnostic when this happens, but this will be removed soon when it will be common for this to occur with zero-copy TCP/IP buffers.
* Convert fake page allocs to use the zone allocator, thus eliminating thedg1998-10-221-14/+8
| | | | private pool management code in here.
* Set m->object to NULL in dev_pager_getfake().dg1998-10-211-1/+2
|
* Nuked PG_TABLED flag. Replaced with m->object != NULL.dg1998-10-212-10/+5
|
* Add a diagnostic printf for freeing a wired page. This will eventuallydg1998-10-211-1/+2
| | | | | be turned into a panic, but I want to make sure that all cases of freeing pages with wire_count==1 (which is/was allowed) have first been fixed.
* Fixed two potentially serious classes of bugs:dg1998-10-1311-45/+47
| | | | | | | | | | | | | | | | 1) The vnode pager wasn't properly tracking the file size due to "size" being page rounded in some cases and not in others. This sometimes resulted in corrupted files. First noticed by Terry Lambert. Fixed by changing the "size" pager_alloc parameter to be a 64bit byte value (as opposed to a 32bit page index) and changing the pagers and their callers to deal with this properly. 2) Fixed a bogus type cast in round_page() and trunc_page() that caused some 64bit offsets and sizes to be scrambled. Removing the cast required adding casts at a few dozen callers. There may be problems with other bogus casts in close-by macros. A quick check seemed to indicate that those were okay, however.
* Fix a panic on SMP systems, caused by sleeping while holding ajdp1998-10-091-1/+13
| | | | | | | | | | | | | | | | | | | simple-lock. The reviewer raises the following caveat: "I believe these changes open a non-critical race condition when adding memory to the pool for the zone. I think what will happen is that you could have two threads that are simultaneously adding additional memory when the pool runs out. This appears to not be a problem, however, since the re-aquisition of the lock will protect the list pointers." The submitter agrees that the race is non-critical, and points out that it already existed for the non-SMP case. He suggests that perhaps a sleep lock (using the lock manager) should be used to close that race. This might be worth revisiting after 3.0 is released. Reviewed by: dg (David Greenman) Submitted by: tegge (Tor Egge)
* Fix a bug in which a page index was used where a byte offset wasjdp1998-10-011-2/+2
| | | | | | | | | | expected. This bug caused builds of Modula-3 to fail in mysterious ways on SMP kernels. More precisely, such builds failed on systems with kern.fast_vfork equal to 0, the default and only supported value for SMP kernels. PR: kern/7468 Submitted by: tegge (Tor Egge)
* Make #define NO_SWAPPING a normal kernel config option.abial1998-09-292-2/+4
| | | | Reviewed by: jkh
* John Dyson approved of this solution; make vnode_pager_input_old set m->validrvb1998-09-281-1/+3
|
* Be more selctive about when we clear p->valid.dg1998-09-281-3/+5
| | | | Submitted by: John Dyson <toor@dyson.iquest.net>
* Removed unused file.bde1998-09-201-46/+0
|
* Instantiate `nfs_mount_type' in a standard file so that it is presentbde1998-09-051-3/+2
| | | | | | | | when nfs is an LKM. Declare it in a header file. Don't forget to use it in non-Lite2 code. Initialize it to -1 instead of to 0, since 0 will soon be the mount type number for the first vfs loaded. NetBSD uses strcmp() to avoid this ugly global.
* Cosmetic changes to the PAGE_XXX macros to make them consistent withdfr1998-09-0410-104/+130
| | | | the other objects in vm.
* Separate wakeup conditions for page I/O count (pg_busy) and lock (PG_BUSY).wollman1998-09-011-4/+3
| | | | | | | This is not sa completely solution to the deadlock, but the additional wakeups have helped in my observation. Suggested by: John Dyson
* Fix a rounding problem that causes vnode pager to fail to remove the lastluoqi1998-08-251-11/+9
| | | | | | partially filled page during a truncation. PR: kern/7422
* Change various syscalls to use size_t arguments instead of u_int.dfr1998-08-2412-119/+143
| | | | | | | | | | 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>
* Correct/clarify some comments.mckay1998-08-221-3/+3
|
* Protect all modifications to paging_in_progress with splvm().dfr1998-08-131-1/+3
|
* Protect all modifications to paging_in_progress with splvm(). The i386dfr1998-08-065-14/+25
| | | | | | | | | 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...)
* Fixed two spl nesting bugs. They caused (at least) the entire pageoutbde1998-07-281-2/+2
| | | | | | | daemon to run at splvm() forever after swap_pager_putpages() is called from vm_pageout_scan(). Broken in: rev.1.189 (1998/02/23)
* Notify pmap when a page is freed on the alpha to allow it to clean updfr1998-07-262-2/+9
| | | | its emulated modified/referenced bits.
OpenPOWER on IntegriCloud