UBC(9) | Kernel Developer's Manual | UBC(9) |
ubc
—
#include <uvm/uvm.h>
int
ubc_uiomove
(struct
uvm_object *uobj, struct
uio *uio, vsize_t
todo, int advice,
int flags);
void
ubc_zerorange
(struct
uvm_bject *uobj, off_t
off, size_t len,
int flags);
void
ubc_purge
(struct
uvm_object *uobj);
ubc_uiomove
() allocates an UBC memory window, performs
I/O on it and unmaps the window. The advice parameter is
the access pattern hint, which must be one of
and the flags parameter is
UBC memory window is a kernel mapping of uobj starting at offset offset.
Once the mapping is created, it must be accessed only by methods that can handle faults, such as uiomove(9) or kcopy(9). Page faults on the mapping will result in the object's pager method being called to resolve the fault.
Size of individual UBC memory window is limited to
ubc_winsize. ubc_uiomove
()
sequentially creates the UBC memory windows to eventually process the whole
range according to offset and
len parameters.
The mappings may be cached to speed future accesses to the same
region of the object, unless UBC_UNMAP
was specified
in flags parameter.
ubc_zerorange
() sets a range of bytes in a
UVM object to zero. The flags parameter takes the same
arguments as ubc_uiomove
().
ubc_purge
() disassociates all UBC
structures from an empty UVM object, specified by
uobj.
ubc
subsystem is implemented within the file
sys/uvm/uvm_bio.c.
Chuck Silvers, UBC: An Efficient Unified I/O and Memory Caching Subsystem for NetBSD, Proceedings of the FREENIX Track: 2000 USENIX Annual Technical Conference, USENIX Association, http://www.usenix.org/event/usenix2000/freenix/full_papers/silvers/silvers.pdf, 285-290, June 18-23, 2000.
May 12, 2018 | NetBSD 9.0 |