The NetBSD Project

CVS log for src/sys/uvm/uvm_extern.h

[BACK] Up to [cvs.NetBSD.org] / src / sys / uvm

Request diff between arbitrary revisions


Default branch: MAIN
Current tag: MAIN


Revision 1.233 / (download) - annotate - [select for diffs], Sun Feb 26 07:27:14 2023 UTC (13 months, 2 weeks ago) by skrll
Branch: MAIN
CVS Tags: thorpej-ifq-base, thorpej-ifq, thorpej-altq-separation-base, thorpej-altq-separation, HEAD
Changes since 1.232: +2 -2 lines
Diff to previous 1.232 (colored) to selected 1.67 (colored)

nkmempages should be size_t

Revision 1.232 / (download) - annotate - [select for diffs], Mon May 31 10:57:02 2021 UTC (2 years, 10 months ago) by riastradh
Branch: MAIN
CVS Tags: thorpej-i2c-spi-conf2-base, thorpej-i2c-spi-conf2, thorpej-i2c-spi-conf-base, thorpej-futex2-base, thorpej-futex2, thorpej-cfargs2-base, thorpej-cfargs2, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, bouyer-sunxi-drm-base, bouyer-sunxi-drm
Changes since 1.231: +3 -1 lines
Diff to previous 1.231 (colored) to selected 1.67 (colored)

uvm: Make uvm_extern.h (more) self-contained, needs sys/types.h.

Revision 1.231 / (download) - annotate - [select for diffs], Fri Aug 14 09:06:15 2020 UTC (3 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: thorpej-futex-base, thorpej-futex, thorpej-cfargs-base, thorpej-cfargs, cjep_staticlib_x-base
Branch point for: thorpej-i2c-spi-conf, cjep_staticlib_x
Changes since 1.230: +9 -2 lines
Diff to previous 1.230 (colored) to selected 1.67 (colored)

centralize calls from UVM to radixtree into a few functions.
in those functions, assert that the object lock is held in
the correct mode.

Revision 1.230 / (download) - annotate - [select for diffs], Sun Jun 14 22:25:15 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.229: +1 -3 lines
Diff to previous 1.229 (colored) to selected 1.67 (colored)

g/c vm_page_zero_enable

Revision 1.229 / (download) - annotate - [select for diffs], Sat Jun 13 19:55:58 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (colored) to selected 1.67 (colored)

uvm_pagerealloc(): resurrect the insertion case.

Revision 1.228 / (download) - annotate - [select for diffs], Thu Jun 11 19:20:47 2020 UTC (3 years, 10 months ago) by ad
Branch: MAIN
Changes since 1.227: +2 -2 lines
Diff to previous 1.227 (colored) to selected 1.67 (colored)

uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched.  It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.

Revision 1.227 / (download) - annotate - [select for diffs], Tue May 26 00:50:53 2020 UTC (3 years, 10 months ago) by kamil
Branch: MAIN
Changes since 1.226: +2 -3 lines
Diff to previous 1.226 (colored) to selected 1.67 (colored)

Catch up with the usage of struct vmspace::vm_refcnt

Use the dedicated reference counting routines.

Change the type of struct vmspace::vm_refcnt and struct vm_map::ref_count
to volatile.

Remove the unnecessary vm->vm_map.misc_lock locking in process_domem().

Reviewed by <ad>

Revision 1.226 / (download) - annotate - [select for diffs], Sat May 9 15:13:19 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.225: +3 -11 lines
Diff to previous 1.225 (colored) to selected 1.67 (colored)

Make the uvm_voaddr structure more compact, only occupying 2 pointers
worth of space, by encoding the type in the lower bits of the object
pointer.

Revision 1.225 / (download) - annotate - [select for diffs], Mon Apr 27 02:47:26 2020 UTC (3 years, 11 months ago) by rin
Branch: MAIN
Changes since 1.224: +2 -2 lines
Diff to previous 1.224 (colored) to selected 1.67 (colored)

Add missing \ to fix build for PMAP_CACHE_VIVT, i.e., ARMv4 and prior.

Revision 1.224 / (download) - annotate - [select for diffs], Thu Apr 23 21:47:09 2020 UTC (3 years, 11 months ago) by ad
Branch: MAIN
CVS Tags: bouyer-xenpvh-base2
Changes since 1.223: +7 -4 lines
Diff to previous 1.223 (colored) to selected 1.67 (colored)

PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

- Add new flag UBC_ISMAPPED which tells ubc_uiomove() the object is mmap()ed
  somewhere.  Use it to decide whether to do direct-mapped copy, rather than
  poking around directly in the vnode in ubc_uiomove(), which is ugly and
  doesn't work for tmpfs.  It would be nicer to contain all this in UVM but
  the filesystem provides the needed locking here (VV_MAPPED) and to
  reinvent that would suck more.

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS().  Pass in UBC_ISMAPPED where
  appropriate.

Revision 1.223 / (download) - annotate - [select for diffs], Sat Apr 18 03:27:13 2020 UTC (3 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: phil-wifi-20200421, bouyer-xenpvh-base1
Changes since 1.222: +41 -1 lines
Diff to previous 1.222 (colored) to selected 1.67 (colored)

Add an API to get a reference on the identity of an individual byte of
virtual memory, a "virtual object address".  This is not a reference to
a physical byte of memory, per se, but a reference to a byte residing
in a page, owned by a unique UVM object (either a uobj or an anon).  Two
separate address+addresses space tuples that reference the same byte in
an object (such as a location in a shared memory segment) will resolve
to equivalent virtual object addresses.  Even if the residency status
of the page changes, the virtual object address remains unchanged.

struct uvm_voaddr -- a structure that encapsulates this address reference.

uvm_voaddr_acquire() -- a function to acquire this address reference,
given a vm_map and a vaddr_t.

uvm_voaddr_release() -- a function to release this address reference.

uvm_voaddr_compare() -- a function to compare two such address references.

uvm_voaddr_acquire() resolves the COW status of the object address before
acquiring.

In collaboration with riastradh@ and chs@.

Revision 1.222 / (download) - annotate - [select for diffs], Sun Mar 22 18:32:42 2020 UTC (4 years ago) by ad
Branch: MAIN
CVS Tags: phil-wifi-20200411, phil-wifi-20200406, bouyer-xenpvh-base
Branch point for: bouyer-xenpvh
Changes since 1.221: +4 -1 lines
Diff to previous 1.221 (colored) to selected 1.67 (colored)

Process concurrent page faults on individual uvm_objects / vm_amaps in
parallel, where the relevant pages are already in-core.  Proposed on
tech-kern.

Temporarily disabled on MP architectures with __HAVE_UNLOCKED_PMAP until
adjustments are made to their pmaps.

Revision 1.221 / (download) - annotate - [select for diffs], Sun Feb 23 15:46:43 2020 UTC (4 years, 1 month ago) by ad
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp, ad-namecache-base3
Changes since 1.220: +2 -2 lines
Diff to previous 1.220 (colored) to selected 1.67 (colored)

UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart.  v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap.  Others to follow later.

Revision 1.220 / (download) - annotate - [select for diffs], Tue Feb 18 20:23:17 2020 UTC (4 years, 1 month ago) by chs
Branch: MAIN
Changes since 1.219: +1 -2 lines
Diff to previous 1.219 (colored) to selected 1.67 (colored)

remove the aiodoned thread.  I originally added this to provide a thread context
for doing page cache iodone work, but since then biodone() has changed to
hand off all iodone work to a softint thread, so we no longer need the
special-purpose aiodoned thread.

Revision 1.219 / (download) - annotate - [select for diffs], Wed Jan 15 17:55:45 2020 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base2, ad-namecache-base1
Changes since 1.218: +10 -2 lines
Diff to previous 1.218 (colored) to selected 1.67 (colored)

Merge from yamt-pagecache (after much testing):

- Reduce unnecessary page scan in putpages esp. when an object has a ton of
  pages cached but only a few of them are dirty.

- Reduce the number of pmap operations by tracking page dirtiness more
  precisely in uvm layer.

Revision 1.218 / (download) - annotate - [select for diffs], Tue Dec 31 22:42:51 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: ad-namecache-base
Branch point for: ad-namecache
Changes since 1.217: +2 -1 lines
Diff to previous 1.217 (colored) to selected 1.67 (colored)

- Add and use wrapper functions that take and acquire page interlocks, and pairs
  of page interlocks.  Require that the page interlock be held over calls to
  uvm_pageactivate(), uvm_pagewire() and similar.

- Solve the concurrency problem with page replacement state.  Rather than
  updating the global state synchronously, set an intended state on
  individual pages (active, inactive, enqueued, dequeued) while holding the
  page interlock.  After the interlock is released put the pages on a 128
  entry per-CPU queue for their state changes to be made real in batch.
  This results in in a ~400 fold decrease in contention on my test system.
  Proposed on tech-kern but modified to use the page interlock rather than
  atomics to synchronise as it's much easier to maintain that way, and
  cheaper.

Revision 1.217 / (download) - annotate - [select for diffs], Tue Dec 31 13:07:14 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.216: +2 -2 lines
Diff to previous 1.216 (colored) to selected 1.67 (colored)

Rename uvm_free() -> uvm_availmem().

Revision 1.216 / (download) - annotate - [select for diffs], Fri Dec 27 12:51:57 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.215: +3 -1 lines
Diff to previous 1.215 (colored) to selected 1.67 (colored)

Redo the page allocator to perform better, especially on multi-core and
multi-socket systems.  Proposed on tech-kern.  While here:

- add rudimentary NUMA support - needs more work.
- remove now unused "listq" from vm_page.

Revision 1.215 / (download) - annotate - [select for diffs], Sat Dec 21 12:58:26 2019 UTC (4 years, 3 months ago) by ad
Branch: MAIN
Changes since 1.214: +2 -1 lines
Diff to previous 1.214 (colored) to selected 1.67 (colored)

Add uvm_free(): returns number of free pages in system.

Revision 1.214 / (download) - annotate - [select for diffs], Mon Dec 16 22:47:55 2019 UTC (4 years, 4 months ago) by ad
Branch: MAIN
Changes since 1.213: +11 -8 lines
Diff to previous 1.213 (colored) to selected 1.67 (colored)

- Extend the per-CPU counters matt@ did to include all of the hot counters
  in UVM, excluding uvmexp.free, which needs special treatment and will be
  done with a separate commit.  Cuts system time for a build by 20-25% on
  a 48 CPU machine w/DIAGNOSTIC.

- Avoid 64-bit integer divide on every fault (for rnd_add_uint32).

Revision 1.213 / (download) - annotate - [select for diffs], Mon May 28 21:04:35 2018 UTC (5 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, isaki-audio2-base, isaki-audio2
Branch point for: phil-wifi
Changes since 1.212: +3 -2 lines
Diff to previous 1.212 (colored) to selected 1.67 (colored)

allow tmpfs files to be larger than 4GB.

Revision 1.212 / (download) - annotate - [select for diffs], Sat May 19 11:39:37 2018 UTC (5 years, 10 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-0521
Changes since 1.211: +1 -27 lines
Diff to previous 1.211 (colored) to selected 1.67 (colored)

Remove emap support. Unfortunately it never got to state where it would be
used and usable, due to reliability and limited & complicated MD support.

Going forward, we need to concentrate on interface which do not map anything
into kernel in first place (such as direct map or KVA-less I/O), rather
than making those mappings cheaper to do.

Revision 1.211 / (download) - annotate - [select for diffs], Tue May 8 19:33:57 2018 UTC (5 years, 11 months ago) by christos
Branch: MAIN
Changes since 1.210: +2 -2 lines
Diff to previous 1.210 (colored) to selected 1.67 (colored)

don't store the rssmax in the lwp rusage, it is a per proc property. Instead
utilize an unused field in the vmspace struct to store it. Also conditionalize
on platforms that have pmap statistics available.

Revision 1.210 / (download) - annotate - [select for diffs], Fri Apr 20 19:02:18 2018 UTC (5 years, 11 months ago) by jdolecek
Branch: MAIN
CVS Tags: pgoyette-compat-0502, pgoyette-compat-0422
Changes since 1.209: +3 -2 lines
Diff to previous 1.209 (colored) to selected 1.67 (colored)

add prot parameter for uvm_emap_enter(), so that it's possible to
enter also read/write mappings

Revision 1.209 / (download) - annotate - [select for diffs], Fri Apr 20 18:58:10 2018 UTC (5 years, 11 months ago) by jdolecek
Branch: MAIN
Changes since 1.208: +2 -5 lines
Diff to previous 1.208 (colored) to selected 1.67 (colored)

make ubc_alloc() and ubc_release() static, they should not be used
outside of ubc_uiomove()/ubc_zeropage(); for now mark as noinline
to keep them available as breakpoints

Revision 1.208 / (download) - annotate - [select for diffs], Fri Dec 15 16:03:29 2017 UTC (6 years, 4 months ago) by maya
Branch: MAIN
CVS Tags: pgoyette-compat-base, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315
Branch point for: pgoyette-compat
Changes since 1.207: +2 -2 lines
Diff to previous 1.207 (colored) to selected 1.67 (colored)

Match locking notes with reality.
misc_lock is used to protect vm_refcnt.

ok chuq

Revision 1.207 / (download) - annotate - [select for diffs], Sat Dec 2 08:15:43 2017 UTC (6 years, 4 months ago) by mrg
Branch: MAIN
CVS Tags: tls-maxphys-base-20171202
Changes since 1.206: +5 -1 lines
Diff to previous 1.206 (colored) to selected 1.67 (colored)

add two new members to uvmexp_sysctl{}:  bootpages and poolpages.
bootpages is set to the pages allocated via uvm_pageboot_alloc().
poolpages is calculated from the list of pools nr_pages members.

this brings us closer to having a valid total of pages known by
the system, vs actual pages originally managed.

XXX: poolpages needs some handling for PR_RECURSIVE pools still.

Revision 1.206 / (download) - annotate - [select for diffs], Sat May 20 07:27:15 2017 UTC (6 years, 10 months ago) by chs
Branch: MAIN
CVS Tags: perseant-stdc-iso10646-base, perseant-stdc-iso10646, nick-nhusb-base-20170825, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek
Changes since 1.205: +15 -12 lines
Diff to previous 1.205 (colored) to selected 1.67 (colored)

MAP_FIXED means something different for mremap() than it does for mmap(),
so we cannot use UVM_FLAG_FIXED to specify both behaviors.
keep UVM_FLAG_FIXED with its earlier meaning (prior to my previous change)
of whether to use uvm_map_findspace() to locate space for the new mapping or
to use the hint address that the caller passed in, and add a new flag
UVM_FLAG_UNMAP to indicate that any existing entries in the range should be
unmapped as part of creating the new mapping.  the new UVM_FLAG_UNMAP flag
may only be used if UVM_FLAG_FIXED is also specified.

Revision 1.205 / (download) - annotate - [select for diffs], Wed May 17 22:43:12 2017 UTC (6 years, 11 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base3
Changes since 1.204: +43 -1 lines
Diff to previous 1.204 (colored) to selected 1.67 (colored)

snprintb(3) for UVM_FLAGS.

Revision 1.204 / (download) - annotate - [select for diffs], Sat May 6 21:34:52 2017 UTC (6 years, 11 months ago) by joerg
Branch: MAIN
CVS Tags: prg-localcount2-base2
Changes since 1.203: +3 -1 lines
Diff to previous 1.203 (colored) to selected 1.67 (colored)

Extend the mmap(2) interface to allow requesting protections for later
use with mprotect(2), but without enabling them immediately.

Extend the mremap(2) interface to allow duplicating mappings, i.e.
create a second range of virtual addresses references the same physical
pages. Duplicated mappings can have different effective protections.

Adjust PAX mprotect logic to disallow effective protections of W&X, but
allow one mapping W and another X protections. This obsoletes using
temporary files for purposes like JIT.

Adjust PAX logic for mmap(2) and mprotect(2) to fail if W&X is requested
and not silently drop the X protection.

Improve test cases to ensure correct operation of the changed
interfaces.

Revision 1.203 / (download) - annotate - [select for diffs], Wed Jan 4 23:59:49 2017 UTC (7 years, 3 months ago) by christos
Branch: MAIN
CVS Tags: prg-localcount2-base1, prg-localcount2-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, nick-nhusb-base-20170204, jdolecek-ncq-base, jdolecek-ncq, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: prg-localcount2
Changes since 1.202: +3 -1 lines
Diff to previous 1.202 (colored) to selected 1.67 (colored)

don't include uvm_physseg.h for kmem grovellers.

Revision 1.202 / (download) - annotate - [select for diffs], Mon Jan 2 20:22:20 2017 UTC (7 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.201: +1 -3 lines
Diff to previous 1.201 (colored) to selected 1.67 (colored)

Remove a redundant #ifdef _KERNEL/#endif pair.

ok mrg@

Revision 1.201 / (download) - annotate - [select for diffs], Sat Dec 24 19:21:29 2016 UTC (7 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.200: +2 -2 lines
Diff to previous 1.200 (colored) to selected 1.67 (colored)

uvm_extern.h is has both a _KERNEL only, and a non _KERNEL only API.

Since we unconditionally expose the uvm_physseg.h API via uvm_extern.h
right now, and since uvm_physseg.h uses a kernel only datatype, viz
psize_t, we restrict exposure of uvm_physseg.h API exposure to kernel
only.

This is in conformance of its documentation via uvm_hotplug(9) as a
kernel internal API.

Revision 1.200 / (download) - annotate - [select for diffs], Thu Dec 22 13:26:24 2016 UTC (7 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.199: +9 -4 lines
Diff to previous 1.199 (colored) to selected 1.67 (colored)

Use uvm_physseg.h:uvm_page_physload() instead of uvm_extern.h

For this, include uvm_physseg.h in the build and include tree, make a
cosmetic modification to the prototype for uvm_page_physload().

Revision 1.199 / (download) - annotate - [select for diffs], Thu Dec 22 12:55:21 2016 UTC (7 years, 3 months ago) by cherry
Branch: MAIN
Changes since 1.198: +2 -1 lines
Diff to previous 1.198 (colored) to selected 1.67 (colored)

Add a new function called uvm_md_init() that can be called at the
appropriate time in the boot path by MD code.

Revision 1.198 / (download) - annotate - [select for diffs], Wed Jul 20 12:38:43 2016 UTC (7 years, 8 months ago) by maxv
Branch: MAIN
CVS Tags: pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, nick-nhusb-base-20161204, nick-nhusb-base-20161004, localcount-20160914
Changes since 1.197: +3 -1 lines
Diff to previous 1.197 (colored) to selected 1.67 (colored)

Introduce uvm_km_protect.

Revision 1.197 / (download) - annotate - [select for diffs], Wed May 25 17:43:58 2016 UTC (7 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: pgoyette-localcount-base, nick-nhusb-base-20160907, nick-nhusb-base-20160529
Branch point for: pgoyette-localcount
Changes since 1.196: +2 -2 lines
Diff to previous 1.196 (colored) to selected 1.67 (colored)

Introduce security.pax.mprotect.ptrace sysctl which can be used to bypass
mprotect settings so that debuggers can write to the text segment of traced
processes so that they can insert breakpoints. Turned off by default.
Ok: chuq (for now)

Revision 1.196 / (download) - annotate - [select for diffs], Fri Feb 5 04:18:55 2016 UTC (8 years, 2 months ago) by christos
Branch: MAIN
CVS Tags: nick-nhusb-base-20160422, nick-nhusb-base-20160319
Changes since 1.195: +5 -1 lines
Diff to previous 1.195 (colored) to selected 1.67 (colored)

PR/50744: NONAKA Kimihiro: Protect more stuff with _KERNEL && _KMEMUSER to
make uvm_extern.h compile standalone again for net-snmp.

Revision 1.195 / (download) - annotate - [select for diffs], Thu Nov 26 13:15:34 2015 UTC (8 years, 4 months ago) by martin
Branch: MAIN
CVS Tags: nick-nhusb-base-20151226
Changes since 1.194: +3 -2 lines
Diff to previous 1.194 (colored) to selected 1.67 (colored)

We never exec(2) with a kernel vmspace, so do not test for that, but instead
KASSERT() that we don't.
When calculating the load address for the interpreter (e.g. ld.elf_so),
we need to take into account wether the exec'd process will run with
topdown memory or bottom up. We can not use the current vmspace's flags
to test for that, as this happens too early. Luckily the execpack already
knows what the new state will be later, so instead of testing the current
vmspace, pass the info as additional argument to struct emul
e_vm_default_addr.
Fix all such functions and adopt all callers.

Revision 1.194 / (download) - annotate - [select for diffs], Fri Mar 20 15:41:43 2015 UTC (9 years ago) by riastradh
Branch: MAIN
CVS Tags: nick-nhusb-base-20150921, nick-nhusb-base-20150606, nick-nhusb-base-20150406
Changes since 1.193: +11 -7 lines
Diff to previous 1.193 (colored) to selected 1.67 (colored)

Comments explaining UBC_* flags.

Revision 1.193 / (download) - annotate - [select for diffs], Fri Feb 6 18:19:22 2015 UTC (9 years, 2 months ago) by maxv
Branch: MAIN
Changes since 1.192: +1 -2 lines
Diff to previous 1.192 (colored) to selected 1.67 (colored)

Kill kmeminit().

Revision 1.192 / (download) - annotate - [select for diffs], Sun Dec 14 23:48:58 2014 UTC (9 years, 4 months ago) by chs
Branch: MAIN
Changes since 1.191: +4 -4 lines
Diff to previous 1.191 (colored) to selected 1.67 (colored)

add a new "fo_mmap" fileops method to allow use of arbitrary uvm_objects for
mappings of file objects.  move vnode-specific details of mmap()ing a vnode
from uvm_mmap() to the new vnode-specific vn_mmap().  add new uvm_mmap_dev()
and uvm_mmap_anon() convenience functions for mapping character devices
and anonymous memory, and replace all other calls to uvm_mmap() with those.
use the new fileop in drm2 so that libdrm can use mmap() to map things
like on other platforms (instead of the ioctl that we have used so far).

Revision 1.191 / (download) - annotate - [select for diffs], Mon Jul 7 20:14:43 2014 UTC (9 years, 9 months ago) by riastradh
Branch: MAIN
CVS Tags: tls-maxphys-base, tls-earlyentropy-base, nick-nhusb-base, netbsd-7-base
Branch point for: nick-nhusb, netbsd-7
Changes since 1.190: +2 -1 lines
Diff to previous 1.190 (colored) to selected 1.67 (colored)

Initialize ubchist earlier.

Revision 1.190 / (download) - annotate - [select for diffs], Thu May 22 14:01:46 2014 UTC (9 years, 10 months ago) by riastradh
Branch: MAIN
Changes since 1.189: +2 -1 lines
Diff to previous 1.189 (colored) to selected 1.67 (colored)

Add uao_set_pgfl to limit a uvm_aobj's pages to a specified freelist.

Brought up on tech-kern:

https://mail-index.netbsd.org/tech-kern/2014/05/20/msg017095.html

Revision 1.189 / (download) - annotate - [select for diffs], Fri Feb 21 22:08:07 2014 UTC (10 years, 1 month ago) by skrll
Branch: MAIN
CVS Tags: yamt-pagecache-base9, rmind-smpnet-nbase, rmind-smpnet-base, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3
Branch point for: tls-earlyentropy
Changes since 1.188: +1 -2 lines
Diff to previous 1.188 (colored) to selected 1.67 (colored)

Remove unnecessary  struct simplelock forward declaration.

Revision 1.188 / (download) - annotate - [select for diffs], Fri Jan 3 21:12:18 2014 UTC (10 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.187: +3 -4 lines
Diff to previous 1.187 (colored) to selected 1.67 (colored)

There is no need for uvm_coredump_walkmap() to explicity pass the proc_t
  pointer to the calller's function.
If the code needs the process its address can be placed in the caller's
  cookie.

Revision 1.187 / (download) - annotate - [select for diffs], Fri Jan 3 15:15:02 2014 UTC (10 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.186: +4 -5 lines
Diff to previous 1.186 (colored) to selected 1.67 (colored)

Minor changes to the process coredump code.
- Add some extra comments.
- Add some XXX comments because the process state might not be stable,
- Add uvm_coredump_count_segs() to simplify the calling code.
- uvm code now only returns non-empty sections/segments.
- Put the 'iocookie' into the 'cookie' block passed to uvm_coredump_walkmap()
  instead of passing it through as an additional parameter.
amd64 can still generate core dumps that gdb can read.

Revision 1.186 / (download) - annotate - [select for diffs], Wed Jan 1 18:57:16 2014 UTC (10 years, 3 months ago) by dsl
Branch: MAIN
Changes since 1.185: +4 -3 lines
Diff to previous 1.185 (colored) to selected 1.67 (colored)

Change the type of the 'cookie' that holds the state of the core dump file
from 'void *' to the actual type 'struct coredump_iostate *'.
In most of the code the contents of the structure are still unknown.
This just stops the wrong type of pointer being passed to the 'void *'
parameter.
I hope I've found everything, amd64 GENERIC and i386 GENERIC & ALL compile.

Revision 1.185 / (download) - annotate - [select for diffs], Thu Nov 14 12:07:11 2013 UTC (10 years, 5 months ago) by martin
Branch: MAIN
Changes since 1.184: +5 -5 lines
Diff to previous 1.184 (colored) to selected 1.67 (colored)

As discussed on tech-kern: make TOPDOWN-VM runtime selectable per process
(offer MD code or emulations to override it).

Revision 1.184 / (download) - annotate - [select for diffs], Sat Sep 1 00:26:37 2012 UTC (11 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base8, yamt-pagecache-base7, yamt-pagecache-base6, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, khorben-n900, agc-symver-base, agc-symver
Branch point for: tls-maxphys, rmind-smpnet
Changes since 1.183: +2 -2 lines
Diff to previous 1.183 (colored) to selected 1.67 (colored)

Add a __HAVE_CPU_UAREA_IDLELWP hook so that the MD code can allocate
special UAREAs for idle lwp's.

Revision 1.183 / (download) - annotate - [select for diffs], Sun Apr 8 11:27:45 2012 UTC (12 years ago) by martin
Branch: MAIN
CVS Tags: yamt-pagecache-base5, yamt-pagecache-base4, jmcneill-usbmp-base9, jmcneill-usbmp-base10
Changes since 1.182: +2 -1 lines
Diff to previous 1.182 (colored) to selected 1.67 (colored)

Rework posix_spawn locking and memory management:
 - always provide a vmspace for the new proc, initially borrowing from proc0
   (this part fixes PR 46286)
 - increase parallelism between parent and child if arguments allow this,
   avoiding a potential deadlock on exec_lock
 - add a new flag for userland to request old (lockstepped) behaviour for
   better error reporting
 - adapt test cases to the previous two and add a new variant to test the
   diagnostics flag
 - fix a few memory (and lock) leaks
 - provide netbsd32 compat

Revision 1.182 / (download) - annotate - [select for diffs], Sun Mar 18 13:31:14 2012 UTC (12 years, 1 month ago) by uebayasi
Branch: MAIN
CVS Tags: jmcneill-usbmp-base8
Changes since 1.181: +1 -11 lines
Diff to previous 1.181 (colored) to selected 1.67 (colored)

Move base type definitions from uvm_extern.h to uvm_param.h so that
other sources can easily include part of UVM headers without the whole
uvm_extern.h (e.g. sys/vnode.h wants only uvm_object.h).

Revision 1.181 / (download) - annotate - [select for diffs], Thu Feb 2 18:59:45 2012 UTC (12 years, 2 months ago) by para
Branch: MAIN
CVS Tags: netbsd-6-base, jmcneill-usbmp-base7, jmcneill-usbmp-base6, jmcneill-usbmp-base5, jmcneill-usbmp-base4, jmcneill-usbmp-base3, jmcneill-usbmp-base2
Branch point for: netbsd-6
Changes since 1.180: +3 -2 lines
Diff to previous 1.180 (colored) to selected 1.67 (colored)

- bringing kmeminit_nkmempages back and revert pmaps that called this early
- use nkmempages to scale the kmem_arena
- reducing diff to pre kmem/vmem change
   (NKMEMPAGES_MAX_DEFAULT will need adjusting on some archs)

Revision 1.180 / (download) - annotate - [select for diffs], Fri Jan 27 19:48:41 2012 UTC (12 years, 2 months ago) by para
Branch: MAIN
Changes since 1.179: +13 -29 lines
Diff to previous 1.179 (colored) to selected 1.67 (colored)

extending vmem(9) to be able to allocated resources for it's own needs.
simplifying uvm_map handling (no special kernel entries anymore no relocking)
make malloc(9) a thin wrapper around kmem(9)
(with private interface for interrupt safety reasons)

releng@ acknowledged

Revision 1.179 / (download) - annotate - [select for diffs], Thu Jan 5 15:19:53 2012 UTC (12 years, 3 months ago) by reinoud
Branch: MAIN
Changes since 1.178: +1 -6 lines
Diff to previous 1.178 (colored) to selected 1.67 (colored)

Revert MAP_NOSYSCALLS patch.

Revision 1.178 / (download) - annotate - [select for diffs], Thu Dec 22 13:12:50 2011 UTC (12 years, 3 months ago) by reinoud
Branch: MAIN
Changes since 1.177: +2 -2 lines
Diff to previous 1.177 (colored) to selected 1.67 (colored)

Redo uvm_map_setattr() to never fail and remove the possible panic. The
possibility of failure was a C&P error.

Revision 1.177 / (download) - annotate - [select for diffs], Tue Dec 20 15:39:35 2011 UTC (12 years, 3 months ago) by reinoud
Branch: MAIN
Changes since 1.176: +6 -1 lines
Diff to previous 1.176 (colored) to selected 1.67 (colored)

Add a MAP_NOSYSCALLS flag to mmap. This flag prohibits executing of system
calls from the mapped region. This can be used for emulation perposed or for
extra security in the case of generated code.

Its implemented by adding mapping-attributes to each uvm_map_entry. These can
then be queried when needed.

Currently the MAP_NOSYSCALLS is only implemented for x86 but other
architectures are easy to adapt; see the sys/arch/x86/x86/syscall.c patch.
Port maintainers are encouraged to add them for their processor ports too.
When this feature is not yet implemented for an architecture the
MAP_NOSYSCALLS is simply ignored with virtually no cpu cost..

Revision 1.176 / (download) - annotate - [select for diffs], Thu Sep 1 06:40:28 2011 UTC (12 years, 7 months ago) by matt
Branch: MAIN
CVS Tags: yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, jmcneill-usbmp-pre-base2, jmcneill-usbmp-base, jmcneill-audiomp3-base, jmcneill-audiomp3
Branch point for: yamt-pagecache, jmcneill-usbmp
Changes since 1.175: +2 -1 lines
Diff to previous 1.175 (colored) to selected 1.67 (colored)

Forward some UVM from matt-nb5-mips64.  Add UVM_KMF_COLORMATCH flag.
When uvm_map gets passed UVM_FLAG_COLORMATCH, the align argument contains
the color of the starting address to be allocated (0..colormask).
When uvm_km_alloc is passed UVM_KMF_COLORMATCH (which can only be used with
UVM_KMF_VAONLY), the align argument contain the color of the starting address
to be allocated.
Change uvm_pagermapin to use this.  When mapping user pages in the kernel,
if colormatch is used with the color of the starting user page then the kernel
mapping will be congruent with the existing user mappings.

Revision 1.175 / (download) - annotate - [select for diffs], Sat Aug 27 09:11:53 2011 UTC (12 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.174: +3 -2 lines
Diff to previous 1.174 (colored) to selected 1.67 (colored)

Add an optional pglist argument to uvm_obj_wirepages, to be
filled with the list of pages that were wired.

Revision 1.174 / (download) - annotate - [select for diffs], Thu Jun 16 09:21:03 2011 UTC (12 years, 10 months ago) by hannken
Branch: MAIN
Changes since 1.173: +2 -2 lines
Diff to previous 1.173 (colored) to selected 1.67 (colored)

Rename uvm_vnp_zerorange(struct vnode *, off_t, size_t) to
ubc_zerorange(struct uvm_object *, off_t, size_t, int) changing
the first argument to an uvm_object and adding a flags argument.

Modify tmpfs_reg_resize() to zero the backing store (aobj) instead
of the vnode.  Ubc_purge() no longer panics when unmounting tmpfs.

Keep uvm_vnp_zerorange() until the next kernel version bump.

Revision 1.173 / (download) - annotate - [select for diffs], Sun Jun 12 03:36:02 2011 UTC (12 years, 10 months ago) by rmind
Branch: MAIN
Changes since 1.172: +9 -6 lines
Diff to previous 1.172 (colored) to selected 1.67 (colored)

Welcome to 5.99.53!  Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.

Revision 1.172 / (download) - annotate - [select for diffs], Sat Apr 23 18:14:12 2011 UTC (12 years, 11 months ago) by rmind
Branch: MAIN
CVS Tags: rmind-uvmplock-nbase, rmind-uvmplock-base, cherry-xenmp-base
Branch point for: cherry-xenmp
Changes since 1.171: +2 -2 lines
Diff to previous 1.171 (colored) to selected 1.67 (colored)

Replace "malloc" in comments, remove unnecessary header inclusions.

Revision 1.171 / (download) - annotate - [select for diffs], Thu Feb 17 19:27:13 2011 UTC (13 years, 2 months ago) by matt
Branch: MAIN
CVS Tags: bouyer-quota2-nbase
Changes since 1.170: +3 -1 lines
Diff to previous 1.170 (colored) to selected 1.67 (colored)

Add support for cpu-specific uarea allocation routines.  Allows different
allocation for user and system lwps.  MIPS will use this to map uareas of
system lwp used direct-mapped addresses (to reduce the overhead of
switching to kernel threads).  ibm4xx could use to map uareas via direct
mapped addresses and avoid the problem of having the kernel stack not in
the TLB.

Revision 1.170 / (download) - annotate - [select for diffs], Thu Feb 10 14:46:44 2011 UTC (13 years, 2 months ago) by pooka
Branch: MAIN
CVS Tags: uebayasi-xip-base7, bouyer-quota2-base
Changes since 1.169: +2 -2 lines
Diff to previous 1.169 (colored) to selected 1.67 (colored)

Make vmapbuf() return success/error and make physio deal with a
failure.

Revision 1.169 / (download) - annotate - [select for diffs], Wed Feb 2 15:13:34 2011 UTC (13 years, 2 months ago) by chuck
Branch: MAIN
Changes since 1.168: +1 -8 lines
Diff to previous 1.168 (colored) to selected 1.67 (colored)

udpate license clauses on my code to match the new-style BSD licenses.
based on diff that rmind@ sent me.

no functional change with this commit.

Revision 1.168 / (download) - annotate - [select for diffs], Tue Jan 4 08:26:33 2011 UTC (13 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: jruoho-x86intr-base
Branch point for: jruoho-x86intr, bouyer-quota2
Changes since 1.167: +4 -1 lines
Diff to previous 1.167 (colored) to selected 1.67 (colored)

Add better color matching selecting free pages.  KM pages will now allocated
so that VA and PA have the same color.  On a page fault, choose a physical
page that has the same color as the virtual address.

When allocating kernel memory pages, allow the MD to specify a preferred
VM_FREELIST from which to choose pages.  For machines with large amounts
of memory (> 4GB), all kernel memory to come from <4GB to reduce the amount
of bounce buffering needed with 32bit DMA devices.

Revision 1.167 / (download) - annotate - [select for diffs], Mon Dec 20 00:25:47 2010 UTC (13 years, 3 months ago) by matt
Branch: MAIN
CVS Tags: matt-mips64-premerge-20101231
Changes since 1.166: +7 -7 lines
Diff to previous 1.166 (colored) to selected 1.67 (colored)

Move counting of faults, traps, intrs, soft[intr]s, syscalls, and nswtch
from uvmexp to per-cpu cpu_data and move them to 64bits.  Remove unneeded
includes of <uvm/uvm_extern.h> and/or <uvm/uvm.h>.

Revision 1.166 / (download) - annotate - [select for diffs], Sat Nov 13 05:52:55 2010 UTC (13 years, 5 months ago) by uebayasi
Branch: MAIN
CVS Tags: uebayasi-xip-base6
Changes since 1.165: +0 -1 lines
Diff to previous 1.165 (colored) to selected 1.67 (colored)

Hide uvm/uvm_page.h again to ensure its internal structures are MD.

GENERIC or at least one kernel compile tested for:
	acorn26, acorn32, algor, all, alpha, amd64, amiga, amigappc,
	arc, bebox, bighill, cats, cobalt, dreamcast, ews4800mips,
	hp300, hp700, hpcarm, hpcmips, hpcsh, i386, ibmnws,
	integrator, ixm1200, iyonix, landisk, luna68k, mac68k,
	macppc, mipsco, mmeye, mvme68k, mvmeppc, netwinder, news68k,
	newsmips, next68k, obs266a, ofppc, pmax, pmppc, prep,
	rs6000, sandpoint, sbmips, shark, sidebeach, sparc, sparc64,
	sun2, sun3, usermode, vax, x68k, zaurus

Revision 1.165 / (download) - annotate - [select for diffs], Fri Nov 12 12:02:35 2010 UTC (13 years, 5 months ago) by uebayasi
Branch: MAIN
Changes since 1.164: +1 -0 lines
Diff to previous 1.164 (colored) to selected 1.67 (colored)

Put back uvm_page.h for now.  Sorry for mess.

Revision 1.164 / (download) - annotate - [select for diffs], Fri Nov 12 02:36:02 2010 UTC (13 years, 5 months ago) by uebayasi
Branch: MAIN
Changes since 1.163: +1 -2 lines
Diff to previous 1.163 (colored) to selected 1.67 (colored)

Abstraction fix; don't pull in physical segment/page definitions
in UVM external API, uvm_extern.h.  Because most users care only
virtual memory.

Device drivers use bus_dma(9) to manage physical memory.  Device
drivers pull in bus_dma(9) API, bus_dma.h.  bus_dma(9) implementations
pull in UVM internal API, uvm.h.

Tested By:	Compiling i386 ALL kernel

Revision 1.163 / (download) - annotate - [select for diffs], Fri Apr 16 03:21:49 2010 UTC (14 years ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base11, yamt-nfs-mp-base10, uebayasi-xip-base5, uebayasi-xip-base4, uebayasi-xip-base3, uebayasi-xip-base2, uebayasi-xip-base1
Changes since 1.162: +1 -2 lines
Diff to previous 1.162 (colored) to selected 1.67 (colored)

- Merge sched_pstats() and uvm_meter()/uvm_loadav().  Avoids double loop
  through all LWPs and duplicate locking overhead.

- Move sched_pstats() from soft-interrupt context to process 0 main loop.
  Avoids blocking effect on real-time threads.  Mostly fixes PR/38792.

Note: it might be worth to move the loop above PRI_PGDAEMON.  Also,
sched_pstats() might be cleaned-up slightly.

Revision 1.162 / (download) - annotate - [select for diffs], Mon Feb 8 19:02:33 2010 UTC (14 years, 2 months ago) by joerg
Branch: MAIN
CVS Tags: yamt-nfs-mp-base9
Branch point for: rmind-uvmplock
Changes since 1.161: +1 -2 lines
Diff to previous 1.161 (colored) to selected 1.67 (colored)

Remove separate mb_map. The nmbclusters is computed at boot time based
on the amount of physical memory and limited by NMBCLUSTERS if present.
Architectures without direct mapping also limit it based on the kmem_map
size, which is used as backing store. On i386 and ARM, the maximum KVA
used for mbuf clusters is limited to 64MB by default.

The old default limits and limits based on GATEWAY have been removed.
key_registered_sb_max is hard-wired to a value derived from 2048
clusters.

Revision 1.161 / (download) - annotate - [select for diffs], Sat Nov 21 17:45:02 2009 UTC (14 years, 4 months ago) by rmind
Branch: MAIN
CVS Tags: uebayasi-xip-base, matt-premerge-20091211
Branch point for: uebayasi-xip
Changes since 1.160: +3 -1 lines
Diff to previous 1.160 (colored) to selected 1.67 (colored)

Add uvm_lwp_getuarea() and uvm_lwp_setuarea().  OK matt@.

Revision 1.160 / (download) - annotate - [select for diffs], Wed Oct 21 21:12:07 2009 UTC (14 years, 5 months ago) by rmind
Branch: MAIN
CVS Tags: jym-xensuspend-nbase
Changes since 1.159: +11 -21 lines
Diff to previous 1.159 (colored) to selected 1.67 (colored)

Remove uarea swap-out functionality:

- Addresses the issue described in PR/38828.
- Some simplification in threading and sleepq subsystems.
- Eliminates pmap_collect() and, as a side note, allows pmap optimisations.
- Eliminates XS_CTL_DATA_ONSTACK in scsipi code.
- Avoids few scans on LWP list and thus potentially long holds of proc_lock.
- Cuts ~1.5k lines of code.  Reduces amd64 kernel size by ~4k.
- Removes __SWAP_BROKEN cases.

Tested on x86, mips, acorn32 (thanks <mpumford>) and partly tested on
acorn26 (thanks to <bjh21>).

Discussed on <tech-kern>, reviewed by <ad>.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Aug 18 02:43:49 2009 UTC (14 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base8, yamt-nfs-mp-base7
Changes since 1.158: +4 -4 lines
Diff to previous 1.158 (colored) to selected 1.67 (colored)

whitespace fixes.  no functional changes.

Revision 1.158 / (download) - annotate - [select for diffs], Mon Aug 10 23:17:29 2009 UTC (14 years, 8 months ago) by haad
Branch: MAIN
Changes since 1.157: +14 -1 lines
Diff to previous 1.157 (colored) to selected 1.67 (colored)

Add uvm_reclaim_hooks support for reclaiming kernel KVA space and memory.
This is used only by zfs where uvm_reclaim hook is added from arc cache.

Oked ad@.

Revision 1.157 / (download) - annotate - [select for diffs], Wed Aug 5 14:11:32 2009 UTC (14 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.156: +1 -2 lines
Diff to previous 1.156 (colored) to selected 1.67 (colored)

kill uvm_aio_biodone1().  only user was lfs and that uses nestiobuf now.

Revision 1.156 / (download) - annotate - [select for diffs], Wed Aug 5 14:10:33 2009 UTC (14 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.155: +4 -2 lines
Diff to previous 1.155 (colored) to selected 1.67 (colored)

add some advice symbols we'll eventually need

Revision 1.155 / (download) - annotate - [select for diffs], Sun Jun 28 15:18:50 2009 UTC (14 years, 9 months ago) by rmind
Branch: MAIN
CVS Tags: yamt-nfs-mp-base6, jymxensuspend-base
Changes since 1.154: +31 -1 lines
Diff to previous 1.154 (colored) to selected 1.67 (colored)

Ephemeral mapping (emap) implementation.  Concept is based on the idea that
activity of other threads will perform the TLB flush for the processes using
emap as a side effect.  To track that, global and per-CPU generation numbers
are used.  This idea was suggested by Andrew Doran; various improvements to
it by me.  Notes:

- For now, zero-copy on pipe is not yet enabled.
- TCP socket code would likely need more work.
- Additional UVM loaning improvements are needed.

Proposed on <tech-kern>, silence there.
Quickly reviewed by <ad>.

Revision 1.154 / (download) - annotate - [select for diffs], Mon Mar 30 16:36:36 2009 UTC (15 years ago) by yamt
Branch: MAIN
CVS Tags: yamt-nfs-mp-base5, yamt-nfs-mp-base4, yamt-nfs-mp-base3, nick-hppapmap-base4, nick-hppapmap-base3, nick-hppapmap-base, jym-xensuspend-base
Changes since 1.153: +1 -4 lines
Diff to previous 1.153 (colored) to selected 1.67 (colored)

g/c uvm_aiobuf_pool.

Revision 1.153 / (download) - annotate - [select for diffs], Sun Mar 29 01:02:51 2009 UTC (15 years ago) by mrg
Branch: MAIN
Changes since 1.152: +2 -1 lines
Diff to previous 1.152 (colored) to selected 1.67 (colored)

- add new RLIMIT_AS (aka RLIMIT_VMEM) resource that limits the total
address space available to processes.  this limit exists in most other
modern unix variants, and like most of them, our defaults are unlimited.
remove the old mmap / rlimit.datasize hack.

- adds the VMCMD_STACK flag to all the stack-creation vmcmd callers.
it is currently unused, but was added a few years ago.

- add a pair of new process size values to kinfo_proc2{}. one is the
total size of the process memory map, and the other is the total size
adjusted for unused stack space (since most processes have a lot of
this...)

- patch sh, and csh to notice RLIMIT_AS.  (in some cases, the alias
RLIMIT_VMEM was already present and used if availble.)

- patch ps, top and systat to notice the new k_vm_vsize member of
kinfo_proc2{}.

- update irix, svr4, svr4_32, linux and osf1 emulations to support
this information.  (freebsd could be done, but that it's best left
as part of the full-update of compat/freebsd.)


this addresses PR 7897.  it also gives correct memory usage values,
which have never been entirely correct (since mmap), and have been
very incorrect since jemalloc() was enabled.

tested on i386 and sparc64, build tested on several other platforms.

thanks to many folks for feedback and testing but most espcially
chuq and yamt for critical suggestions that lead to this patch not
having a special ugliness i wasn't happy with anyway :-)

Revision 1.152 / (download) - annotate - [select for diffs], Thu Mar 12 12:55:16 2009 UTC (15 years, 1 month ago) by abs
Branch: MAIN
Changes since 1.151: +2 -2 lines
Diff to previous 1.151 (colored) to selected 1.67 (colored)

Clarify free_list usage in uvm_page_physload() regarding faster/slower RAM.
Slower RAM should be assigned a higher free_list id.
No functional change to code, just comments and manpage

Revision 1.151 / (download) - annotate - [select for diffs], Wed Feb 18 13:16:58 2009 UTC (15 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-hppapmap-base2
Changes since 1.150: +1 -3 lines
Diff to previous 1.150 (colored) to selected 1.67 (colored)

make some functions static.

Revision 1.150 / (download) - annotate - [select for diffs], Wed Nov 26 20:17:33 2008 UTC (15 years, 4 months ago) by pooka
Branch: MAIN
CVS Tags: mjf-devfs2-base, haad-nbase2, haad-dm-base2, haad-dm-base, ad-audiomp2-base, ad-audiomp2
Branch point for: jym-xensuspend
Changes since 1.149: +2 -2 lines
Diff to previous 1.149 (colored) to selected 1.67 (colored)

Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Oct 31 20:42:41 2008 UTC (15 years, 5 months ago) by christos
Branch: MAIN
Changes since 1.148: +6 -1 lines
Diff to previous 1.148 (colored) to selected 1.67 (colored)

- allocate 8 pointers on the stack to avoid stack overflow in nfs.
- make that 8 a constant
- remove bogus panic

Revision 1.148 / (download) - annotate - [select for diffs], Fri Aug 8 14:41:50 2008 UTC (15 years, 8 months ago) by skrll
Branch: MAIN
CVS Tags: wrstuden-revivesa-base-4, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, netbsd-5-base, matt-mips64-base2, haad-dm-base1
Branch point for: nick-hppapmap, netbsd-5
Changes since 1.147: +1 -2 lines
Diff to previous 1.147 (colored) to selected 1.67 (colored)

g/c exec_map

Revision 1.147 / (download) - annotate - [select for diffs], Fri Jul 11 07:09:18 2008 UTC (15 years, 9 months ago) by skrll
Branch: MAIN
CVS Tags: simonb-wapbl-nbase, simonb-wapbl-base
Changes since 1.146: +2 -2 lines
Diff to previous 1.146 (colored) to selected 1.67 (colored)

English improvement in comments.

"seems good to me :)" from yamt.

Revision 1.146 / (download) - annotate - [select for diffs], Wed Jun 4 12:45:28 2008 UTC (15 years, 10 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-base4, wrstuden-revivesa-base-1, wrstuden-revivesa-base
Branch point for: simonb-wapbl, haad-dm
Changes since 1.145: +5 -3 lines
Diff to previous 1.145 (colored) to selected 1.67 (colored)

- vm_page: put listq, pageq into a union alongside a LIST_ENTRY, so we can
  use both types of list.

- Make page coloring and idle zero state per-CPU.

- Maintain per-CPU page freelists. When freeing, put pages onto the local
  CPU's lists and the global lists. When allocating, prefer to take pages
  from the local CPU. If none are available take from the global list as
  done now. Proposed on tech-kern@.

Revision 1.145 / (download) - annotate - [select for diffs], Fri Feb 29 20:35:23 2008 UTC (16 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-nfs-mp-base2, yamt-nfs-mp-base, yamt-lazymbuf-base15, yamt-lazymbuf-base14, matt-armv6-nbase, keiichi-mipv6-nbase, keiichi-mipv6-base, hpcarm-cleanup-nbase, ad-socklock-base1
Branch point for: yamt-pf42, yamt-nfs-mp, wrstuden-revivesa
Changes since 1.144: +3 -1 lines
Diff to previous 1.144 (colored) to selected 1.67 (colored)

uvm_swap_io: if pagedaemon, don't wait for iobuf.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Jan 28 12:22:47 2008 UTC (16 years, 2 months ago) by yamt
Branch: MAIN
CVS Tags: nick-net80211-sync-base, nick-net80211-sync, mjf-devfs-base, hpcarm-cleanup-base
Branch point for: mjf-devfs2, keiichi-mipv6
Changes since 1.143: +1 -2 lines
Diff to previous 1.143 (colored) to selected 1.67 (colored)

remove a special allocator for uareas, which is no longer necessary.
use pool_cache instead.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Jan 2 11:49:16 2008 UTC (16 years, 3 months ago) by ad
Branch: MAIN
CVS Tags: matt-armv6-base, bouyer-xeni386-nbase, bouyer-xeni386-base
Changes since 1.142: +3 -1 lines
Diff to previous 1.142 (colored) to selected 1.67 (colored)

Merge vmlocking2 to head.

Revision 1.142 / (download) - annotate - [select for diffs], Wed Dec 26 22:11:53 2007 UTC (16 years, 3 months ago) by christos
Branch: MAIN
Changes since 1.141: +2 -1 lines
Diff to previous 1.141 (colored) to selected 1.67 (colored)

Add PaX ASLR (Address Space Layout Randomization) [from elad and myself]

For regular (non PIE) executables randomization is enabled for:
    1. The data segment
    2. The stack

For PIE executables(*) randomization is enabled for:
    1. The program itself
    2. All shared libraries
    3. The data segment
    4. The stack

(*) To generate a PIE executable:
    - compile everything with -fPIC
    - link with -shared-libgcc -Wl,-pie

This feature is experimental, and might change. To use selectively add
    options PAX_ASLR=0
in your kernel.

Currently we are using 12 bits for the stack, program, and data segment and
16 or 24 bits for mmap, depending on __LP64__.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Dec 24 15:46:46 2007 UTC (16 years, 3 months ago) by perry
Branch: MAIN
CVS Tags: vmlocking2-base3
Changes since 1.140: +2 -2 lines
Diff to previous 1.140 (colored) to selected 1.67 (colored)

Remove __attribute__((__noreturn__)) from things already marked __dead
Found by the department of redundancy department.

Revision 1.140 / (download) - annotate - [select for diffs], Thu Dec 13 02:45:11 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base3
Changes since 1.139: +2 -1 lines
Diff to previous 1.139 (colored) to selected 1.67 (colored)

add ddb "whatis" command.  inspired from solaris ::whatis dcmd.

Revision 1.139 / (download) - annotate - [select for diffs], Wed Dec 5 09:37:34 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-kmem-base2, yamt-kmem-base, vmlocking2-base2, reinoud-bufcleanup-nbase, reinoud-bufcleanup-base, jmcneill-pm-base, cube-autoconf-base, cube-autoconf
Branch point for: yamt-kmem, bouyer-xeni386
Changes since 1.138: +1 -2 lines
Diff to previous 1.138 (colored) to selected 1.67 (colored)

g/c uvm_vnp_sync

Revision 1.138 / (download) - annotate - [select for diffs], Wed Dec 5 09:35:46 2007 UTC (16 years, 4 months ago) by yamt
Branch: MAIN
Changes since 1.137: +10 -10 lines
Diff to previous 1.137 (colored) to selected 1.67 (colored)

fix UBC_WANT_UNMAP.
	- check PMAP_CACHE_VIVT after pulling pmap.h.
	- VTEXT -> VI_TEXT.

Revision 1.137 / (download) - annotate - [select for diffs], Fri Nov 30 22:43:17 2007 UTC (16 years, 4 months ago) by ad
Branch: MAIN
CVS Tags: vmlocking2-base1, vmlocking-nbase
Branch point for: vmlocking2
Changes since 1.136: +4 -4 lines
Diff to previous 1.136 (colored) to selected 1.67 (colored)

Make {anon,file,exec}pages unsigned.

Revision 1.136 / (download) - annotate - [select for diffs], Tue Nov 6 00:42:46 2007 UTC (16 years, 5 months ago) by ad
Branch: MAIN
CVS Tags: jmcneill-base, bouyer-xenamd64-base2, bouyer-xenamd64-base
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored) to selected 1.67 (colored)

Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
  number and type of priority levels into bands. Add new bands like
  'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
  sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.

Revision 1.135 / (download) - annotate - [select for diffs], Sat Aug 18 00:21:11 2007 UTC (16 years, 8 months ago) by ad
Branch: MAIN
CVS Tags: yamt-x86pmap-base4, yamt-x86pmap-base3, yamt-x86pmap-base2, yamt-x86pmap-base, yamt-x86pmap, vmlocking-base, nick-csl-alignment-base5
Branch point for: mjf-devfs, matt-armv6, bouyer-xenamd64
Changes since 1.134: +2 -1 lines
Diff to previous 1.134 (colored) to selected 1.67 (colored)

Make the uarea cache per-CPU and drain in batches of 4.

Revision 1.134 / (download) - annotate - [select for diffs], Fri Jul 27 09:50:37 2007 UTC (16 years, 8 months ago) by yamt
Branch: MAIN
CVS Tags: matt-mips64-base, hpcarm-cleanup
Branch point for: matt-mips64, jmcneill-pm
Changes since 1.133: +2 -2 lines
Diff to previous 1.133 (colored) to selected 1.67 (colored)

ubc_uiomove: add an "advice" argument rather than using UVM_ADV_RANDOM blindly.

Revision 1.133 / (download) - annotate - [select for diffs], Sun Jul 22 19:16:06 2007 UTC (16 years, 8 months ago) by pooka
Branch: MAIN
Changes since 1.132: +1 -2 lines
Diff to previous 1.132 (colored) to selected 1.67 (colored)

Retire uvn_attach() - it abuses VXLOCK and its functionality,
setting vnode sizes, is handled elsewhere: file system vnode creation
or spec_open() for regular files or block special files, respectively.

Add a call to VOP_MMAP() to the pagedvn exec path, since the vnode
is being memory mapped.

reviewed by tech-kern & wrstuden

Revision 1.132 / (download) - annotate - [select for diffs], Tue Jul 17 17:42:08 2007 UTC (16 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: nick-csl-alignment-base
Branch point for: nick-csl-alignment
Changes since 1.131: +1 -2 lines
Diff to previous 1.131 (colored) to selected 1.67 (colored)

Add native mremap system call based on the UVM implementation for
Linux compat. Add code to enforce alignment of the new location.
Special thanks to wizd for helping with the man page.

Revision 1.131 / (download) - annotate - [select for diffs], Mon Jul 9 21:11:36 2007 UTC (16 years, 9 months ago) by ad
Branch: MAIN
CVS Tags: mjf-ufs-trans-base
Changes since 1.130: +3 -1 lines
Diff to previous 1.130 (colored) to selected 1.67 (colored)

Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements

Revision 1.130 / (download) - annotate - [select for diffs], Tue Jun 5 12:31:35 2007 UTC (16 years, 10 months ago) by yamt
Branch: MAIN
Changes since 1.129: +13 -5 lines
Diff to previous 1.129 (colored) to selected 1.67 (colored)

improve post-ubc file overwrite performance in common cases.
ie. when it's safe, actually overwrite blocks rather than doing
read-modify-write.

also fixes PR/33152 and PR/36303.

Revision 1.129 / (download) - annotate - [select for diffs], Sat Mar 24 21:15:39 2007 UTC (17 years ago) by rmind
Branch: MAIN
CVS Tags: yamt-idlelwp-base8, thorpej-atomic-base, thorpej-atomic
Changes since 1.128: +2 -1 lines
Diff to previous 1.128 (colored) to selected 1.67 (colored)

Export uvm_uarea_free() to the rest.
Make things compile again.

Revision 1.128 / (download) - annotate - [select for diffs], Sun Mar 4 06:03:48 2007 UTC (17 years, 1 month ago) by christos
Branch: MAIN
Branch point for: vmlocking, reinoud-bufcleanup, mjf-ufs-trans
Changes since 1.127: +8 -8 lines
Diff to previous 1.127 (colored) to selected 1.67 (colored)

Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.

Revision 1.127 / (download) - annotate - [select for diffs], Thu Feb 22 06:05:00 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
CVS Tags: ad-audiomp-base, ad-audiomp
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored) to selected 1.67 (colored)

TRUE -> true, FALSE -> false

Revision 1.126 / (download) - annotate - [select for diffs], Wed Feb 21 23:00:12 2007 UTC (17 years, 1 month ago) by thorpej
Branch: MAIN
Changes since 1.125: +14 -14 lines
Diff to previous 1.125 (colored) to selected 1.67 (colored)

Replace the Mach-derived boolean_t type with the C99 bool type.  A
future commit will replace use of TRUE and FALSE with true and false.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Feb 15 20:21:13 2007 UTC (17 years, 2 months ago) by ad
Branch: MAIN
Branch point for: yamt-idlelwp
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored) to selected 1.67 (colored)

Add uvm_kick_scheduler() (MP safe) to replace wakeup(&proc0).

Revision 1.124 / (download) - annotate - [select for diffs], Thu Dec 21 15:55:26 2006 UTC (17 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: post-newlock2-merge, newlock2-nbase, newlock2-base
Changes since 1.123: +3 -2 lines
Diff to previous 1.123 (colored) to selected 1.67 (colored)

merge yamt-splraiseipl branch.

	- finish implementing splraiseipl (and makeiplcookie).
	  http://mail-index.NetBSD.org/tech-kern/2006/07/01/0000.html
	- complete workqueue(9) and fix its ipl problem, which is reported
	  to cause audio skipping.
	- fix netbt (at least compilation problems) for some ports.
	- fix PR/33218.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Dec 7 14:06:51 2006 UTC (17 years, 4 months ago) by elad
Branch: MAIN
CVS Tags: yamt-splraiseipl-base5, yamt-splraiseipl-base4, yamt-splraiseipl-base3
Changes since 1.122: +1 -2 lines
Diff to previous 1.122 (colored) to selected 1.67 (colored)

Back out uvm_is_swap_device().

Revision 1.122 / (download) - annotate - [select for diffs], Fri Dec 1 16:06:09 2006 UTC (17 years, 4 months ago) by elad
Branch: MAIN
CVS Tags: netbsd-4-base
Branch point for: netbsd-4
Changes since 1.121: +2 -1 lines
Diff to previous 1.121 (colored) to selected 1.67 (colored)

Introduce uvm_is_swap_device(), to check if the passed struct vnode * is
used as a swap device or not.

Okay mrg@.

Revision 1.121 / (download) - annotate - [select for diffs], Thu Oct 12 10:14:20 2006 UTC (17 years, 6 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base2
Changes since 1.120: +3 -0 lines
Diff to previous 1.120 (colored) to selected 1.67 (colored)

move some knowledge about vnode into uvm_vnode.c.

Revision 1.120 / (download) - annotate - [select for diffs], Thu Oct 12 10:11:57 2006 UTC (17 years, 6 months ago) by yamt
Branch: MAIN
Changes since 1.119: +7 -1 lines
Diff to previous 1.119 (colored) to selected 1.67 (colored)

uobj_wirepages and uobj_unwirepages from Mindaugas.  PR/34771.
(commented out in files.uvm for now because there is no user in tree.)

http://mail-index.netbsd.org/tech-kern/2006/09/24/0000.html
http://mail-index.netbsd.org/tech-kern/2006/10/10/0000.html

Revision 1.119 / (download) - annotate - [select for diffs], Thu Oct 5 14:48:33 2006 UTC (17 years, 6 months ago) by chs
Branch: MAIN
Changes since 1.118: +3 -3 lines
Diff to previous 1.118 (colored) to selected 1.67 (colored)

add support for O_DIRECT (I/O directly to application memory,
bypassing any kernel caching for file data).

Revision 1.118 / (download) - annotate - [select for diffs], Fri Sep 15 15:51:13 2006 UTC (17 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-splraiseipl-base
Branch point for: yamt-splraiseipl
Changes since 1.117: +11 -20 lines
Diff to previous 1.117 (colored) to selected 1.67 (colored)

merge yamt-pdpolicy branch.
	- separate page replacement policy from the rest of kernel
	- implement an alternative replacement policy

Revision 1.117 / (download) - annotate - [select for diffs], Fri Sep 1 20:39:05 2006 UTC (17 years, 7 months ago) by cherry
Branch: MAIN
CVS Tags: yamt-pdpolicy-base9, yamt-pdpolicy-base8, rpaulo-netinet-merge-pcb-base
Branch point for: newlock2
Changes since 1.116: +2 -1 lines
Diff to previous 1.116 (colored) to selected 1.67 (colored)

bumps kernel aobj to 64 bit. \
See: http://mail-index.netbsd.org/tech-kern/2006/03/07/0007.html

Revision 1.116 / (download) - annotate - [select for diffs], Fri Aug 4 22:42:36 2006 UTC (17 years, 8 months ago) by he
Branch: MAIN
CVS Tags: yamt-pdpolicy-base7, abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.115: +2 -2 lines
Diff to previous 1.115 (colored) to selected 1.67 (colored)

Rearrange included headers and/or add include of <sys/types.h> and
<sys/lock.h>, so that the mipsco port can build again, ref.
  http://mail-index.netbsd.org/port-mips/2006/08/04/0000.html
Reviewed by thorpej

Revision 1.115 / (download) - annotate - [select for diffs], Wed Jul 5 14:26:42 2006 UTC (17 years, 9 months ago) by drochner
Branch: MAIN
Changes since 1.114: +2 -1 lines
Diff to previous 1.114 (colored) to selected 1.67 (colored)

Introduce a UVM_KMF_EXEC flag for uvm_km_alloc() which enforces an
executable mapping. Up to now, only R+W was requested from pmap_kenter_pa.
On most CPUs, we get an executable mapping anyway, due to lack of
hardware support or due to lazyness in the pmap implementation. Only
alpha does obey VM_PROT_EXECUTE, afaics.

Revision 1.114 / (download) - annotate - [select for diffs], Fri May 19 15:08:14 2006 UTC (17 years, 11 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base6, yamt-pdpolicy-base5, simonb-timecounters-base, gdamore-uart-base, chap-midi-nbase, chap-midi-base
Branch point for: gdamore-uart, chap-midi
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored) to selected 1.67 (colored)

UVM_MAPFLAG: add missing parens.

Revision 1.113 / (download) - annotate - [select for diffs], Sun May 14 21:38:17 2006 UTC (17 years, 11 months ago) by elad
Branch: MAIN
Changes since 1.112: +1 -2 lines
Diff to previous 1.112 (colored) to selected 1.67 (colored)

integrate kauth.

Revision 1.112 / (download) - annotate - [select for diffs], Wed Mar 15 18:09:25 2006 UTC (18 years, 1 month ago) by drochner
Branch: MAIN
CVS Tags: yamt-pdpolicy-base4, yamt-pdpolicy-base3, peter-altq-base, elad-kernelauth-base
Branch point for: peter-altq
Changes since 1.111: +4 -6 lines
Diff to previous 1.111 (colored) to selected 1.67 (colored)

-clean up the interface to uvm_fault: the "fault type" didn't serve
 any purpose (done by a macro, so we don't save any cycles for now)
-kill vm_fault_t; it is not needed for real faults, and for simulated
 faults (wiring) it can be replaced by UVM internal flags
-remove <uvm/uvm_fault.h> from uvm_extern.h again

Revision 1.111 / (download) - annotate - [select for diffs], Wed Mar 1 12:38:44 2006 UTC (18 years, 1 month ago) by yamt
Branch: MAIN
CVS Tags: yamt-pdpolicy-base2, yamt-pdpolicy-base
Branch point for: yamt-pdpolicy, elad-kernelauth
Changes since 1.110: +3 -1 lines
Diff to previous 1.110 (colored) to selected 1.67 (colored)

merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.

Revision 1.110 / (download) - annotate - [select for diffs], Fri Feb 10 00:53:04 2006 UTC (18 years, 2 months ago) by simonb
Branch: MAIN
CVS Tags: yamt-uio_vmspace-base5
Changes since 1.109: +4 -4 lines
Diff to previous 1.109 (colored) to selected 1.67 (colored)

Make a note that some counters should be 64-bit as they wrap far to
quickly.

Revision 1.109 / (download) - annotate - [select for diffs], Sat Jan 21 13:34:15 2006 UTC (18 years, 2 months ago) by yamt
Branch: MAIN
Branch point for: simonb-timecounters, rpaulo-netinet-merge-pcb
Changes since 1.108: +7 -1 lines
Diff to previous 1.108 (colored) to selected 1.67 (colored)

implement compat_linux mremap.

Revision 1.108 / (download) - annotate - [select for diffs], Wed Dec 21 12:19:04 2005 UTC (18 years, 3 months ago) by yamt
Branch: MAIN
Branch point for: yamt-uio_vmspace
Changes since 1.107: +17 -4 lines
Diff to previous 1.107 (colored) to selected 1.67 (colored)

make length of inactive queue tunable by sysctl.  (vm.inactivepct)

Revision 1.107 / (download) - annotate - [select for diffs], Tue Nov 29 22:52:03 2005 UTC (18 years, 4 months ago) by yamt
Branch: MAIN
CVS Tags: ktrace-lwp-base
Changes since 1.106: +4 -3 lines
Diff to previous 1.106 (colored) to selected 1.67 (colored)

merge yamt-readahead branch.

Revision 1.106 / (download) - annotate - [select for diffs], Thu Sep 1 02:21:12 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-vop-base3, yamt-vop-base2, yamt-vop-base, yamt-vop, yamt-readahead-base3, yamt-readahead-base2, yamt-readahead-base, thorpej-vnode-attr-base, thorpej-vnode-attr
Branch point for: yamt-readahead
Changes since 1.105: +1 -2 lines
Diff to previous 1.105 (colored) to selected 1.67 (colored)

remove one of duplicated forward decl. of vmspace.  pointed by Dheeraj S.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Sep 1 02:16:46 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.104: +2 -1 lines
Diff to previous 1.104 (colored) to selected 1.67 (colored)

put back uvm_fault.h for now as it's needed for some ports.

Revision 1.104 / (download) - annotate - [select for diffs], Sat Aug 27 16:11:32 2005 UTC (18 years, 7 months ago) by yamt
Branch: MAIN
Changes since 1.103: +1 -2 lines
Diff to previous 1.103 (colored) to selected 1.67 (colored)

don't include uvm_fault.h unnecessarily.

Revision 1.103 / (download) - annotate - [select for diffs], Fri Jun 10 05:10:13 2005 UTC (18 years, 10 months ago) by matt
Branch: MAIN
Branch point for: yamt-lazymbuf
Changes since 1.102: +3 -4 lines
Diff to previous 1.102 (colored) to selected 1.67 (colored)

Rework the coredump code to have no explicit knownledge of how coredump
i/o is done.  Instead, pass an opaque cookie which is then passed to a
new routine, coredump_write, which does the actual i/o.  This allows the
method of doing i/o to change without affecting any future MD code.
Also, make netbsd32_core.c [re]use core_netbsd.c (in a similar manner that
core_elf64.c uses core_elf32.c) and eliminate that code duplication.
cpu_coredump{,32} is now called twice, first with a NULL iocookie to fill
the core structure and a second to actually write md parts of the coredump.
All i/o is nolonger random access and is suitable for shipping over a stream.

Revision 1.102 / (download) - annotate - [select for diffs], Thu Jun 2 17:01:44 2005 UTC (18 years, 10 months ago) by matt
Branch: MAIN
Changes since 1.101: +3 -3 lines
Diff to previous 1.101 (colored) to selected 1.67 (colored)

When writing coredumps, don't write zero uninstantiated demand-zero pages.
Also, with ELF core dumps, trim trailing zeroes from sections.  These two
changes can shrink coredumps by over 50% in size.

Revision 1.101 / (download) - annotate - [select for diffs], Sun May 15 08:01:06 2005 UTC (18 years, 11 months ago) by yamt
Branch: MAIN
Changes since 1.100: +7 -7 lines
Diff to previous 1.100 (colored) to selected 1.67 (colored)

remove anon related statistics which are no longer used.

Revision 1.100 / (download) - annotate - [select for diffs], Fri Apr 1 11:59:38 2005 UTC (19 years ago) by yamt
Branch: MAIN
CVS Tags: kent-audio2-base
Changes since 1.99: +18 -63 lines
Diff to previous 1.99 (colored) to selected 1.67 (colored)

merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.

Revision 1.99 / (download) - annotate - [select for diffs], Sat Mar 26 05:12:36 2005 UTC (19 years ago) by fvdl
Branch: MAIN
CVS Tags: yamt-km-base4
Changes since 1.98: +2 -1 lines
Diff to previous 1.98 (colored) to selected 1.67 (colored)

Fix some things regarding COMPAT_NETBSD32 and limits/VM addresses.

* For sparc64 and amd64, define *SIZ32 VM constants.
* Add a new function pointer to struct emul, pointing at a function
  that will return the default VM map address. The default function
  is uvm_map_defaultaddr, which just uses the VM_DEFAULT_ADDRESS
  macro. This gives emulations control over the default map address,
  and allows things to be mapped at the right address (in 32bit range)
  for COMPAT_NETBSD32.
* Add code to adjust the data and stack limits when a COMPAT_NETBSD32
  or COMPAT_SVR4_32 binary is executed.
* Don't use USRSTACK in kern_resource.c, use p_vmspace->vm_minsaddr
  instead (emulations might have set it differently)
* Since this changes struct emul, bump kernel version to 3.99.2

Tested on amd64, compile-tested on sparc64.

Revision 1.98 / (download) - annotate - [select for diffs], Thu Jan 13 11:50:32 2005 UTC (19 years, 3 months ago) by yamt
Branch: MAIN
CVS Tags: yamt-km-base3, yamt-km-base2, yamt-km-base, netbsd-3-base
Branch point for: yamt-km, netbsd-3, kent-audio2
Changes since 1.97: +4 -3 lines
Diff to previous 1.97 (colored) to selected 1.67 (colored)

in uvm_unmap_remove, always wakeup va waiters if any.
uvm_km_free_wakeup is now a synonym of uvm_km_free.

Revision 1.97 / (download) - annotate - [select for diffs], Sun Jan 9 16:42:44 2005 UTC (19 years, 3 months ago) by chs
Branch: MAIN
CVS Tags: kent-audio1-beforemerge
Changes since 1.96: +23 -17 lines
Diff to previous 1.96 (colored) to selected 1.67 (colored)

adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway.  there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.

Revision 1.96 / (download) - annotate - [select for diffs], Sat Jan 1 21:08:02 2005 UTC (19 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.95: +6 -1 lines
Diff to previous 1.95 (colored) to selected 1.67 (colored)

in the case of !PMAP_MAP_POOLPAGE, gather pool backend allocations to
large chunks for kernel_map and kmem_map to ease kva fragmentation.

Revision 1.95 / (download) - annotate - [select for diffs], Sat Jan 1 21:02:13 2005 UTC (19 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.94: +2 -2 lines
Diff to previous 1.94 (colored) to selected 1.67 (colored)

introduce vm_map_kernel, a subclass of vm_map, and
move some kernel-only members of vm_map to it.

Revision 1.94 / (download) - annotate - [select for diffs], Sat Jan 1 21:00:06 2005 UTC (19 years, 3 months ago) by yamt
Branch: MAIN
Changes since 1.93: +2 -1 lines
Diff to previous 1.93 (colored) to selected 1.67 (colored)

for in-kernel maps,
- allocate kva for vm_map_entry from the map itsself and
  remove the static limit, MAX_KMAPENT.
- keep merged entries for later splitting to fix allocate-to-free problem.
  PR/24039.

Revision 1.93 / (download) - annotate - [select for diffs], Sat Aug 28 22:12:40 2004 UTC (19 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: kent-audio1-base, kent-audio1
Changes since 1.92: +1 -2 lines
Diff to previous 1.92 (colored) to selected 1.67 (colored)

Garbage-collect pagemove(); nothing use it anymore (YAY!!!)

Revision 1.92 / (download) - annotate - [select for diffs], Tue May 4 21:33:40 2004 UTC (19 years, 11 months ago) by pk
Branch: MAIN
Changes since 1.91: +3 -2 lines
Diff to previous 1.91 (colored) to selected 1.67 (colored)

Since a `vmspace' always includes a `vm_map' we can re-use vm_map's
reference count lock to also protect the vmspace's reference count.

Revision 1.91 / (download) - annotate - [select for diffs], Wed Mar 24 07:55:01 2004 UTC (20 years ago) by junyoung
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.90: +105 -110 lines
Diff to previous 1.90 (colored) to selected 1.67 (colored)

Nuke __P().

Revision 1.90 / (download) - annotate - [select for diffs], Sun Mar 14 16:47:23 2004 UTC (20 years, 1 month ago) by jdolecek
Branch: MAIN
Changes since 1.89: +2 -2 lines
Diff to previous 1.89 (colored) to selected 1.67 (colored)

fix typo in comment

Revision 1.89 / (download) - annotate - [select for diffs], Fri Feb 13 13:47:16 2004 UTC (20 years, 2 months ago) by yamt
Branch: MAIN
Changes since 1.88: +3 -1 lines
Diff to previous 1.88 (colored) to selected 1.67 (colored)

when breaking a loan from uobj,
insert the replacement page into the same position
as the original page on the object memq so that
genfs_putpages (and lfs) won't be confused.

noted by Stephan Uphoff (PR/24328)

Revision 1.88 / (download) - annotate - [select for diffs], Sun Jan 4 11:33:32 2004 UTC (20 years, 3 months ago) by jdolecek
Branch: MAIN
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored) to selected 1.67 (colored)

Rearrange process exit path to avoid need to free resources from different
process context ('reaper').

From within the exiting process context:
* deactivate pmap and free vmspace while we can still block
* introduce MD cpu_lwp_free() - this cleans all MD-specific context (such
  as FPU state), and is the last potentially blocking operation;
  all of cpu_wait(), and most of cpu_exit(), is now folded into cpu_lwp_free()
* process is now immediatelly marked as zombie and made available for pickup
  by parent; the remaining last lwp continues the exit as fully detached
* MI (rather than MD) code bumps uvmexp.swtch, cpu_exit() is now same
  for both 'process' and 'lwp' exit

uvm_lwp_exit() is modified to never block; the u-area memory is now
always just linked to the list of available u-areas. Introduce (blocking)
uvm_uarea_drain(), which is called to release the excessive u-area memory;
this is called by parent within wait4(), or by pagedaemon on memory shortage.
uvm_uarea_free() is now private function within uvm_glue.c.

MD process/lwp exit code now always calls lwp_exit2() immediatelly after
switching away from the exiting lwp.

g/c now unneeded routines and variables, including the reaper kernel thread

Revision 1.87 / (download) - annotate - [select for diffs], Thu Dec 18 15:02:04 2003 UTC (20 years, 4 months ago) by pk
Branch: MAIN
Changes since 1.86: +33 -10 lines
Diff to previous 1.86 (colored) to selected 1.67 (colored)

* Introduce uvm_km_kmemalloc1() which allows alignment and preferred offset
  to be passed to uvm_map().

* Turn all uvm_km_valloc*() macros back into (inlined) functions to retain
  binary compatibility with any 3rd party modules.

Revision 1.86 / (download) - annotate - [select for diffs], Thu Dec 18 08:15:42 2003 UTC (20 years, 4 months ago) by pk
Branch: MAIN
Changes since 1.85: +12 -1 lines
Diff to previous 1.85 (colored) to selected 1.67 (colored)

Condense all existing variants of uvm_km_valloc into a single function:
uvm_km_valloc1(), and use it to express all of
	uvm_km_valloc()
	uvm_km_valloc_wait()
	uvm_km_valloc_prefer()
	uvm_km_valloc_prefer_wait()
	uvm_km_valloc_align()
in terms of it by macro expansion.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Nov 13 03:09:30 2003 UTC (20 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.84: +1 -2 lines
Diff to previous 1.84 (colored) to selected 1.67 (colored)

eliminate uvm_useracc() in favor of checking the return value of
copyin() or copyout().

uvm_useracc() tells us whether the mapping permissions allow access to
the desired part of an address space, and many callers assume that
this is the same as knowing whether an attempt to access that part of
the address space will succeed.  however, access to user space can
fail for reasons other than insufficient permission, most notably that
paging in any non-resident data can fail due to i/o errors.  most of
the callers of uvm_useracc() make the above incorrect assumption.  the
rest are all misguided optimizations, which optimize for the case
where an operation will fail.  we'd rather optimize for operations
succeeding, in which case we should just attempt the access and handle
failures due to insufficient permissions the same way we handle i/o
errors.  since there appear to be no good uses of uvm_useracc(), we'll
just remove it.

Revision 1.84 / (download) - annotate - [select for diffs], Mon Aug 11 16:33:30 2003 UTC (20 years, 8 months ago) by pk
Branch: MAIN
Changes since 1.83: +2 -1 lines
Diff to previous 1.83 (colored) to selected 1.67 (colored)

Introduce uvm_swapisfull(), which computes the available swap space by
taking into account swap devices that are in the process of being removed.

Revision 1.83 / (download) - annotate - [select for diffs], Thu Aug 7 16:34:48 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
Changes since 1.82: +2 -6 lines
Diff to previous 1.82 (colored) to selected 1.67 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.

Revision 1.82 / (download) - annotate - [select for diffs], Sun Jun 29 22:32:49 2003 UTC (20 years, 9 months ago) by fvdl
Branch: MAIN
Branch point for: ktrace-lwp
Changes since 1.81: +3 -3 lines
Diff to previous 1.81 (colored) to selected 1.67 (colored)

Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jun 28 14:22:29 2003 UTC (20 years, 9 months ago) by darrenr
Branch: MAIN
Changes since 1.80: +4 -4 lines
Diff to previous 1.80 (colored) to selected 1.67 (colored)

Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V

Revision 1.80 / (download) - annotate - [select for diffs], Sat May 10 21:10:23 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.79: +0 -10 lines
Diff to previous 1.79 (colored) to selected 1.67 (colored)

Back out the following chagne:
    http://mail-index.netbsd.org/source-changes/2003/05/08/0068.html

There were some side-effects that I didn't anticipate, and fixing them
is proving to be more difficult than I thought, do just eject for now.
Maybe one day we can look at this again.

Fixes PR kern/21517.

Revision 1.79 / (download) - annotate - [select for diffs], Thu May 8 18:13:27 2003 UTC (20 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.78: +11 -1 lines
Diff to previous 1.78 (colored) to selected 1.67 (colored)

Simplify the way the bounds of the managed kernel virtual address
space is advertised to UVM by making virtual_avail and virtual_end
first-class exported variables by UVM.  Machine-dependent code is
responsible for initializing them before main() is called.  Anything
that steals KVA must adjust these variables accordingly.

This reduces the number of instances of this info from 3 to 1, and
simplifies the pmap(9) interface by removing the pmap_virtual_space()
function call, and removing two arguments from pmap_steal_memory().

This also eliminates some kludges such as having to burn kernel_map
entries on space used by the kernel and stolen KVA.

This also eliminates use of VM_{MIN,MAX}_KERNEL_ADDRESS from MI code,
this giving MD code greater flexibility over the bounds of the managed
kernel virtual address space if a given port's specific platforms can
vary in this regard (this is especially true of the evb* ports).

Revision 1.78 / (download) - annotate - [select for diffs], Sat May 3 19:01:06 2003 UTC (20 years, 11 months ago) by wiz
Branch: MAIN
Changes since 1.77: +2 -2 lines
Diff to previous 1.77 (colored) to selected 1.67 (colored)

Misc fixes from jmc@openbsd.

Revision 1.77 / (download) - annotate - [select for diffs], Sat Feb 1 06:23:54 2003 UTC (21 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.76: +4 -1 lines
Diff to previous 1.76 (colored) to selected 1.67 (colored)

Add extensible malloc types, adapted from FreeBSD.  This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.

Revision 1.76 / (download) - annotate - [select for diffs], Sat Jan 18 09:42:58 2003 UTC (21 years, 3 months ago) by thorpej
Branch: MAIN
Changes since 1.75: +11 -9 lines
Diff to previous 1.75 (colored) to selected 1.67 (colored)

Merge the nathanw_sa branch.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Dec 11 07:10:20 2002 UTC (21 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: nathanw_sa_before_merge, nathanw_sa_base, gmcgarry_ucred_base, gmcgarry_ucred, gmcgarry_ctxsw_base, gmcgarry_ctxsw, fvdl_fs64_base
Changes since 1.74: +5 -4 lines
Diff to previous 1.74 (colored) to selected 1.67 (colored)

Define a UVM_FLAG_NOWAIT, which indicates that we're not allowed
to sleep.  Define UVM_KMF_NOWAIT in terms of UVM_FLAG_NOWAIT.

From Manuel Bouyer.  Fixes a problem where any mapping with
read protection was created in a "nowait" context, causing
spurious failures.

Revision 1.74 / (download) - annotate - [select for diffs], Sun Nov 17 08:32:45 2002 UTC (21 years, 5 months ago) by chs
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored) to selected 1.67 (colored)

change uvm_uarea_alloc() to indicate whether the returned uarea is already
backed by physical pages (ie. because it reused a previously-freed one),
so that we can skip a bunch of useless work in that case.
this fixes the underlying problem behind PR 18543, and also speeds up fork()
quite a bit (eg. 7% on my pc, 1% on my ultra2) when we get a cache hit.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Sep 22 07:20:31 2002 UTC (21 years, 6 months ago) by chs
Branch: MAIN
CVS Tags: kqueue-beforemerge, kqueue-base, kqueue-aftermerge
Changes since 1.72: +3 -1 lines
Diff to previous 1.72 (colored) to selected 1.67 (colored)

encapsulate knowledge of uarea allocation in some new functions.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Sep 15 16:54:29 2002 UTC (21 years, 7 months ago) by chs
Branch: MAIN
Changes since 1.71: +2 -1 lines
Diff to previous 1.71 (colored) to selected 1.67 (colored)

add a new km flag UVM_KMF_CANFAIL, which causes uvm_km_kmemalloc() to
return failure if swap is full and there are no free physical pages.
have malloc() use this flag if M_CANFAIL is passed to it.
use M_CANFAIL to allow amap_extend() to fail when memory is scarce.
this should prevent most of the remaining hangs in low-memory situations.

Revision 1.71 / (download) - annotate - [select for diffs], Fri May 17 22:00:50 2002 UTC (21 years, 11 months ago) by enami
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, gehenna-devsw-base
Branch point for: netbsd-1-6
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored) to selected 1.67 (colored)

Make uvn_findpages to return number of pages found so that caller can
easily check if all requested pages are found or not.

Revision 1.70 / (download) - annotate - [select for diffs], Mon Dec 10 01:52:26 2001 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
CVS Tags: newlock-base, newlock, ifpoll-base, eeh-devprop-base, eeh-devprop
Branch point for: gehenna-devsw
Changes since 1.69: +20 -1 lines
Diff to previous 1.69 (colored) to selected 1.67 (colored)

Move the code that walks the process's VM map during a coredump
into uvm_coredump_walkmap(), and use callbacks into the coredump
routine to do something with each section.

Revision 1.69 / (download) - annotate - [select for diffs], Sun Dec 9 03:07:19 2001 UTC (22 years, 4 months ago) by chs
Branch: MAIN
Changes since 1.68: +19 -13 lines
Diff to previous 1.68 (colored) to selected 1.67 (colored)

add {anon,file,exec}max as a upper bound on the amount of memory that
will be allocated for the respective usage types when there is contention
for memory.

replace "vnode" and "vtext" with "file" and "exec" in uvmexp field names
and sysctl names.

Revision 1.68 / (download) - annotate - [select for diffs], Sat Dec 8 00:35:33 2001 UTC (22 years, 4 months ago) by thorpej
Branch: MAIN
Changes since 1.67: +1 -7 lines
Diff to previous 1.67 (colored)

Make the coredump routine exec-format/emulation specific.  Split
out traditional NetBSD coredump routines into core_netbsd.c and
netbsd32_core.c (for COMPAT_NETBSD32).

Revision 1.67 / (download) - annotate - [selected], Sat Sep 15 20:36:45 2001 UTC (22 years, 7 months ago) by chs
Branch: MAIN
CVS Tags: thorpej-mips-cache-base, thorpej-mips-cache, thorpej-devvp-base3, thorpej-devvp-base2, post-chs-ubcperf
Changes since 1.66: +23 -29 lines
Diff to previous 1.66 (colored)

a whole bunch of changes to improve performance and robustness under load:

 - remove special treatment of pager_map mappings in pmaps.  this is
   required now, since I've removed the globals that expose the address range.
   pager_map now uses pmap_kenter_pa() instead of pmap_enter(), so there's
   no longer any need to special-case it.
 - eliminate struct uvm_vnode by moving its fields into struct vnode.
 - rewrite the pageout path.  the pager is now responsible for handling the
   high-level requests instead of only getting control after a bunch of work
   has already been done on its behalf.  this will allow us to UBCify LFS,
   which needs tighter control over its pages than other filesystems do.
   writing a page to disk no longer requires making it read-only, which
   allows us to write wired pages without causing all kinds of havoc.
 - use a new PG_PAGEOUT flag to indicate that a page should be freed
   on behalf of the pagedaemon when it's unlocked.  this flag is very similar
   to PG_RELEASED, but unlike PG_RELEASED, PG_PAGEOUT can be cleared if the
   pageout fails due to eg. an indirect-block buffer being locked.
   this allows us to remove the "version" field from struct vm_page,
   and together with shrinking "loan_count" from 32 bits to 16,
   struct vm_page is now 4 bytes smaller.
 - no longer use PG_RELEASED for swap-backed pages.  if the page is busy
   because it's being paged out, we can't release the swap slot to be
   reallocated until that write is complete, but unlike with vnodes we
   don't keep a count of in-progress writes so there's no good way to
   know when the write is done.  instead, when we need to free a busy
   swap-backed page, just sleep until we can get it busy ourselves.
 - implement a fast-path for extending writes which allows us to avoid
   zeroing new pages.  this substantially reduces cpu usage.
 - encapsulate the data used by the genfs code in a struct genfs_node,
   which must be the first element of the filesystem-specific vnode data
   for filesystems which use genfs_{get,put}pages().
 - eliminate many of the UVM pagerops, since they aren't needed anymore
   now that the pager "put" operation is a higher-level operation.
 - enhance the genfs code to allow NFS to use the genfs_{get,put}pages
   instead of a modified copy.
 - clean up struct vnode by removing all the fields that used to be used by
   the vfs_cluster.c code (which we don't use anymore with UBC).
 - remove kmem_object and mb_object since they were useless.
   instead of allocating pages to these objects, we now just allocate
   pages with no object.  such pages are mapped in the kernel until they
   are freed, so we can use the mapping to find the page to free it.
   this allows us to remove splvm() protection in several places.

The sum of all these changes improves write throughput on my
decstation 5000/200 to within 1% of the rate of NetBSD 1.5
and reduces the elapsed time for "make release" of a NetBSD 1.5
source tree on my 128MB pc to 10% less than a 1.5 kernel took.

Revision 1.66 / (download) - annotate - [select for diffs], Thu Aug 16 01:37:50 2001 UTC (22 years, 8 months ago) by chs
Branch: MAIN
CVS Tags: thorpej-devvp-base, pre-chs-ubcperf
Branch point for: thorpej-devvp
Changes since 1.65: +3 -4 lines
Diff to previous 1.65 (colored) to selected 1.67 (colored)

user maps are always pageable.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Jun 2 18:09:26 2001 UTC (22 years, 10 months ago) by chs
Branch: MAIN
Branch point for: kqueue
Changes since 1.64: +44 -48 lines
Diff to previous 1.64 (colored) to selected 1.67 (colored)

replace vm_map{,_entry}_t with struct vm_map{,_entry} *.

Revision 1.64 / (download) - annotate - [select for diffs], Sat May 26 21:27:21 2001 UTC (22 years, 10 months ago) by chs
Branch: MAIN
Changes since 1.63: +1 -2 lines
Diff to previous 1.63 (colored) to selected 1.67 (colored)

replace vm_page_t with struct vm_page *.

Revision 1.63 / (download) - annotate - [select for diffs], Fri May 25 04:06:12 2001 UTC (22 years, 10 months ago) by chs
Branch: MAIN
Changes since 1.62: +11 -11 lines
Diff to previous 1.62 (colored) to selected 1.67 (colored)

remove trailing whitespace.

Revision 1.62 / (download) - annotate - [select for diffs], Wed May 2 01:22:19 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.61: +4 -2 lines
Diff to previous 1.61 (colored) to selected 1.67 (colored)

Support dynamic sizing of the page color bins.  We also support
dynamically re-coloring pages; as machine-dependent code discovers
the size of the system's caches, it may call uvm_page_recolor() with
the new number of colors to use.  If the new mumber of colors is
smaller (or equal to) the current number of colors, then uvm_page_recolor()
is a no-op.

The system defaults to one bucket if machine-dependent code does not
initialize uvmexp.ncolors before uvm_page_init() is called.

Note that the number of color bins should be initialized to something
reasonable as early as possible -- for many early memory allocations,
we live with the consequences of the page choice for the lifetime of
the boot.

Revision 1.61 / (download) - annotate - [select for diffs], Tue May 1 19:36:56 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored) to selected 1.67 (colored)

Add the number of page colors to uvmexp.

Revision 1.60 / (download) - annotate - [select for diffs], Sun Apr 29 04:23:21 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.59: +5 -1 lines
Diff to previous 1.59 (colored) to selected 1.67 (colored)

Implement page coloring, using a round-robin bucket selection
algorithm (Solaris calls this "Bin Hopping").

This implementation currently relies on MD code to define a
constant defining the number of buckets.  This will change
reasonably soon (MD code will be able to dynamically size
the bucket array).

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 25 18:09:52 2001 UTC (22 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.58: +2 -6 lines
Diff to previous 1.58 (colored) to selected 1.67 (colored)

pmap_resident_count() always exists.  Besides, returning the
value of vm_rssize is pointless -- it is never initialized to
anything other than 0.

Revision 1.58 / (download) - annotate - [select for diffs], Thu Mar 15 06:10:56 2001 UTC (23 years, 1 month ago) by chs
Branch: MAIN
CVS Tags: thorpej_scsipi_nbase, thorpej_scsipi_beforemerge, thorpej_scsipi_base
Changes since 1.57: +3 -3 lines
Diff to previous 1.57 (colored) to selected 1.67 (colored)

eliminate the KERN_* error codes in favor of the traditional E* codes.
the mapping is:

KERN_SUCCESS			0
KERN_INVALID_ADDRESS		EFAULT
KERN_PROTECTION_FAILURE		EACCES
KERN_NO_SPACE			ENOMEM
KERN_INVALID_ARGUMENT		EINVAL
KERN_FAILURE			various, mostly turn into KASSERTs
KERN_RESOURCE_SHORTAGE		ENOMEM
KERN_NOT_RECEIVER		<unused>
KERN_NO_ACCESS			<unused>
KERN_PAGES_LOCKED		<unused>

Revision 1.57 / (download) - annotate - [select for diffs], Fri Mar 9 01:02:12 2001 UTC (23 years, 1 month ago) by chs
Branch: MAIN
Changes since 1.56: +15 -3 lines
Diff to previous 1.56 (colored) to selected 1.67 (colored)

add UBC memory-usage balancing.  we track the number of pages in use for
each of the basic types (anonymous data, executable image, cached files)
and prevent the pagedaemon from reusing a given page if that would reduce
the count of that type of page below a sysctl-setable minimum threshold.
the thresholds are controlled via three new sysctl tunables:
vm.anonmin, vm.vnodemin, and vm.vtextmin.  these tunables are the
percentages of pageable memory reserved for each usage, and we do not allow
the sum of the minimums to be more than 95% so that there's always some
memory that can be reused.

Revision 1.56 / (download) - annotate - [select for diffs], Tue Feb 6 17:01:52 2001 UTC (23 years, 2 months ago) by eeh
Branch: MAIN
Branch point for: nathanw_sa
Changes since 1.55: +2 -2 lines
Diff to previous 1.55 (colored) to selected 1.67 (colored)

Specify a process' address space limits for uvmspace_exec().

Revision 1.55 / (download) - annotate - [select for diffs], Thu Nov 30 11:04:43 2000 UTC (23 years, 4 months ago) by simonb
Branch: MAIN
Changes since 1.54: +10 -6 lines
Diff to previous 1.54 (colored) to selected 1.67 (colored)

Move uvm_pgcnt_vnode and uvm_pgcnt_anon into uvmexp (as vnodepages and
anonpages), and add vtextpages which is currently unused but will be
used to trace the number of pages used by vtext vnodes.

Revision 1.54 / (download) - annotate - [select for diffs], Wed Nov 29 09:52:18 2000 UTC (23 years, 4 months ago) by simonb
Branch: MAIN
Changes since 1.53: +84 -1 lines
Diff to previous 1.53 (colored) to selected 1.67 (colored)

Add a vm.uvmexp2 sysctl that uses a ABI-safe 'struct uvmexp_sysctl'.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Nov 27 08:40:03 2000 UTC (23 years, 4 months ago) by chs
Branch: MAIN
Changes since 1.52: +38 -6 lines
Diff to previous 1.52 (colored) to selected 1.67 (colored)

Initial integration of the Unified Buffer Cache project.

Revision 1.52 / (download) - annotate - [select for diffs], Mon Nov 27 04:36:40 2000 UTC (23 years, 4 months ago) by nisimura
Branch: MAIN
Changes since 1.51: +2 -1 lines
Diff to previous 1.51 (colored) to selected 1.67 (colored)

Introduce uvm_km_valloc_align() and use it to glab process's USPACE
aligned on USPACE boundary in kernel virutal address.  It's benefitial
for MIPS R4000's paired TLB entry design.

Revision 1.51 / (download) - annotate - [select for diffs], Thu Sep 28 19:05:06 2000 UTC (23 years, 6 months ago) by eeh
Branch: MAIN
Changes since 1.50: +2 -1 lines
Diff to previous 1.50 (colored) to selected 1.67 (colored)

Add support for variable end of user stacks needed to support COMPAT_NETBSD32:

	`struct vmspace' has a new field `vm_minsaddr' which is the user TOS.

	PS_STRINGS is deprecated in favor of curproc->p_pstr which is derived
	from `vm_minsaddr'.

	Bump the kernel version number.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Sep 21 17:46:04 2000 UTC (23 years, 6 months ago) by thorpej
Branch: MAIN
Changes since 1.49: +3 -1 lines
Diff to previous 1.49 (colored) to selected 1.67 (colored)

Make PMAP_PAGEIDLEZERO() return a boolean value.  FALSE indidcates
that the page being zero'd was not completed and that page zeroing
should be aborted.  This may be used by machine-dependent code doing
slow page access to reduce the latency of running a process that has
become runnable while in the middle of doing a slow page zero.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Sep 13 15:00:25 2000 UTC (23 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.48: +3 -2 lines
Diff to previous 1.48 (colored) to selected 1.67 (colored)

Add an align argument to uvm_map() and some callers of that
routine.  Works similarly fto pmap_prefer(), but allows callers
to specify a minimum power-of-two alignment of the region.
How we ever got along without this for so long is beyond me.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Aug 12 22:41:55 2000 UTC (23 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.47: +2 -2 lines
Diff to previous 1.47 (colored) to selected 1.67 (colored)

Don't bother with a trampoline to start the pagedaemon and
reaper threads.

Revision 1.47 / (download) - annotate - [select for diffs], Tue Aug 1 00:53:09 2000 UTC (23 years, 8 months ago) by wiz
Branch: MAIN
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored) to selected 1.67 (colored)

Rename VM_INHERIT_* to MAP_INHERIT_* and move them to sys/sys/mman.h as
discussed on tech-kern.
Retire sys/uvm/uvm_inherit.h, update man page for minherit(2).

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jul 24 20:10:51 2000 UTC (23 years, 8 months ago) by jeffs
Branch: MAIN
Changes since 1.45: +3 -1 lines
Diff to previous 1.45 (colored) to selected 1.67 (colored)

Add uvm_km_valloc_prefer_wait().  Used to valloc with the passed in
voff_t being passed to PMAP_PREFER(), which results in the propper
virtual alignment of the allocated space.

Revision 1.45 / (download) - annotate - [select for diffs], Tue Jun 27 16:16:43 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.44: +68 -9 lines
Diff to previous 1.44 (colored) to selected 1.67 (colored)

move the contents of <vm/vm.h> into <uvm/uvm_extern.h>.  <vm/vm.h> is simply
an include of <uvm/uvm_extern.h> now.

Revision 1.44 / (download) - annotate - [select for diffs], Tue Jun 27 09:00:14 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.43: +58 -1 lines
Diff to previous 1.43 (colored) to selected 1.67 (colored)

more vm header file changes:

	<vm/vm_extern.h> merged into <uvm/uvm_extern.h>
	<vm/vm_page.h> merged into <uvm/uvm_page.h>
	<vm/pmap.h> has become <uvm/uvm_pmap.h>

this leaves just <vm/vm.h> in NetBSD.

Revision 1.43 / (download) - annotate - [select for diffs], Mon Jun 26 14:21:17 2000 UTC (23 years, 9 months ago) by mrg
Branch: MAIN
Changes since 1.42: +10 -1 lines
Diff to previous 1.42 (colored) to selected 1.67 (colored)

remove/move more mach vm header files:

	<vm/pglist.h> -> <uvm/uvm_pglist.h>
	<vm/vm_inherit.h> -> <uvm/uvm_inherit.h>
	<vm/vm_kern.h> -> into <uvm/uvm_extern.h>
	<vm/vm_object.h> -> nothing
	<vm/vm_pager.h> -> into <uvm/uvm_pager.h>

also includes a bunch of <vm/vm_page.h> include removals (due to redudancy
with <vm/vm.h>), and a scattering of other similar headers.

Revision 1.42 / (download) - annotate - [select for diffs], Thu Jun 8 05:52:34 2000 UTC (23 years, 10 months ago) by thorpej
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.41: +1 -3 lines
Diff to previous 1.41 (colored) to selected 1.67 (colored)

Change UVM_UNLOCK_AND_WAIT() to use ltsleep() (it is now atomic, as
advertised).  Garbage-collect uvm_sleep().

Revision 1.41 / (download) - annotate - [select for diffs], Sun May 28 05:49:06 2000 UTC (23 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.40: +2 -2 lines
Diff to previous 1.40 (colored) to selected 1.67 (colored)

Rather than starting init and creating kthreads by forking and then
doing a cpu_set_kpc(), just pass the entry point and argument all
the way down the fork path starting with fork1().  In order to
avoid special-casing the normal fork in every cpu_fork(), MI code
passes down child_return() and the child process pointer explicitly.

This fixes a race condition on multiprocessor systems; a CPU could
grab the newly created processes (which has been placed on a run queue)
before cpu_set_kpc() would be performed.

Revision 1.40 / (download) - annotate - [select for diffs], Mon Apr 24 17:12:00 2000 UTC (23 years, 11 months ago) by thorpej
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.39: +6 -1 lines
Diff to previous 1.39 (colored) to selected 1.67 (colored)

Changes necessary to implement pre-zero'ing of pages in the idle loop:
- Make page free lists have two actual queues: known-zero pages and
  pages with unknown contents.
- Implement uvm_pageidlezero().  This function attempts to zero up to
  the target number of pages until the target has been reached (currently
  target is `all free pages') or until whichqs becomes non-zero (indicating
  that a process is ready to run).
- Define a new hook for the pmap module for pre-zero'ing pages.  This is
  used to zero the pages using uncached access.  This allows us to zero
  as many pages as we want without polluting the cache.

In order to use this feature, each platform must add the appropropriate
glue in their idle loop.

Revision 1.39 / (download) - annotate - [select for diffs], Mon Apr 10 00:28:05 2000 UTC (24 years ago) by thorpej
Branch: MAIN
Changes since 1.38: +3 -2 lines
Diff to previous 1.38 (colored) to selected 1.67 (colored)

Add UVM_PGA_ZERO which instructs uvm_pagealloc{,_strat}() to return a
zero'd, ! PG_CLEAN page, as if it were uvm_pagezero()'d.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Mar 26 20:54:46 2000 UTC (24 years ago) by kleink
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (colored) to selected 1.67 (colored)

Merge parts of chs-ubc2 into the trunk:
Add a new type voff_t (defined as a synonym for off_t) to describe offsets
into uvm objects, and update the appropriate interfaces to use it, the
most visible effect being the ability to mmap() file offsets beyond
the range of a vaddr_t.

Originally by Chuck Silvers; blame me for problems caused by merging this
into non-UBC.

Revision 1.37 / (download) - annotate - [select for diffs], Fri Feb 11 19:22:54 2000 UTC (24 years, 2 months ago) by thorpej
Branch: MAIN
CVS Tags: chs-ubc2-newbase
Changes since 1.36: +6 -1 lines
Diff to previous 1.36 (colored) to selected 1.67 (colored)

Add some very simple code to auto-size the kmem_map.  We take the
amount of physical memory, divide it by 4, and then allow machine
dependent code to place upper and lower bounds on the size.  Export
the computed value to userspace via the new "vm.nkmempages" sysctl.

NKMEMCLUSTERS is now deprecated and will generate an error if you
attempt to use it.  The new option, should you choose to use it,
is called NKMEMPAGES, and two new options NKMEMPAGES_MIN and
NKMEMPAGES_MAX allow the user to configure the bounds in the kernel
config file.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jan 11 06:57:49 2000 UTC (24 years, 3 months ago) by chs
Branch: MAIN
Changes since 1.35: +3 -1 lines
Diff to previous 1.35 (colored) to selected 1.67 (colored)

add support for ``swapctl -d'' (removing swap space).
improve handling of i/o errors in swap space.

reviewed by:  Chuck Cranor

Revision 1.35 / (download) - annotate - [select for diffs], Thu Dec 30 16:09:47 1999 UTC (24 years, 3 months ago) by eeh
Branch: MAIN
Changes since 1.34: +7 -3 lines
Diff to previous 1.34 (colored) to selected 1.67 (colored)

I should have made uvm_page_physload() take paddr_t's instead of vaddr_t's.
Also, add uvm_coredump32().

Revision 1.34 / (download) - annotate - [select for diffs], Thu Jul 22 22:58:38 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, fvdl-softdep-base, fvdl-softdep, comdex-fall-1999-base, comdex-fall-1999, chs-ubc2-base
Branch point for: thorpej_scsipi
Changes since 1.33: +4 -1 lines
Diff to previous 1.33 (colored) to selected 1.67 (colored)

Garbage collect thread_sleep()/thread_wakeup() left over from the old
Mach VM code.  Also nuke iprintf(), which was no longer used anywhere.

Add proclist locking where appropriate.

Revision 1.33 / (download) - annotate - [select for diffs], Sat Jul 17 21:35:49 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.32: +8 -2 lines
Diff to previous 1.32 (colored) to selected 1.67 (colored)

Add a set of "lockflags", which can control the locking behavior
of some functions.  Use these flags in uvm_map_pageable() to determine
if the map is locked on entry (replaces an already present boolean_t
argument `islocked'), and if the function should return with the map
still locked.

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jul 2 23:20:58 1999 UTC (24 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.31: +3 -1 lines
Diff to previous 1.31 (colored) to selected 1.67 (colored)

Bring in additional uvmexp members from chs-ubc2, so that VM stats can
be read no matter which kernel you're running.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jun 21 17:25:11 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.30: +8 -2 lines
Diff to previous 1.30 (colored) to selected 1.67 (colored)

Protect prototypes, certain macros, and inlines from userland.

Revision 1.30 / (download) - annotate - [select for diffs], Fri Jun 18 05:13:46 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored) to selected 1.67 (colored)

Add the guts of mlockall(MCL_FUTURE).  This requires that a process's
"memlock" resource limit to uvm_mmap().  Update all calls accordingly.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jun 17 15:47:22 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored) to selected 1.67 (colored)

Make uvm_vslock() return the error code from uvm_fault_wire().  All places
which use uvm_vslock() should now test the return value.  If it's not
KERN_SUCCESS, wiring the pages failed, so the operation which is using
uvm_vslock() should error out.

XXX We currently just EFAULT a failed uvm_vslock().  We may want to do
more about translating error codes in the future.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jun 15 23:27:47 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored) to selected 1.67 (colored)

Several changes, developed and tested concurrently:
* Provide POSIX 1003.1b mlockall(2) and munlockall(2) system calls.
  MCL_CURRENT is presently implemented.  MCL_FUTURE is not fully
  implemented.  Also, the same one-unlock-for-every-lock caveat
  currently applies here as it does to mlock(2).  This will be
  addressed in a future commit.
* Provide the mincore(2) system call, with the same semantics as
  Solaris.
* Clean up the error recovery in uvm_map_pageable().
* Fix a bug where a process would hang if attempting to mlock a
  zero-fill region where none of the pages in that region are resident.
  [ This fix has been submitted for inclusion in 1.4.1 ]

Revision 1.27 / (download) - annotate - [select for diffs], Wed May 26 19:16:36 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored) to selected 1.67 (colored)

Change the vm_map's "entries_pageable" member to a r/o flags member, which
has PAGEABLE and INTRSAFE flags.  PAGEABLE now really means "pageable",
not "allocate vm_map_entry's from non-static pool", so update all map
creations to reflect that.  INTRSAFE maps are maps that are used in
interrupt context (e.g. kmem_map, mb_map), and thus use the static
map entry pool (XXX as does kernel_map, for now).  This will eventually
change now these maps are locked, as well.

Revision 1.26 / (download) - annotate - [select for diffs], Wed May 26 01:05:24 1999 UTC (24 years, 10 months ago) by thorpej
Branch: MAIN
Changes since 1.25: +3 -2 lines
Diff to previous 1.25 (colored) to selected 1.67 (colored)

Pass an access_type to uvm_vslock().

Revision 1.25 / (download) - annotate - [select for diffs], Thu May 13 21:58:38 1999 UTC (24 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.24: +3 -2 lines
Diff to previous 1.24 (colored) to selected 1.67 (colored)

Allow the caller to specify a stack for the child process.  If NULL,
the child inherits the stack pointer from the parent (traditional
behavior).  Like the signal stack, the stack area is secified as
a low address and a size; machine-dependent code accounts for stack
direction.

This is required for clone(2).

Revision 1.24 / (download) - annotate - [select for diffs], Sun Apr 11 04:04:11 1999 UTC (25 years ago) by chs
Branch: MAIN
Changes since 1.23: +10 -5 lines
Diff to previous 1.23 (colored) to selected 1.67 (colored)

add a `flags' argument to uvm_pagealloc_strat().
define a flag UVM_PGA_USERESERVE to allow non-kernel object
allocations to use pages from the reserve.
use the new flag for allocations in pmap modules.

Revision 1.23 / (download) - annotate - [select for diffs], Fri Mar 26 17:34:15 1999 UTC (25 years ago) by chs
Branch: MAIN
CVS Tags: netbsd-1-4-base
Branch point for: netbsd-1-4
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored) to selected 1.67 (colored)

add uvmexp.swpgonly and use it to detect out-of-swap conditions.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Mar 25 18:48:50 1999 UTC (25 years ago) by mrg
Branch: MAIN
Changes since 1.21: +1 -5 lines
Diff to previous 1.21 (colored) to selected 1.67 (colored)

remove now >1 year old pre-release message.

Revision 1.21 / (download) - annotate - [select for diffs], Tue Sep 8 23:44:21 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
CVS Tags: kenh-if-detach-base, kenh-if-detach, chs-ubc-base
Branch point for: chs-ubc
Changes since 1.20: +2 -1 lines
Diff to previous 1.20 (colored) to selected 1.67 (colored)

Implement uvm_exit(), which frees VM resources when a process finishes
exiting.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Aug 28 20:05:49 1998 UTC (25 years, 7 months ago) by thorpej
Branch: MAIN
Changes since 1.19: +4 -4 lines
Diff to previous 1.19 (colored) to selected 1.67 (colored)

Add a waitok boolean argument to the VM system's pool page allocator backend.

Revision 1.19 / (download) - annotate - [select for diffs], Thu Aug 13 02:11:00 1998 UTC (25 years, 8 months ago) by eeh
Branch: MAIN
Changes since 1.18: +38 -36 lines
Diff to previous 1.18 (colored) to selected 1.67 (colored)

Merge paddr_t changes into the main branch.

Revision 1.18 / (download) - annotate - [select for diffs], Sat Aug 1 01:39:03 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.17: +5 -3 lines
Diff to previous 1.17 (colored) to selected 1.67 (colored)

We need to be able to specify a uvm_object to the pool page allocator, too.

Revision 1.17 / (download) - annotate - [select for diffs], Fri Jul 31 20:46:37 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
Changes since 1.16: +5 -3 lines
Diff to previous 1.16 (colored) to selected 1.67 (colored)

Allow an alternate splimp-protected map to be specified in the pool page
allocator routines.

Revision 1.16 / (download) - annotate - [select for diffs], Fri Jul 24 20:28:48 1998 UTC (25 years, 8 months ago) by thorpej
Branch: MAIN
CVS Tags: eeh-paddr_t-base
Branch point for: eeh-paddr_t
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored) to selected 1.67 (colored)

Implement uvm_km_{alloc,free}_poolpage().  These functions use pmap hooks to
map/unmap pool pages if provided by the pmap layer.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jul 8 04:28:27 1998 UTC (25 years, 9 months ago) by thorpej
Branch: MAIN
Changes since 1.14: +13 -4 lines
Diff to previous 1.14 (colored) to selected 1.67 (colored)

Add support for multiple memory free lists.  There is at least one
default free list, and 0 - N additional free list, in order of descending
priority.

A new page allocation function, uvm_pagealloc_strat(), has been added,
providing three page allocation strategies:

	- normal: high -> low priority free list walk, taking the
	  page off the first free list that has one.

	- only: attempt to allocate a page only from the specified free
	  list, failing if that free list has none available.

	- fallback: if `only' fails, fall back on `normal'.

uvm_pagealloc(...) is provided for normal use (and is a synonym for
uvm_pagealloc_strat(..., UVM_PGA_STRAT_NORMAL, 0); the free list argument
is ignored for the `normal' case).

uvm_page_physload() now specified which free list the pages will be
loaded onto.  This means that some platforms which have multiple physical
memory segments may define additional vm_physsegs if they wish to break
individual physical segments into differing priorities.

Machine-dependent code must define _at least_ the following constants
in <machine/vmparam.h>:

	VM_NFREELIST: the number of free lists the system will have

	VM_FREELIST_DEFAULT: the default freelist (should always be 0,
	but is defined in machdep code so that it's with all of the
	other free list-related constants).

Additional free list names may be defined by machine-dependent code, but
they will only be used by machine-dependent code (e.g. for loading the
vm_physsegs).

Revision 1.14 / (download) - annotate - [select for diffs], Sat Jul 4 22:18:53 1998 UTC (25 years, 9 months ago) by jonathan
Branch: MAIN
Changes since 1.13: +1 -14 lines
Diff to previous 1.13 (colored) to selected 1.67 (colored)

defopt DDB.

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 9 15:04:40 1998 UTC (25 years, 11 months ago) by kleink
Branch: MAIN
Changes since 1.12: +6 -6 lines
Diff to previous 1.12 (colored) to selected 1.67 (colored)

Use size_t to pass the length of the memory region to operate on to chgkprot(),
kernacc(), useracc(), vslock() and vsunlock(); (unsigned) ints are not
adequate on all platforms.

Revision 1.12 / (download) - annotate - [select for diffs], Thu Apr 30 06:28:59 1998 UTC (25 years, 11 months ago) by thorpej
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored) to selected 1.67 (colored)

Pass vslock() and vsunlock() a proc *, rather than implicitly operating
on curproc.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Mar 30 06:24:42 1998 UTC (26 years ago) by mycroft
Branch: MAIN
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) to selected 1.67 (colored)

Mark scheduler() and uvm_scheduler() as never returning.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Mar 27 01:47:06 1998 UTC (26 years ago) by thorpej
Branch: MAIN
Changes since 1.9: +6 -2 lines
Diff to previous 1.9 (colored) to selected 1.67 (colored)

Split uvmspace_alloc() into uvmspace_alloc() and uvmspace_init().  The latter
can be used for initializing a pre-allocated vmspace.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Mar 9 00:58:56 1998 UTC (26 years, 1 month ago) by mrg
Branch: MAIN
Changes since 1.8: +14 -14 lines
Diff to previous 1.8 (colored) to selected 1.67 (colored)

KNF.

Revision 1.8 / (download) - annotate - [select for diffs], Tue Feb 10 02:34:31 1998 UTC (26 years, 2 months ago) by perry
Branch: MAIN
Changes since 1.7: +4 -4 lines
Diff to previous 1.7 (colored) to selected 1.67 (colored)

add/cleanup multiple inclusion protection.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Feb 9 13:08:22 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.6: +14 -13 lines
Diff to previous 1.6 (colored) to selected 1.67 (colored)

keep statistics on pageout/pagein, total pages, and total operations.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Feb 8 06:15:58 1998 UTC (26 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored) to selected 1.67 (colored)

Allow callers of uvm_km_suballoc() to specify where the base of the
submap _must_ begin, by adding a "fixed" boolean argument.

Revision 1.5 / (download) - annotate - [select for diffs], Sat Feb 7 17:00:36 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.4: +3 -1 lines
Diff to previous 1.4 (colored) to selected 1.67 (colored)

implement counters for pages paged in/out

Revision 1.4 / (download) - annotate - [select for diffs], Sat Feb 7 11:08:22 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Changes since 1.3: +3 -1 lines
Diff to previous 1.3 (colored) to selected 1.67 (colored)

restore rcsids

Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 7 02:24:02 1998 UTC (26 years, 2 months ago) by chs
Branch: MAIN
Changes since 1.2: +7 -2 lines
Diff to previous 1.2 (colored) to selected 1.67 (colored)

prototype for uvm_map_checkprot() moved here.
add uvmexp fields for pagouts-in-progress and kernel-reserved pages.

Revision 1.2 / (download) - annotate - [select for diffs], Fri Feb 6 22:31:43 1998 UTC (26 years, 2 months ago) by thorpej
Branch: MAIN
Changes since 1.1: +1 -1 lines
Diff to previous 1.1 (colored) to selected 1.67 (colored)

RCS ID police.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Feb 5 06:25:10 1998 UTC (26 years, 2 months ago) by mrg
Branch: MAIN
Diff to selected 1.67 (colored)

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>