Home | History | Annotate | Download | only in rumpkern
History log of /src/sys/rump/librump/rumpkern/vm.c
RevisionDateAuthorComments
 1.197  24-Sep-2023  martin PR kern/57626: instead of an (arbitrary) FAKE_PAGE_SHIFT (and always
using 4k pages), query the hypervisor for the real page size of the host
kernel and use that for architectures that do not have compile time
constant page sizes.
 1.196  22-Apr-2023  riastradh rump: Move ubc_uiomove, ubc_zerorange from rumpvfs to rumpkern.

Needed by kern_ksyms.c. We could split kern_ksyms.c up into kernel-
internal interfaces and the user/kernel /dev/ksyms interface, but
there's nothing vfs-specific about ubc_uiomove and ubc_zerorange
anyway, so let's just define them in rumpkern.
 1.195  22-Apr-2023  riastradh rumpkern: Provide stub uvm_vnodeops weak alias.

Needed for UVM_OBJ_IS_VNODE, but not for anything else in rumpkern
without rumpvfs.
 1.194  26-Oct-2022  riastradh sys/*: Get module_map consistently from sys/module.h.
 1.193  21-Aug-2022  riastradh rumpkern: Abusing struct pmap internals now requires extra effort.

(as it should)
 1.192  16-Sep-2021  andvar fix typos in word "successfully", mainly s/succesfully/successfully/.
 1.191  05-Dec-2020  chs update the rump copy of uvm_page_unbusy() to match the real version,
in particular handle PG_PAGEOUT. fixes a few atf tests.
 1.190  11-Jun-2020  ad branches: 1.190.2;
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.
 1.189  06-Jun-2020  ad Correction to previous - set VI_PAGES correctly.
 1.188  03-Jun-2020  ad PR kern/55032 (rump/rumpkern/t_vm:uvmwait test case now fails)

Work around issues with rump's pagedaemon emulation, including one that's
sensitive to timing effects (i.e. scheduler changes). While here tidy up
some other stuff around the emulation of page alloc/free.
 1.187  17-Mar-2020  ad Tweak the March 14th change to make page waits interlocked by pg->interlock.
Remove unneeded changes and only deal with the PQ_WANTED flag, to exclude
possible bugs.
 1.186  14-Mar-2020  ad Make page waits (WANTED vs BUSY) interlocked by pg->interlock. Gets RW
locks out of the equation for sleep/wakeup, and allows observing+waiting
for busy pages when holding only a read lock. Proposed on tech-kern.
 1.185  14-Mar-2020  ad rump - page/object dirtyness tracking corrections.
 1.184  23-Feb-2020  ad 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.
 1.183  15-Jan-2020  ad 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.
 1.182  05-Jan-2020  para branches: 1.182.2;
remove unused predicate function

likely unused since kmem changes
 1.181  02-Jan-2020  ad rump: initialize pg->interlock
 1.180  31-Dec-2019  ad Fix rump.
 1.179  31-Dec-2019  ad Rename uvm_free() -> uvm_availmem().
 1.178  31-Dec-2019  ad Rename uvm_page_locked_p() -> uvm_page_owner_locked_p()
 1.177  21-Dec-2019  ad Add uvm_free(): returns number of free pages in system.
 1.176  15-Dec-2019  ad Merge from yamt-pagecache:

- do gang lookup of pages using radixtree.
- remove now unused uvm_object::uo_memq and vm_page::listq.queue.
 1.175  14-Dec-2019  ad Merge from yamt-pagecache: use radixtree for page lookup.

rbtree page lookup was introduced during the NetBSD 5.0 development cycle to
bypass lock contention problems with the (then) global page hash, and was a
temporary solution to allow us to make progress. radixtree is the intended
replacement.

Ok yamt@.
 1.174  13-Dec-2019  ad Break the global uvm_pageqlock into a per-page identity lock and a private
lock for use of the pagedaemon policy code. Discussed on tech-kern.

PR kern/54209: NetBSD 8 large memory performance extremely low
PR kern/54210: NetBSD-8 processes presumably not exiting
PR kern/54727: writing a large file causes unreasonable system behaviour
 1.173  14-May-2017  nat branches: 1.173.10; 1.173.14;
Add uvm_map_pageable dummy function. This means that the audio tests
should run again.

Ok christos@.
 1.172  07-May-2017  martin Provide stupid uvm_map() and uvm_unmap1() immplementations - might be enough
to get audio tests in rump going again.
XXX needs a RUMP chef to review/replace by something sane!
 1.171  07-May-2017  martin Add a dummy (non-working) uvm_map().
XXX someone with a clue please fix this for real!
 1.170  20-Jul-2016  christos branches: 1.170.6;
add uvm_km_protect()
 1.169  26-Jan-2016  pooka branches: 1.169.2;
Put the kernelside rump kernel headers into <rump-sys> instead of
sprinkling them around the faction directories. Avoids having
to add a CPPFLAGS (or several) to pretty much every component
Makefile.

Leave compat headers around in the old locations.

The commit changes some autogenerated files, but I'll fix the
generators shortly and regen.
 1.168  26-Nov-2015  martin Adapt to e_default_mapaddr signature changes
 1.167  02-Jun-2015  pooka In case pagedaemon can't release any more memory, use kpause() instead
of cv_timedwait() on the pagedaemon condvar -- it's no use constantly
waking the pagedaemon up for new memory allocation attempts, as will
happen e.g. if new network connections are constantly pouring in.
 1.166  18-Apr-2015  pooka Give remote clients struct pmap storage. Although the pmap is unused,
that way we can sure that the pmap macro framework doesn't access all
the wrong places.
 1.165  17-Apr-2015  pooka g/c rump_vmmap

No recollection what it was used for; didn't seem to be used even when
it was originally added 5th August 2007.
 1.164  17-Apr-2015  pooka Give the kernel/local pmaps actual storage.

That way friendly neighborhood macros won't go scribbling
in the wrong places.
 1.163  03-Apr-2015  pooka Use RUMP_PMAP_KERNEL and RUMP_PMAP_LOCAL to denote
kernel and local client pmaps, respectively.
 1.162  03-Apr-2015  pooka Use a different vmspace for rump kernel proc0 and local clients.
While the rump kernel and local clients are by definition in the same
host vmspace, there are subtle differences in how in-kernel code works
in case accessing the kernel vmspace or a user process vmspace.

Problem discovered by riastradh's "read(fd, NULL, 1)" test.
 1.161  03-Jan-2015  pooka Put all sysproxy routines to their own C module, sysproxy.c
 1.160  14-Dec-2014  chs 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).
 1.159  15-Jun-2014  pooka branches: 1.159.2; 1.159.4;
update comment
 1.158  13-Jun-2014  pooka make sure we don't underflow the memlimit
 1.157  13-Jun-2014  pooka fill in a few more uvmexp entries
 1.156  25-Apr-2014  pooka Init function pointers to nullop() so that callers don't need a dance
 1.155  12-Apr-2014  pooka apparently DFLSSIZ isn't defined on powerpc, so pull a value out of el stetson
 1.154  10-Apr-2014  pooka Pretend that we have slightly more reasonable stack size limits.
(we don't have stacks, that's why we pretend)
 1.153  09-Apr-2014  pooka implement lwp_create() and a few related interfaces.
main raison d'impalerment: the aio driver
 1.152  11-Mar-2014  pooka branches: 1.152.2;
kill undesirable #ifndef _RUMPKERNEL
 1.151  11-Mar-2014  pooka deduplicate uvm_object_printit() implementation
 1.150  03-Mar-2014  pooka Fix the memory limiter to work for non-pagedaemon threads again

reported by njoly
 1.149  18-Feb-2014  pooka Use same uvm_swap_shutdown() stub for !vmswap kernels and rump kernels.
 1.148  17-Feb-2014  pooka simply issue a warning if <1MB RAM configured. it might work, but
not going to start enumerating when and where it might.
 1.147  17-Feb-2014  pooka reserve a small amount of memory for the pagedaemon
 1.146  23-Nov-2013  christos add a copy of uvm_swap_shutdown() here so that it is not undefined when we
use it.
 1.145  14-Nov-2013  martin As discussed on tech-kern: make TOPDOWN-VM runtime selectable per process
(offer MD code or emulations to override it).
 1.144  30-Apr-2013  pooka branches: 1.144.4;
Flip parameter order in the clock hypercalls to make them consistent
with everything else wrt in/out parameters.
 1.143  30-Apr-2013  pooka add missing demogorgon
 1.142  30-Apr-2013  pooka Make hypercall calling conventions consistent: iff a hypercall can fail,
it returns an int containing the error value.
 1.141  29-Apr-2013  pooka Replace the various "get info from hypervisor" interfaces with one
unified rumpuser_getparam(), and make it return a plist. The
contents can come e.g. from the env or a config file. Make
identifiers starting with an underscore denote system identifiers
which must be implemented by hypervisor. (yea, j/k about the plist bit)
 1.140  28-Apr-2013  pooka Appearances count: spell "IPL_NONE" correctly.
 1.139  28-Apr-2013  pooka Improve the time-related hypercalls so that's it's possible to
sleep until an absolute time on the host's monotonic clock (should
something like that be supported).
 1.138  27-Apr-2013  pooka * treat kern_malloc.c as an unreal allocator (it's so lightweight)
* get rid of the rumpuser_realloc() hypercall
* pass size to rumpuser_free()
 1.137  10-Mar-2013  pooka Use kern_malloc.c instead of the relegated allocators in memalloc.c.
Previously this didn't make sense due to the use of kmem_map, but the
new malloc is more dynamic and puts sense into using it.
 1.136  06-Mar-2013  yamt simplify code
add a comment
 1.135  29-Jan-2013  para make vmem(9) ready to be used early during bootstrap to replace extent(9)
pass memory for vmem structs into the initialization function and
do away with the static pool of vmem structs.
remove special bootstrapping of the quantum cache pools of the kmem_va_arena
as memory for pool_caches is allocated via pool_allocator_meta which is
fully operational at this point.
 1.134  26-Jan-2013  para revert previous commit not yet fully functional, sorry
 1.133  26-Jan-2013  para make vmem(9) ready to be used early during bootstrap to replace extent(9).
pass memory for vmem structs into the initialization functions and
do away with the static pools for this.
factor out the vmem internal structures into a private header.
remove special bootstrapping of the kmem_va_arena as all necessary memory
comes from pool_allocator_meta wich is fully operational at this point.
 1.132  14-Jan-2013  pooka Don't use __weak_alias where the component framework is sufficient.
 1.131  13-Nov-2012  pooka kill some -Wunused-but-set-variable warnings
 1.130  27-Jul-2012  pooka branches: 1.130.2;
Use mmap hypercall for memory allocation only when absolutely necessary
(map == module_map). Otherwise, use the malloc hypercall. This avoids
relying on the platform's mmap() to be able to return arbitrarily
alignment memory.
 1.129  20-Jul-2012  pooka Make it possible to select between real and unreal allocators from
make. Plus some gratuitous renaming.
 1.128  20-Jul-2012  pooka make unreal allocators work again
 1.127  05-Jun-2012  jym Now that pool_cache_invalidate() is synchronous and can handle per-CPU
caches, merge together pool_drain_start() and pool_drain_end() into

bool pool_drain(struct pool **ppp);

"bool" value indicates whether reclaiming was fully done (true) or not (false)
"ppp" will contain a pointer to the pool that was drained (optional).

See http://mail-index.netbsd.org/tech-kern/2012/06/04/msg013287.html
 1.126  23-May-2012  martin Recently uvm_page_locked_p() leaked outside of uvm/MD code, so rump
needs to provide one.
 1.125  17-Mar-2012  hannken Don't take a mutex we already took 6 lines above.
 1.124  05-Mar-2012  para adjust rump for static pool_cache count
should have went in with subr_vmem 1.73
 1.123  19-Feb-2012  martin Adapt to constification in sys/uvm/uvm_export.h
 1.122  29-Jan-2012  njoly branches: 1.122.2;
Move pool subsystem init from rump__init() to uvm_init(), following
kernel code. Fix RUMP_LOCKDEBUG early panic.
 1.121  27-Jan-2012  para 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
 1.120  31-Oct-2011  yamt branches: 1.120.2; 1.120.6;
replace a non us-ascii character in a comment
 1.119  02-Sep-2011  christos trylockowner is not needed anymore.
 1.118  01-Sep-2011  christos fix the build for rumpserver.
 1.117  19-Jun-2011  hannken Make ubc_purge() a noop.
 1.116  12-Jun-2011  mrg include uvm_object.c in the rump kernel for the new uvm_obj* functions.
don't build the uvm_object.c uvm_object_printit() for _RUMPKERNEL. (XXX)
add empty panic() stubs for uvm_loanbreak() and ubc_purge().

fixes some more 5.99.53 rump build issues.
 1.115  12-Jun-2011  rmind 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.
 1.114  21-Mar-2011  pooka branches: 1.114.2;
Update copyright statements.

no functional change.
 1.113  22-Feb-2011  pooka Shuffle the pagedaemon algorithm a bit to record the number of
pageouts active and give up only if the pagedaemon could not free
memory and there are no outstanding pageouts.

This should fix the "out of memory" pauses reported by Mihai Chelaru
and Taylor R Campbell. Tested by copying files to and from an ffs
backed by /dev/wd0 (with and without -o log) using a 1MB rump kernel
memory limit.
 1.112  22-Feb-2011  pooka complete the incomplete pagesize rototill
 1.111  10-Feb-2011  pooka Make vmapbuf() return success/error and make physio deal with a
failure.
 1.110  10-Feb-2011  pooka Set b_error in vunmapbuf() if copyout_proc fails.
XXX: what if copyin fails in vmapbuf()?
 1.109  05-Feb-2011  pooka Use correct strtoululululu variant.

from Taylor R Campbell
 1.108  22-Jan-2011  pooka Add a comment explaning why uvm_reclaim_hook is not currently
necessary for rump.

XXX: strictly speaking, the zfs implementation does not work
correctly since it just wakes up a thread instead of performing
the scan in the context of the pagedaemon
 1.107  18-Jan-2011  haad branches: 1.107.2;
Add support for compiling ZFS and Solaris modules as RUMP libraries. Add
some locking and rumpcopy primitives and refactor module building Makefiles
to work with both RUMP and kernel modules. This is first part of adding
support for regular test of zfs on NetBSD to hunt some bugs and make it
stable.

Ok by pooka@.
 1.106  13-Jan-2011  pooka branches: 1.106.2;
Introduce RUMP_LOCALPROC_P() macro and use it.
 1.105  08-Jan-2011  pooka Do a minidehumanizenumber for RUMP_MEMLIMIT. Now you can set it
to e.g. 16m instead of having to type out 16777216.
 1.104  01-Dec-2010  pooka If the pagedaemon cannot free any memory due to not being able to
lock any uvm objects, check if lockholders are currently on CPU
and yield to try very soon again instead of assuming deadlock.

This makes limited-memory kernels perform the same as memory-unlimited
kernels (provided there is a reasonable amount of memory available).
For example, for large file copy off of ffs where the image is
backed on host memory (i.e. no disk i/o, i.e. ideal conditions)
the figures are, per rump kernel memory limit:

3000kB: same
1000kB: 10% slower
500kB: 50% slower

(per pagedaemon code might still be able to use some tweak, though)
 1.103  01-Dec-2010  pooka Make uvm_pagealloc_tele() fail if the request can't be immediately
satisfied. This allows the caller to unlock the object and the
pagedaemon to avoid deadlock even if ~all memory is consumed by
one vm object. This in turn makes is possible to copy a large file
into a rump kernel with a 10MB memory limit (where large >> 10MB).
A little more tuning will be required to avoid the pagedaemon
hitting the sleep-and-retry path, though.

+ fix some outdated unrelated comments
 1.102  22-Nov-2010  pooka Support physio for remote processes.
==> add support for remote vmspace vmapbuf/vunmapbuf
==> add proper support for copyin/out_vmspace
==> add support for remote vmspace uvm_io
==> add support for non-curproc rumpuser_sp_copyin/out
==> store remote context in vm_map->pmap instead of
pthread_specificdata

In short, makes read/write of most (all?) block devices work from
a remote rump client via rump syscalls.
 1.101  17-Nov-2010  pooka cleanup some old garbage
 1.100  16-Nov-2010  uebayasi Define uvmexp_pagemask and friends used by sparc to set PAGE_SIZE,
PAGE_MASK, PAGE_SHIFT dynamically.
 1.99  12-Nov-2010  uebayasi Abstraction fix; move physical address -> per-page metadata (struct
vm_page *) "reverse" lookup code from uvm_page.h to uvm_page.c, to
help migration to not do that.

Likewise move per-page metadata (struct vm_page *) -> physical
address "forward" conversion code into *.c too. This is called
only low-layer VM and MD code.
 1.98  27-Oct-2010  pooka Start rework of system call proxying over socket ("sysproxy").
This incarnation is written in the user namespace as opposed to
the previous one which was done in kernel namespace. Also, rump
does all the handshaking now instead of excepting an application
to come up with the user namespace socket.

There's still a lot to do, including making code "a bit" more
robust, actually running different clients in a different process
inside the kernel and splitting the client side library from librump.
I'm committing this now so that I don't lose it, plus it generally
works as long as you don't use it in unexcepted ways: i've tested
ifconfig(8), route(8), envstat(8) and sysctl(8).
 1.97  13-Oct-2010  pooka Don't reorder page on the age queue if the lookup is done by the
pagedaemon. This mimics normal kernel behaviour where pmap_kentered
mappings are not tracked for references. Without this change the
vnode pager's clustering could cause one page to be released by
the pagedaemon, and the rest of the pages in the pageout cluster
made unlikely candidates to be released soon.
 1.96  24-Sep-2010  rmind Fixes/improvements to RB-tree implementation:
1. Fix inverted node order, so that negative value from comparison operator
would represent lower (left) node, and positive - higher (right) node.
2. Add an argument (i.e. "context"), passed to comparison operators.
3. Change rb_tree_insert_node() to return a node - either inserted one or
already existing one.
4. Amend the interface to manipulate the actual object, instead of the
rb_node (in a similar way as Patricia-tree interface does).
5. Update all RB-tree users accordingly.

XXX: Perhaps rename rb.h to rbtree.h, since cleaning-up..

1-3 address the PR/43488 by Jeremy Huddleston.

Passes RB-tree regression tests.
Reviewed by: matt@, christos@
 1.95  09-Sep-2010  pooka * unlock object in "error" branch
* fix typo (not in comment)
* improve indentation tailspin
 1.94  09-Sep-2010  pooka Assert that object is locked in page unbusy.
 1.93  08-Sep-2010  pooka Actually, we want to say "no aobjs" instead of "only vnodes" to
make component boundaries go right.
 1.92  08-Sep-2010  pooka Improve pagedaemon performance:
* page out vnode objects
* drain kmem/kernel_map

As long as there is a reasonable memory hardlimit (>600kB or so),
a rump kernel can now survive file system metadata access for an
arbitrary size file system (provided, of course, that the file
system does not use wired kernel memory for metadata ...).

Data handling still needs a little give&take finetuning. The
general problem is that a single vm object can easily be the owner
of all vm pages in a rump kernel. now, if a thread wants to allocate
memory while holding that object locked, there's very little the
pagedaemon can do to avoid deadlock. but I think the problem can
be solved by making an object release a page when it wants to
allocate a page if a) the system is short on memory and b) too many
pages belong to the object. that still doesn't take care of the
pathological situation where 1000 threads hold an object with 1
page of memory locked and try to allocate more. but then again,
running 1000 threads with <1MB of memory is an unlikely scenario.
and ultimately, I call upon the fundamental interaction which is
the basis of why any operating works: luck.
 1.91  07-Sep-2010  pooka Make the Diabolical (Page)Daemon Director drain vfs buffers when
we are short of memory.

There are still some funnies left to iron out. For example, with
a certain file system / memory size configuration it's still not
possible to create enough files to make the file system run out of
inodes before the kernel runs out of memory. Also, with some other
configurations disk access slows down gargantually (though i'm sure
there are >0 buffers available). Anyway, it ~works for now and
it's by no means worse than what it was before.
 1.90  07-Sep-2010  pooka Improve page allocator performance by using pool_cache for the
structure itself and allocating the backing page directly from the
hypervisor.

* initial write to a large tmpfs file is almost 2x faster
* truncating the file to 0 length after write is over 50% faster
* rewrite of the file is just slightly faster (indicating that
kmem does a good job with caching, as expected)
 1.89  07-Sep-2010  pooka Use rb_tree for page lookup instead of list. Unshockingly, this
makes dealing with large uobjs (files) quite a bit faster.
 1.88  06-Sep-2010  pooka Use standard uvm aobj pager. Most of the kernel aobj pager complexity
comes from swap handling, but that is included only with VMSWAP.
 1.87  29-Jul-2010  hannken Correct previous. Skip marker pages in uvm_pagelookup().
Already awake :-)
 1.86  29-Jul-2010  pooka Remove questionable KASSERT from previous. hannken can look at
this more closely when he wakes up. Normally I wouldn't be in such
a huge rush, but due to atf bug #53 the whole test run breaks now.
At least with the KASSERT removed all tests pass again.
 1.85  29-Jul-2010  hannken Add vm page flag PG_MARKER and use it to tag dummy marker pages
in genfs_do_putpages() and uao_put().
Use 'v_uobj.uo_npages' to check for an empty memq.
Put some assertions where these marker pages may not appear.

Ok: YAMAMOTO Takashi <yamt@netbsd.org>
 1.84  14-Jun-2010  pooka Make it possible to define an upper limit for memory consumed by
the rump kernel by specifying RUMP_MEMLIMIT. In case allocation
over that limit is attempted, essentially pool reclaim and uvm_wait()
is done. The default is to allow to allocate as much as the host
will give.

XXX: uvm_km_alloc and malloc(9) do not currently conform. the
former is easy, the latter requires kern_malloc.c (rump malloc is
currently directly relegated to host malloc).
 1.83  10-Jun-2010  pooka Use kern_proc.c instead of a collection of stubs. But what we
really wanted from this commit was the support for proc_specificdata.

TODO: make creating a new process actually use kern_proc and
maybe even add an interface which starts a process with
"any pid you don't like"
 1.82  09-Jun-2010  pooka On amd64, allocate module_map memory from the lowest 2GB.
 1.81  09-Jun-2010  pooka Add the ability to specify a preferred address the "map anon memory"
hypercall.
 1.80  03-Jun-2010  pooka Implement a sort-of pagedaemon: adjust all memory allocators to go
through an in-rumpkernel hypermemory allocator which knows it should
kick the pagedaemon and block in case ``waitok'' memory allocation
fails.

This allows us to recover from some out-of-memory situations.
Realworld'istically speaking (as opposed to whatever "should be"
theory), these OOM situations will happen extremely rarely if ever
when our hypervisor is a regular process. Speculatively, this
should be useful for other types of hosts.

issues remaining:
* the hypervisor does not know how to reclaim kernel memory (and
for the reason I stated above, I'm not sure if it makes sense
to teach the current implementation about that)
* vfs memory (buffers, vm object pages etc.) is not reclaimed
 1.79  02-Jun-2010  pooka rumpvm_init -> uvm_init to get rid of local prototype.
no functional change
 1.78  01-Jun-2010  pooka Don't pass "canfail" down to rumpuser_malloc -- there's quite little
we can do with that info way down there. Instead, pass alignment.
Implement rumpuser_malloc() with posix_memalign().
 1.77  01-Jun-2010  pooka Always use rumpuser_malloc() for allocating both poolpage and
poolpage_cache -- its bootstrap cost is slightly higher than
anonmmap, but it's faster in the long run.
 1.76  01-Jun-2010  pooka * remove rumpvm_makepage, just use uvm_pagealloc()
* update copyright to reflect reality a little better
 1.75  26-May-2010  pooka print vm object refcount
 1.74  14-May-2010  pooka Pick up after people who find build-testing their changes too difficult.
 1.73  11-May-2010  pooka uvm_object_printit() should be wrapped in DEBUGPRINT
 1.72  28-Apr-2010  pooka Instead of causing a catastrophic failure when uvm_loanuobjpages()
is called, just pretend it hit a wired page and return EBUSY. This
should cause callers to use a non-loaning access path instead.

Fixes file read path of stock nfs kernel module (previously it was
easy to just frob the nfsd_use_loan boolean into the other position
by simple value assingment, but now that nfsserver can be autoloaded
at runtime into the rump kernel, that approach is a little more
challenging since the variable isn't available in application
linkage. yes, things like adding a sysctl for the variable would
work, but now everything works out-of-the-box).
 1.71  21-Apr-2010  pooka support kern_resource
 1.70  04-Dec-2009  pooka branches: 1.70.2; 1.70.4;
g/c unused functions (previously used by the vnode pager).
 1.69  04-Dec-2009  pooka Implement enough of uvm_mmap() to make the creative proplib ioctl
copyout code work. No comments ... okok, if that'll make you leave
me alone: it's ioctl, so it's supposed to be funky (with a score
or two of psychedelic rock).
 1.68  04-Dec-2009  pooka Provide the default_mapaddr method in default rump emul (since some
kernel callers want to use it).
 1.67  04-Nov-2009  pooka Pull all relegating memory allocators under a common roof in memalloc.c
 1.66  04-Nov-2009  pooka Use std. uiomove() & friends.
 1.65  21-Oct-2009  rmind Sync rump with kernel changes.
 1.64  21-Oct-2009  rmind 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>.
 1.63  19-Oct-2009  pooka remove stale uvm_readahead() stub
 1.62  16-Oct-2009  pooka Include sys_select.c for proper select()/poll() support.
 1.61  04-Aug-2009  pooka * support uvm_pagermapin/out(), adapt uvm_pageratop()

Instead of doing actual page remapping, which we can't portably
do in userspace without extensive trickery (read: signals), simply
allocate the kva window with new physical backing, copy page
contents, return, and copy contents back in mapout. Since the
pages are locked during the mapping cycle, we can do this without
hazard.

* add lots of stubbies necessary for new stuff coming soon
 1.60  03-Aug-2009  pooka g/c cachepgmtx, i have no idea what it was supposed to be useful for.
 1.59  03-Aug-2009  pooka track number of pages associated with vm object
 1.58  10-Jun-2009  he Add a dummy uvm_readahead() function, to fix build issues after it
recently got added to the kernel.
OK'ed by pooka@
 1.57  03-Jun-2009  pooka Add user vmspace locking and remapping routines. Obviously, these
currently work only if the vmspace is local to the rump kernel.
 1.56  03-May-2009  pooka define DEBUGPRINT
 1.55  28-Apr-2009  pooka Free uao lock when destroying object. Fixes tmpfs rename leak
reported by njoly.
 1.54  24-Apr-2009  pooka * init pool linksets, makes proplib work. reported by Arnaud Ysmal.
(linksets, sigh)
* reduce #ifdef for RUMP_USE_REAL_ALLOCATORS
 1.53  18-Mar-2009  cegger Ansify function definitions w/o arguments. Generated with sed.
 1.52  06-Feb-2009  pooka branches: 1.52.2;
Call uvm_page_unbusy() instead of manually yanking PG_BUSY out.
 1.51  23-Jan-2009  pooka last-minute pasto in previous
 1.50  23-Jan-2009  pooka Add a compile-time option to use kmem/vmem/pools from the kernel
sources instead of homegrown allocators. Default to "on", even
though they appear to be a few percent slower at least on short
jobs (e.g. untar to tmpfs).
 1.49  04-Jan-2009  pooka Include libkern contents in librump.
 1.48  18-Dec-2008  pooka __KERNEL_RCSID
 1.47  16-Dec-2008  pooka Mark pages busy during VOP_PUTPAGES(). Deals with KASSERT in nfs write.
 1.46  16-Dec-2008  pooka Make rumpflushva flush only the atop info for a certain uvm object.
Better, but still not completely race-free (if two threads call
RUMP_VOP_PUTPAGES() directly for the same vm object).
 1.45  27-Nov-2008  pooka Move more vfs-related vm routines from rumpkern to rumpvfs.
 1.44  27-Nov-2008  pooka Remove the whole magic ubc window thingie. All file systems use
ubc_uiomove() now, so we can hook ourselves there.
 1.43  26-Nov-2008  pooka Add a few symbols required by nfsd
 1.42  19-Nov-2008  pooka Split vfs out of rumpkern into rumpvfs. Non-fs rumps no longer
include the file system code. File system rumps explicitly need
to include rumpvfs from now on.
 1.41  15-Oct-2008  pooka branches: 1.41.2; 1.41.8;
Add support bits necessary for rumpnet functionality.
 1.40  10-Oct-2008  pooka * implement uvm_km_alloc/free_poolpage()
* add silly stubs for uvm_lwp_hold/rele()
 1.39  10-Oct-2008  pooka reorganize routines a bit better. no functional change
 1.38  30-Sep-2008  pooka Make sure proc0.p_vmspace qualifies as VMSPACE_IS_KERNEL_P().
 1.37  07-Aug-2008  pooka pg->flags &= PG_CLEAN --> &= ~PG_CLEAN;

Fixes at least writing to the fs for msdosfs.
 1.36  05-Aug-2008  pooka Honor PG_RELEASED when unbusying a page.

Fixes ufs file system full problem discovered by Simon Burge.
 1.35  04-Aug-2008  pooka Add support for using real kmem/vmem. Don't enable it by default,
though, since it a) is a lot of unnecessary indirection in rump
b) requires callouts which are so far unimplemented.
 1.34  29-Jul-2008  pooka Install rump libraries and utilities to the base system and remove the
private non-installed build infrastructure from sys/rump.

breakdown of commit:
* install relevant headers into /usr/include/rump
* build sys/rump/librump/rumpuser and sys/rump/librump/rumpkern
from src/lib and install as librumpuser and librump, respectively
+ this retains the ability to test a librump build with just the
kernel sources at hand
* move sys/rump/fs/lib/libukfs and sys/rump/fs/lib/libp2k to src/lib
for general consumption, they are not kernel-space dwellers anyway
* build and install sys/rump/fs/lib/lib$fs as librumpfs_$fs
* add chapter 3 manual pages for rump, rumpuser, ukfs and p2k
* build and install userspace kernel file system daemons if MKPUFFS=yes
is spexified
* retire fsconsole for now, it will make a comeback with an actually
implemented version shortly
 1.33  20-Jul-2008  pooka assert -> KASSERT
 1.32  05-Jun-2008  ad branches: 1.32.2; 1.32.4;
Make it build again.
 1.31  04-Jun-2008  ad Make it build.
 1.30  11-Mar-2008  pooka branches: 1.30.2; 1.30.4; 1.30.6;
Backup some fixes for recent breakage from local tree. Also some
other improvements such as exporting the real kernel namei and
using that in ukfs instead of the homegrown heap'o hacks namei.
"etcetc".
 1.29  27-Jan-2008  pooka branches: 1.29.2; 1.29.6;
honor pager locking protocol in uao_detach()
 1.28  27-Jan-2008  pooka Fix locking botches: take vm object lock before calling pager,
not inside the pager.
 1.27  03-Jan-2008  pooka Theoretically this is supposed to be interchangeable with real
kernel code. Use kmem_alloc/free instead of some wily homerolled
rump interfaces for memory allocation.
 1.26  02-Jan-2008  pooka fix vmlocking2 fallout:

* I heard a wild rumor that vp_interlock is a mutex these days (hi ad!)
* init new locks (hi ad)
* observe that with simple_locks only deadlocks would be caught while
releasing unlocked locks would go unnoticed. make locking work (hi pooka)
 1.25  02-Jan-2008  ad Merge vmlocking2 to head.
 1.24  01-Dec-2007  yamt branches: 1.24.2; 1.24.6;
constify pagerops.
 1.23  06-Nov-2007  pooka Fix locking issues with the anonymous pager too so that tmpfs can work.
 1.22  06-Nov-2007  pooka Sprinkle some more locking, especially to the vm. Due to some
additional fixes, it's now possible to run file systems with
spinlocks actually enabled. The genfs_putpages() locking is still
working only due to greater powers, but I'll eventually get around to
fixing it.
 1.21  04-Nov-2007  pooka branches: 1.21.2;
* sprinkle some locking into the vm code
* avoid extra insert+search+remove step in file systems using
ubc_uiomove() instead of standard uiomove()
 1.20  31-Oct-2007  pooka branches: 1.20.2;
Make it possible to run rumps multithreaded. This brings real
locking and makes it possible to run file systems which create
threads. It also makes rump file system behaviour better match
file system behaviour in the kernel.
 1.19  28-Oct-2007  pooka In uvm_estimatepageable() "estimate" pageable.
 1.18  10-Oct-2007  ad branches: 1.18.2;
Merge from vmlocking:

- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
 1.17  12-Sep-2007  pooka branches: 1.17.2;
don't allocate variable-sized arrays from the stack
 1.16  01-Sep-2007  pooka branches: 1.16.2;
Make bioops a pointer and point it to the softdeps struct in softdep
init. Decouples "options SOFTDEP" from the main kernel and ffs code.
 1.15  01-Sep-2007  pooka * add a very crude version of uvm_pageatop()
* add biodone/aiodone
 1.14  26-Aug-2007  pooka branches: 1.14.2;
few panicky functions
 1.13  20-Aug-2007  pooka branches: 1.13.2;
Hide NetBSD kernel headers completely from ukfs. This includes creating
accessors for:
* struct mount & VFS ops
* struct uio
* struct vnode
* struct vattr

and some namespace games for:
* namei flags
* VOPs
* enum vtype

Also, split rump services into two categories: library private and public
(rump_private.h and rump.h, respectively).

As a result, it is now possible to compile and use the NetBSD kernel
file systems on Linux (and probably other systems too with very
little work), although the makefiles need a bit of work to make it
a pleasureable experience.
 1.12  14-Aug-2007  pooka branches: 1.12.2;
Kill handrolled buffercache and use vfs_bio from the kernel. This is
mostly to get the flag jungle in sync with the kernel.
 1.11  13-Aug-2007  pooka Use supermarket variety vfs_vnops.c instead of homecooked routines
(that's actually a good thing here).
 1.10  11-Aug-2007  pooka * move rump_vopwrite_fault() into history - we now support the file
system faulting in pages if it does e.g. fragment reallocation
* get rid of rumpvm_findpage() and always use uvm_pagelookup()
* determine a vnode's cleanness by flagging it as being on the work
list if we "take" a write fault and removing it from the worklist
once pages are flushed. There is no work list here, but at least
there is symmetry with the kernel.
 1.9  09-Aug-2007  pooka Play catchup with ufs/ffs changes: compile subr_specificdata.c
and emulate kmem_foo() to support the prior.
 1.8  09-Aug-2007  pooka Fix it a bit & wait for the dust to settle. Also, enable UBC by default.

ffs in userspace on top of puffs/p2k/rump is now stable enough to
host a make -j4 kernel build (well, at least my kernel build ...
but, yes, I am currently running that kernel on my desktop)
 1.7  09-Aug-2007  pooka Add some stubs for lfs.
 1.6  07-Aug-2007  pooka remove the allocstorage param from makepage - not needed
 1.5  07-Aug-2007  pooka track dirty vm objects
 1.4  07-Aug-2007  pooka When doing "ubc faults", truncate offsets to page boundary to get
the last page also if it's accessed from the middle of the page.
 1.3  06-Aug-2007  pooka branches: 1.3.2;
Instead of going for a PAGE_SIZE nuke, do getpages() in a more
sniper style. Makes efs (& other file systems with bsize < PAGE_SIZE)
work better.
 1.2  06-Aug-2007  pooka implement uvm_vnp_zerorange()
 1.1  05-Aug-2007  pooka Introduce RUMPs - Runnable Userspace Meta-Programs

/sys/rump contains programs which run unmodified kernel code in an
emulated userspace environment. The kernel environment is provided
by librump. Currently supported are a number of file systems,
which by using puffs integrate seamlessly into the system and
provide a similar user experience to if the code was running as
part of the kernel. Potential future rumpification targets include
for example parts of the networking stack and some device drivers.

This work was supported by Google Summer of Code 2007.
 1.3.2.2  06-Aug-2007  pooka Instead of going for a PAGE_SIZE nuke, do getpages() in a more
sniper style. Makes efs (& other file systems with bsize < PAGE_SIZE)
work better.
 1.3.2.1  06-Aug-2007  pooka file vm.c was added on branch matt-mips64 on 2007-08-06 20:46:29 +0000
 1.12.2.3  03-Sep-2007  skrll Sync with HEAD.
 1.12.2.2  15-Aug-2007  skrll Sync with HEAD.
 1.12.2.1  14-Aug-2007  skrll file vm.c was added on branch nick-csl-alignment on 2007-08-15 13:50:43 +0000
 1.13.2.3  09-Oct-2007  ad Sync with head.
 1.13.2.2  20-Aug-2007  ad Sync with HEAD.
 1.13.2.1  20-Aug-2007  ad file vm.c was added on branch vmlocking on 2007-08-20 22:07:31 +0000
 1.14.2.4  23-Mar-2008  matt sync with HEAD
 1.14.2.3  09-Jan-2008  matt sync with HEAD
 1.14.2.2  08-Nov-2007  matt sync with -HEAD
 1.14.2.1  06-Nov-2007  matt sync with HEAD
 1.16.2.8  17-Mar-2008  yamt sync with head.
 1.16.2.7  04-Feb-2008  yamt sync with head.
 1.16.2.6  21-Jan-2008  yamt sync with head
 1.16.2.5  07-Dec-2007  yamt sync with head
 1.16.2.4  15-Nov-2007  yamt sync with head.
 1.16.2.3  27-Oct-2007  yamt sync with head.
 1.16.2.2  03-Sep-2007  yamt sync with head.
 1.16.2.1  01-Sep-2007  yamt file vm.c was added on branch yamt-lazymbuf on 2007-09-03 14:45:38 +0000
 1.17.2.1  14-Oct-2007  yamt sync with head.
 1.18.2.1  13-Nov-2007  bouyer Sync with HEAD
 1.20.2.6  03-Dec-2007  joerg Sync with HEAD.
 1.20.2.5  06-Nov-2007  joerg Sync with HEAD.
 1.20.2.4  04-Nov-2007  jmcneill Sync with HEAD.
 1.20.2.3  02-Nov-2007  joerg Remove the rest of the unintentional diff in sys/rump.
 1.20.2.2  31-Oct-2007  joerg Sync with HEAD.
 1.20.2.1  31-Oct-2007  joerg file vm.c was added on branch jmcneill-pm on 2007-10-31 23:14:18 +0000
 1.21.2.3  18-Feb-2008  mjf Sync with HEAD.
 1.21.2.2  08-Dec-2007  mjf Sync with HEAD.
 1.21.2.1  19-Nov-2007  mjf Sync with HEAD.
 1.24.6.2  08-Jan-2008  bouyer Sync with HEAD
 1.24.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.24.2.1  28-Dec-2007  ad Make rump build.
 1.29.6.5  17-Jan-2009  mjf Sync with HEAD.
 1.29.6.4  05-Oct-2008  mjf Sync with HEAD.
 1.29.6.3  28-Sep-2008  mjf Sync with HEAD.
 1.29.6.2  05-Jun-2008  mjf Sync with HEAD.

Also fix build.
 1.29.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.29.2.1  24-Mar-2008  keiichi sync with head.
 1.30.6.3  10-Oct-2008  skrll Sync with HEAD.
 1.30.6.2  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.30.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.30.4.6  09-Oct-2010  yamt sync with head
 1.30.4.5  11-Aug-2010  yamt sync with head.
 1.30.4.4  11-Mar-2010  yamt sync with head
 1.30.4.3  19-Aug-2009  yamt sync with head.
 1.30.4.2  20-Jun-2009  yamt sync with head
 1.30.4.1  04-May-2009  yamt sync with head.
 1.30.2.1  17-Jun-2008  yamt sync with head.
 1.32.4.2  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.32.4.1  19-Oct-2008  haad Sync with HEAD.
 1.32.2.2  31-Jul-2008  simonb Sync with head.
 1.32.2.1  21-Jul-2008  simonb Sync with head.
 1.41.8.3  19-Dec-2013  matt Adapt to new uvm_estimatepageable arguments
 1.41.8.2  10-Feb-2012  matt uvm_pageout_done doesn't return anything more (it's void).
 1.41.8.1  09-Feb-2012  matt Update uvm_pageout_done defintion.
 1.41.2.3  28-Apr-2009  skrll Sync with HEAD.
 1.41.2.2  03-Mar-2009  skrll Sync with HEAD.
 1.41.2.1  19-Jan-2009  skrll Sync with HEAD.
 1.52.2.2  23-Jul-2009  jym Sync with HEAD.
 1.52.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.70.4.6  12-Jun-2011  rmind Sync RUMP's uvm_pagealloc_strat() and processpage() with branch changes.
 1.70.4.5  21-Apr-2011  rmind sync with head
 1.70.4.4  05-Mar-2011  rmind sync with head
 1.70.4.3  03-Jul-2010  rmind sync with head
 1.70.4.2  30-May-2010  rmind sync with head
 1.70.4.1  16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.70.2.5  06-Nov-2010  uebayasi Sync with HEAD.
 1.70.2.4  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.70.2.3  17-Aug-2010  uebayasi Sync with HEAD.
 1.70.2.2  30-Apr-2010  uebayasi Sync with HEAD.
 1.70.2.1  29-Apr-2010  uebayasi Fix build of rump.
 1.106.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.107.2.3  05-Mar-2011  bouyer Sync with HEAD
 1.107.2.2  17-Feb-2011  bouyer Sync with HEAD
 1.107.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.114.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.120.6.5  02-Jun-2012  mrg sync to latest -current.
 1.120.6.4  05-Apr-2012  mrg sync to latest -current.
 1.120.6.3  06-Mar-2012  mrg sync to -current
 1.120.6.2  24-Feb-2012  mrg sync to -current.
 1.120.6.1  18-Feb-2012  mrg merge to -current.
 1.120.2.10  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.120.2.9  23-Jan-2013  yamt sync with head
 1.120.2.8  16-Jan-2013  yamt sync with (a bit old) head
 1.120.2.7  02-Nov-2012  yamt fix a merge botch
 1.120.2.6  30-Oct-2012  yamt sync with head
 1.120.2.5  17-Apr-2012  yamt sync with head
 1.120.2.4  25-Jan-2012  yamt uvm_loanabj: take an access pattern hint.
 1.120.2.3  14-Jan-2012  yamt implement a rump stub of uvm_loanobj
 1.120.2.2  10-Nov-2011  yamt remove uobj->memq
 1.120.2.1  02-Nov-2011  yamt page cache related changes

- maintain object pages in radix tree rather than rb tree.
- 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.
- fix nfs commit range tracking.
- fix nfs write clustering. XXX hack
 1.122.2.2  03-Apr-2012  riz Pull up following revision(s) (requested by para in ticket #155):
sys/kern/subr_vmem.c: revision 1.73
sys/kern/subr_kmem.c: revision 1.43
sys/rump/librump/rumpkern/vm.c: revision 1.124
make accounting for vm_inuse sane
while here don't statically allocated for more caches then required
adjust rump for static pool_cache count
should have went in with subr_vmem 1.73
don't overallocated once we leave the caches
 1.122.2.1  25-Mar-2012  bouyer Pull up following revision(s) (requested by hannken in ticket #141):
tests/rump/rumpkern/t_vm.c: revision 1.3
sys/rump/librump/rumpkern/vm.c: revision 1.125
Don't take a mutex we already took 6 lines above.
Starting with Rev. 1.191 of kern/subr_pool.c a pool has to be inactive
for at least 10 seconds before it can be reclaimed.
Change the uvmwait test timeout from 10 to 30 seconds so it has a chance
to reclaim memory and succeed.
 1.130.2.5  03-Dec-2017  jdolecek update from HEAD
 1.130.2.4  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.130.2.3  23-Jun-2013  tls resync from head
 1.130.2.2  25-Feb-2013  tls resync with head
 1.130.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.144.4.1  18-May-2014  rmind sync with head
 1.152.2.1  10-Aug-2014  tls Rebase.
 1.159.4.6  28-Aug-2017  skrll Sync with HEAD
 1.159.4.5  05-Oct-2016  skrll Sync with HEAD
 1.159.4.4  19-Mar-2016  skrll Sync with HEAD
 1.159.4.3  27-Dec-2015  skrll Sync with HEAD (as of 26th Dec)
 1.159.4.2  06-Jun-2015  skrll Sync with HEAD
 1.159.4.1  06-Apr-2015  skrll Sync with HEAD
 1.159.2.1  31-Dec-2014  snj Pull up following revision(s) (requested by chs in ticket #363):
common/lib/libprop/prop_kern.c: revision 1.18
sys/arch/mac68k/dev/grf_compat.c: revision 1.27
sys/arch/x68k/dev/grf.c: revision 1.45
sys/external/bsd/drm/dist/bsd-core/drm_bufs.c: revision 1.12
sys/external/bsd/drm2/drm/drm_drv.c: revision 1.12
sys/external/bsd/drm2/drm/drm_vm.c: revision 1.6
sys/external/bsd/drm2/include/linux/mm.h: revision 1.4
sys/kern/vfs_vnops.c: revision 1.192 via patch
sys/rump/librump/rumpkern/vm.c: revision 1.160
sys/sys/file.h: revision 1.78 via patch
sys/uvm/uvm_device.c: revision 1.64
sys/uvm/uvm_device.h: revision 1.13
sys/uvm/uvm_extern.h: revision 1.192
sys/uvm/uvm_mmap.c: revision 1.150 via patch
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).
 1.169.2.1  26-Jul-2016  pgoyette Sync with HEAD
 1.170.6.2  19-May-2017  pgoyette Resolve conflicts from previous merge (all resulting from $NetBSD
keywork expansion)
 1.170.6.1  11-May-2017  pgoyette Sync with HEAD
 1.173.14.1  06-Jul-2021  martin Pull up following revision(s) - all via patch -
(requested by riastradh in ticket #1317):

sys/uvm/uvm_page.c: revision 1.248
sys/uvm/uvm_anon.c: revision 1.80
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.40
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.41
sys/rump/librump/rumpkern/vm.c: revision 1.191
sys/uvm/uvm_pager.c: revision 1.130
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.71
tests/rump/rumpkern/t_vm.c: revision 1.5
tests/rump/rumpkern/t_vm.c: revision 1.6
sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.39

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.

In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.

fix an incorrect assertion in the previous commit.

Handle PG_PAGEOUT in uvm_anon_release() too.

Commit the ZFS file that I forgot in this previous commit:

Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to
uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to
handle this flag separately. Split out the pages part of uvm_aio_aiodone()
into uvm_aio_aiodone_pages() in rump just like in the real kernel.

In ZFS functions that can fail to copy data between the ARC and VM pages,
use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can
handle these "I/O" errors. Fixes PR 55702.
update the rump copy of uvm_page_unbusy() to match the real version,
in particular handle PG_PAGEOUT. fixes a few atf tests.
the busypage test is buggy, expect it to fail.

make rump's uvm_aio_aiodone_pages() look more like the kernel version.
fixes some more rumpy assertions.

for the busypage test, replace atf_tc_expect_fail() with atf_tc_skip()
because atf apparently has no way to expect a test program to crash.
fixes PR 55945.
 1.173.10.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.182.2.2  29-Feb-2020  ad Sync with head.
 1.182.2.1  17-Jan-2020  ad Sync with head.
 1.190.2.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed