Commit Graph

315 Commits

Author SHA1 Message Date
thorpej e76d5a2fe1 Oops, don't need vm_page_physget() if PMAP_STEAL_MEMORY. 1998-01-10 03:02:58 +00:00
thorpej 51902c1094 In vm_page_physload(), check page_shift not cnt.v_page_size for
having been initialized.
1998-01-09 08:50:00 +00:00
thorpej 4001cf8069 In vm_mem_init(), don't test for cnt.v_page_size being == 0. It is perfectly
legitimate for this to be set if vm_set_page_size() hasn't been called (it's
how the page size is communicated to vm_set_page_size()).  Instead, test
for page_shift == 0; this is one of the values that vm_set_page_size()
initializes.
1998-01-09 06:00:50 +00:00
thorpej 54f8b4bf57 In the new non-contig case, redefine pmap_steal_memory() as an alternative
to vm_bootstrap_steal_memory(), since we may need to steal memory from
a direct-mapped segment at this early stage of the game (on e.g. MIPS
and Alpha).

This interface is activated by defining PMAP_STEAL_MEMORY in <machine/pmap.h>.
Otherwise, the pmap_virtual_space() prototype is in-scope for use by
vm_bootstrap_steal_memory().
1998-01-08 23:28:04 +00:00
thorpej 15efce41a3 Zorch pmap_startup() prototype. It was never implemented in machine-dependent
code, and is inlined in the MACHINE_NONCONTIG case of vm_page_bootstrap() now.
1998-01-08 23:13:05 +00:00
thorpej 589a1e440e Clean up and consolidate the old non-contig bootstrap functions, and
rename pmap_steal_memory() to vm_bootstrap_steal_memory().
1998-01-08 23:03:24 +00:00
mrg a20d56e92e add new version of non contiguous memory code, written by chuck cranor,
called "MACHINE_NEW_NONCONGIG".  this is required for UVM, the new VM
system (also written by chuck) that is coming soon.  adds new functions:
	vm_page_physload() -- tell the VM system about an area of memory.
	vm_physseg_find() -- returns index in vm_physmem array that this
		address is in.
and several new versions of old functions/macros defined in vm_page.h.

this is the MI portion.  sparc, and then later i386 portions to come.
all other ports need to change to this ASAP!  (alpha is already being
worked on)
1998-01-08 11:36:16 +00:00
thorpej d8ee45898e Garbage-collect __VM_PMAP_HACK. 1998-01-06 08:36:23 +00:00
perry 24920eefb1 RCSID Police. 1998-01-05 19:40:40 +00:00
thorpej 5739c88a75 Implement address space sharing (by keeping ref counts on the vmspace
structure).  Many thanks to Chuck Cranor for debugging assistence.
1998-01-03 02:53:00 +00:00
thorpej b9f1b716f3 Now that all ports have pmap_activate(), and it has an identical interface,
prototype it in <vm/pmap.h>
1998-01-03 01:12:59 +00:00
thorpej a322314f51 Split out the code that prepares a VM space for exec into a new
vmspace_exec() function.
1997-12-31 07:47:41 +00:00
pk 443a2a02f4 "pool" routines moved to kern/subr_pool.c 1997-12-15 11:18:41 +00:00
pk 5d1352c448 Guard against synchronous I/O completetion per swap-device. 1997-12-02 13:47:37 +00:00
pk 1736bb9de8 Make the code a bit more readable. 1997-12-01 17:10:48 +00:00
pk d4a6f93147 Make sure the damned buffer heads are initialized... 1997-12-01 16:33:15 +00:00
pk 46f604677d Avoid several race conditions, especially when a transaction ends in error.
Guard sw_reg_start() against synchronous completions of the device
strategy routines, avoiding possibly boundless recursion.
1997-11-29 00:35:43 +00:00
thorpej 97d2a58201 Fix slight argument bogosity with getgroups(), setgroups(), select(),
and swapctl().  For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs.  For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
1997-11-04 21:24:14 +00:00
thorpej 14cd99880c Fix the shared library versioning snafu caused by the recent changes
to the stat(2) family and msync(2).  This uses a primitive function
versioning scheme.

This reverts the libc shared library major version from 13 to 12, and
adds a few new interfaces to bring us to libc version 12.20.

From Frank van der Linden <fvdl@NetBSD.ORG>.
1997-10-20 22:05:06 +00:00
pk d24dbbbfc4 A `simplelock' suffices for most swap device list traversals, as noted
by Chuck Cranor.

Use an exclusive (long-term) lock before applying changes to the swap
lists. This lock is also used by the stats system call because of possible
blocking in copyout().
1997-10-17 19:06:05 +00:00
christos b82d33e84c PR/4269: Chris Demetriou: msync is missing the MS_* flags.
Also change caddr_t syscall arguments to void *
1997-10-16 23:29:26 +00:00
pk dfbda96da0 Use `long' to cast a pointer to an integer and back. 1997-10-14 08:50:18 +00:00
pk e95c79e586 Keep a private pool of auxiliary resources (vndxfer & vndbuf structures)
used to setup I/O to regular files.

Implemented in a somewhat generic way, for what it's worth.
1997-10-13 19:15:19 +00:00
mrg 55c881fbd2 when creating the per-device extent, use from 0 to nblks, and then
extent_alloc_region() any skipped space.  this is (basically) what
the previous swap code did (with rmaps rather than extents).
1997-10-10 13:16:24 +00:00
mrg 74f573d85d remove advertising clause from all my licenses. 1997-10-10 05:39:47 +00:00
chuck 081b0ea365 correct a comment 1997-09-22 15:22:12 +00:00
enami 8a45521059 Convert RTC_OFFSET, DEVPAGER, SWAPPAGER and VNODEPAGER to be declared
by defopt.
1997-09-20 00:44:05 +00:00
thorpej 9a31fc02fe Don't forget to increase the free page count in vm_page_free_memory(),
pointed out by Mark Brinicombe <mark@causality.com>.
1997-09-16 00:08:09 +00:00
pk 9f1374779b Remove a comment that's incorrect since last commit. 1997-09-10 18:26:33 +00:00
pk 2d8fd853ae Unlocking the target object within vm_object_overlay() is safe, since
the backing object is protected the OBJ_FADING flag.

In vm_object_deallocate(), gain a reference to the object we try to
collapse (per Manuel Bouyer).
1997-09-08 21:23:22 +00:00
chuck 1821ecc346 import sys_minherit() from openbsd. 1997-09-08 18:19:45 +00:00
pk c5d6596b7c vm_object_deallocate():
Unlock the object cache before looking for collapse candidates.
	Use vm_object_lock_try() to obtain a lock on a collapse candidate.
	This avoids a deadlock due to recursively entering
	vm_object_deallocate() in case a backing object goes away.

vm_object_collapse() and helper functions:
	The object passed in is locked; make sure it is locked when
	we leave vm_object_collapse().

   XXX: Currently, the object is not unlocked during while we possibly
	wait for pager data. We need to consider the effects of
	simultaneous calls to vm_object_collapse() on the same object
	in case unlocking is necessary.
1997-09-07 21:19:41 +00:00
pk 9bec4e7918 Don't hold on to object and queue locks while sleeping. 1997-09-07 20:41:59 +00:00
pk 0c386233d4 Adapt a diagnostic to big-endian machines.
(Not that it actually works on little-endians, but we can easily make it not
work on big-endians all the same).
1997-09-07 20:39:23 +00:00
pk fff424c798 Add missing `unlock(&vm_object_list_lock);' 1997-09-07 19:31:52 +00:00
mrg 66d1e506df remove last vestigates of __FORK_BRAINDAMANGE 1997-08-27 02:35:38 +00:00
drochner 448446ec38 Don't make coredump of areas which are mmap()ed from a device.
This can have bad side effects.
Closes PR kern/3252.
1997-07-22 10:06:43 +00:00
fvdl 933d4afe84 Make vm_map_clear_recursive behave exactly like the old lock_clear_recursive.
This doesn't make a difference in the way that it's currently being called,
but it's more intuitive.
1997-07-20 23:23:45 +00:00
fvdl 5a4803bc55 XXX - some userland code includes this, needing <sys/time.h>, so
include it, for the time being.
1997-07-07 10:57:34 +00:00
fvdl 206e9582ef Move lock.h and kern_lock.c to their rightful places, as in Lite2. Make
the VM code use the new interface.
1997-07-06 12:38:25 +00:00
drochner 8c0a9bab00 Don't cast 64bit (off_t) file sizes to vm_offset_t (32bit on many
architectures), truncate them intelligently instead.
The truncation is done centralized in vnode_pager.c.
This prevents from wrap-over effects when parts of large (>2^32 byte) files
are mmapped.
Don't allow to mmap above the numerical range of vm_offset_t.
This is considered a temporary solution until the vm system handles the
object sizes/offsets more cleanly.
1997-07-04 20:22:09 +00:00
thorpej 657f118b7f Update the status of a couple of items here... specifically, more aggressive
object collapse (DONE), machine-dependent hook for virtual memory allocation
(DONE - PMAP_PREFER()), and better coherency between page and buffer
caches (A LITTLE BETTER - we sync up the vnode pager in the sync(2)
system call now).
1997-06-26 01:02:07 +00:00
mrg 781dfea84f back out previous. look in unistd.h. 1997-06-23 01:15:03 +00:00
christos 796badce6b PR/3772: Matthias Scheler: Missing swapctl prototype. 1997-06-22 19:35:55 +00:00
pk 98ce8ab879 Remove __FORK_BRAINDAMAGEd code; it's no longer needed. 1997-06-19 20:54:15 +00:00
thorpej 3bd11220b6 Don't print a message if the user attempts SWAP_OFF. Return an error
instead.
1997-06-17 03:37:07 +00:00
thorpej c61704d37c Remove the code that sets dumpdev, for two reasons:
- It was incorrect.  A dev_t should _never_ be compared against
  NULL, as 0 is a valid value (major 0, minor 0).
- The operator mave have _intentionally_ set dumpdev to "none"
  (i.e. NODEV), and setting it the first time a VBLK swap device
  is added would break the semantics.
setroot() deals with all dump device selection.  Dumps and swap are now
in no way related.
1997-06-16 20:21:55 +00:00
mrg c78d0720ff - set dumpdev if not already set
- don't use nocoalease (from thorpej).
- fix priority list management (from pk).
- update comment for swapoff.
- free swap device extent name safely (from thorpej).
1997-06-16 13:35:17 +00:00
pk e5b0a8820b As long as we actually use `swapdev_vp', initialize it. 1997-06-13 15:37:17 +00:00
mrg 21cc3ddfd5 bring mrg-vm-swap2 onto mainilne. 1997-06-12 14:51:20 +00:00