Home | History | Annotate | Download | only in rumpvfs
History log of /src/sys/rump/librump/rumpvfs/vm_vfs.c
RevisionDateAuthorComments
 1.42  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.41  09-Dec-2020  chs make rump's uvm_aio_aiodone_pages() look more like the kernel version.
fixes some more rumpy assertions.
 1.40  22-Oct-2020  chs branches: 1.40.2;
fix an incorrect assertion in the previous commit.
 1.39  18-Oct-2020  chs 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.
 1.38  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.37  18-Feb-2020  chs 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.
 1.36  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.35  13-Dec-2019  ad branches: 1.35.2;
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.34  18-Oct-2013  christos branches: 1.34.30; 1.34.34;
remove unused variable
 1.33  03-Jun-2012  rmind branches: 1.33.2; 1.33.4;
rumpvfs:
- ubc_uiomove: avoid the re-lock dance, since the lock is shared these days.
- uvm_aio_aiodone: acquire the lock before modifying the page flags.

Tested by martin@.
 1.32  19-Jun-2011  hannken branches: 1.32.2;
Revert previous. ubc_purge() is already defined in rumpkern/vm.c
 1.31  19-Jun-2011  hannken Add a noop wrapper for ubc_purge() to make file system tests work again.

Not really sure if this is the right way -- Antti?
 1.30  16-Jun-2011  hannken 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.
 1.29  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.28  21-Mar-2011  pooka branches: 1.28.2;
Update copyright statements.

no functional change.
 1.27  01-Mar-2011  pooka Pass accurate protection info from ubc_uiomove() to the pager.
Fixes nfs{,ro}_fileio tests on at least sparc64 (and probably macppc
and other fat endian machines).

The problem was that nfs was fooled to thinking read() caused a
write fault because of VM_PROT_WRITE being unconditionally set and
therefore set NMODIFIED on a r/o file system. It is absolutely
beyond me why the test worked on i386/amd64. Incidentally, I seem
to have "misplaced" a few goats.
 1.26  27-Feb-2011  pooka tmpfs has two layers of uvm objects (vnode->uobj and the anon object
in tmpfs_node), so when playing with pages make sure we lock the
uvm object the pages belong to instead of the vnode's uvm object.

per test from Nicolas Joly (which I'm sure he will commit soon ;)
 1.25  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.24  18-Dec-2010  pooka branches: 1.24.2; 1.24.4;
Don't loop eternally if uiomove() fails eternally (e.g. because
the connection to the client has been severed).
 1.23  09-Sep-2010  pooka Release PG_PAGEOUT pages in aiodone.
 1.22  09-Sep-2010  pooka hold object lock across page unbusy
 1.21  09-Sep-2010  pooka Use proper locking before unbusying pages.

Caught after yesterday's changes by the test suite (the ffs snapshot
test, to be precise).
 1.20  06-Sep-2010  pooka Make the pager loops more resilient against the aobj pager which is
lazy and doesn't like to return anything except the bare minimum.
(forgot to commit this earlier)
 1.19  06-Sep-2010  pooka pager wants truncated offsets
 1.18  06-Sep-2010  pooka simplify and fix len-to-npages calculation
 1.17  19-Aug-2010  pooka Use the same base pagerflags for both ubc_uiomove and ubc_zerorange.
 1.16  02-Jun-2010  pooka In aiodone, call uvm_pageout_done() with number of PG_PAGEOUT pages
processed.
 1.15  16-Dec-2009  pooka branches: 1.15.2; 1.15.4;
If zeroing len == 0, return immediately.
(kmem_alloc() doesn't like being called with size == 0)
 1.14  10-Nov-2009  pooka Code which uses pages fetched by the pager needs PGO_SYNCIO for
obvious reasons.
 1.13  18-Oct-2009  pooka Clear PG_FAKE for pages we wrote to. This avoids paging in data
we already have (and the backend might not yet have) in cases where
fs_bshift > PAGE_SHIFT.
 1.12  07-Oct-2009  pooka Use uvm_readahead.c instead of null stubs.
 1.11  05-Oct-2009  pooka Call the pager with page-aligned offsets, 'cause that's what the
pager expects. Fixes KASSERT failure if someone manages to do
otherwise.
 1.10  05-Aug-2009  pooka g/c uvm_aio_biodone1(). not used anymore.
 1.9  05-Aug-2009  pooka Clear PG_PAGEOUT in uvm_aio_aiodone()
 1.8  05-Aug-2009  pooka Use uvm_vnode.c instead of homerolled stuff.
 1.7  04-Aug-2009  pooka terminate comment too
 1.6  04-Aug-2009  pooka * supply pager flags in ubc_uiomove()
* implement uvm_aio_aiodone() (which is almost identical to the "real" one)
 1.5  18-Mar-2009  cegger branches: 1.5.2;
Ansify function definitions w/o arguments. Generated with sed.
 1.4  22-Feb-2009  ad PR kern/26878 FFSv2 + softdep = livelock (no free ram)
PR kern/16942 panic with softdep and quotas
PR kern/19565 panic: softdep_write_inodeblock: indirect pointer #1 mismatch
PR kern/26274 softdep panic: allocdirect_merge: ...
PR kern/26374 Long delay before non-root users can write to softdep partitions
PR kern/28621 1.6.x "vp != NULL" panic in ffs_softdep.c:4653 while unmounting a softdep (+quota) filesystem
PR kern/29513 FFS+Softdep panic with unfsck-able file-corruption
PR kern/31544 The ffs softdep code appears to fail to write dirty bits to disk
PR kern/31981 stopping scsi disk can cause panic (softdep)
PR kern/32116 kernel panic in softdep (assertion failure)
PR kern/32532 softdep_trackbufs deadlock
PR kern/37191 softdep: locking against myself
PR kern/40474 Kernel panic after remounting raid root with softdep

Retire softdep, pass 2. As discussed and later formally announced on the
mailing lists.
 1.3  18-Dec-2008  pooka branches: 1.3.2; 1.3.4; 1.3.6;
__KERNEL_RCSID
 1.2  27-Nov-2008  pooka Move more vfs-related vm routines from rumpkern to rumpvfs.
 1.1  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.3.6.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.3.4.4  28-Apr-2009  skrll Sync with HEAD.
 1.3.4.3  03-Mar-2009  skrll Sync with HEAD.
 1.3.4.2  19-Jan-2009  skrll Sync with HEAD.
 1.3.4.1  18-Dec-2008  skrll file vm_vfs.c was added on branch nick-hppapmap on 2009-01-19 13:20:27 +0000
 1.3.2.2  17-Jan-2009  mjf Sync with HEAD.
 1.3.2.1  18-Dec-2008  mjf file vm_vfs.c was added on branch mjf-devfs2 on 2009-01-17 13:29:38 +0000
 1.5.2.6  09-Oct-2010  yamt sync with head
 1.5.2.5  11-Aug-2010  yamt sync with head.
 1.5.2.4  11-Mar-2010  yamt sync with head
 1.5.2.3  19-Aug-2009  yamt sync with head.
 1.5.2.2  04-May-2009  yamt sync with head.
 1.5.2.1  18-Mar-2009  yamt file vm_vfs.c was added on branch yamt-nfs-mp on 2009-05-04 08:14:31 +0000
 1.15.4.5  12-Jun-2011  rmind Sync RUMP's rump_etfs_remove() and uvm_aio_aiodone() with branch changes.
 1.15.4.4  21-Apr-2011  rmind sync with head
 1.15.4.3  05-Mar-2011  rmind sync with head
 1.15.4.2  03-Jul-2010  rmind sync with head
 1.15.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.15.2.2  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.15.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.24.4.1  05-Mar-2011  bouyer Sync with HEAD
 1.24.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.28.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.32.2.4  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.32.2.3  02-Nov-2012  yamt fix a merge botch
 1.32.2.2  30-Oct-2012  yamt sync with head
 1.32.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.33.4.1  18-May-2014  rmind sync with head
 1.33.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.34.2  09-Jul-2021  martin Apply patch, requested by chs in ticket #1321:

sys/rump/librump/rumpvfs/vm_vfs.c (apply patch)

Adapt the changes from ticket #1317 (the uvm_pageqlock does not exist any
more in HEAD)
 1.34.34.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.34.30.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.35.2.2  29-Feb-2020  ad Sync with head.
 1.35.2.1  17-Jan-2020  ad Sync with head.
 1.40.2.1  14-Dec-2020  thorpej Sync w/ HEAD.

RSS XML Feed