diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-09-05 11:44:47 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2021-09-05 11:44:47 +0000 |
commit | d89b9762bad2ed640923b056d6fcddd0a0e33fd3 (patch) | |
tree | f07325c6469083fef2162b03a5fa500773c4c2b7 /sys/kern | |
parent | 46ba0b771aca771d6a1475dc52f213536036fb15 (diff) |
Introduce dummy pagers for 'special' subsystems using UVM objects.
Some pmaps (x86, hppa) and the buffer cache rely on UVM objects to allocate
and manipulate pages. These objects should not be manipulated by uvm_fault()
and do not currently require the same locking enforcement.
Use the dummy pagers to explicitly document which UVM functions are meant to
manipulate UVM objects (uobj) that do not need the upcoming `vmobjlock' and
instead still rely on the KERNEL_LOCK().
Tested by many as part of a larger diff.
ok kettenis@, beck@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_biomem.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index b3472e9aee3..843d2e0a965 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_bio.c,v 1.206 2021/06/16 09:02:21 mpi Exp $ */ +/* $OpenBSD: vfs_bio.c,v 1.207 2021/09/05 11:44:46 mpi Exp $ */ /* $NetBSD: vfs_bio.c,v 1.44 1996/06/11 11:15:36 pk Exp $ */ /* @@ -560,7 +560,7 @@ bread_cluster_callback(struct buf *bp) struct uvm_object *oldobj = &bp->b_uobj; int page; - uvm_obj_init(newobj, NULL, 1); + uvm_obj_init(newobj, &bufcache_pager, 1); for (page = 0; page < atop(xbpp[i]->b_bufsize); page++) { struct vm_page *pg = uvm_pagelookup(oldobj, xbpp[i]->b_poffs + ptoa(page)); diff --git a/sys/kern/vfs_biomem.c b/sys/kern/vfs_biomem.c index 66dc4823bce..b3c41c6551a 100644 --- a/sys/kern/vfs_biomem.c +++ b/sys/kern/vfs_biomem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_biomem.c,v 1.49 2021/06/16 09:02:21 mpi Exp $ */ +/* $OpenBSD: vfs_biomem.c,v 1.50 2021/09/05 11:44:46 mpi Exp $ */ /* * Copyright (c) 2007 Artur Grabowski <art@openbsd.org> @@ -259,7 +259,7 @@ buf_alloc_pages(struct buf *bp, vsize_t size) KASSERT(bp->b_data == NULL); splassert(IPL_BIO); - uvm_obj_init(&bp->b_uobj, NULL, 1); + uvm_obj_init(&bp->b_uobj, &bufcache_pager, 1); /* * Attempt to allocate with NOWAIT. if we can't, then throw |