FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/asan.h>
#include <sys/bio.h>
#include <sys/bitset.h>
#include <sys/boottrace.h>
#include <sys/buf.h>
#include <sys/conf.h>
#include <sys/counter.h>
#include <sys/devicestat.h>
#include <sys/eventhandler.h>
#include <sys/fail.h>
#include <sys/ktr.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/kernel.h>
#include <sys/kthread.h>
#include <sys/proc.h>
#include <sys/racct.h>
#include <sys/refcount.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
#include <sys/syscallsubr.h>
#include <sys/vmem.h>
#include <sys/vmmeter.h>
#include <sys/vnode.h>
#include <sys/watchdog.h>
#include <geom/geom.h>
#include <vm/vm.h>
#include <vm/vm_param.h>
#include <vm/vm_kern.h>
#include <vm/vm_object.h>
#include <vm/vm_page.h>
#include <vm/vm_pageout.h>
#include <vm/vm_pager.h>
#include <vm/vm_extern.h>
#include <vm/vm_map.h>
#include <vm/swap_pager.h>
#include "opt_ddb.h"
Go to the source code of this file.
Data Structures | |
struct | bufqueue |
struct | bufdomain |
Macros | |
#define | BQ_LOCKPTR(bq) (&(bq)->bq_lock) |
#define | BQ_LOCK(bq) mtx_lock(BQ_LOCKPTR((bq))) |
#define | BQ_UNLOCK(bq) mtx_unlock(BQ_LOCKPTR((bq))) |
#define | BQ_ASSERT_LOCKED(bq) mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) |
#define | BD_LOCKPTR(bd) (&(bd)->bd_cleanq->bq_lock) |
#define | BD_LOCK(bd) mtx_lock(BD_LOCKPTR((bd))) |
#define | BD_UNLOCK(bd) mtx_unlock(BD_LOCKPTR((bd))) |
#define | BD_ASSERT_LOCKED(bd) mtx_assert(BD_LOCKPTR((bd)), MA_OWNED) |
#define | BD_RUN_LOCKPTR(bd) (&(bd)->bd_run_lock) |
#define | BD_RUN_LOCK(bd) mtx_lock(BD_RUN_LOCKPTR((bd))) |
#define | BD_RUN_UNLOCK(bd) mtx_unlock(BD_RUN_LOCKPTR((bd))) |
#define | BD_DOMAIN(bd) (bd - bdomain) |
#define | QUEUE_NONE 0 /* on no queue */ |
#define | QUEUE_EMPTY 1 /* empty buffer headers */ |
#define | QUEUE_DIRTY 2 /* B_DELWRI buffers */ |
#define | QUEUE_CLEAN 3 /* non-B_DELWRI buffers */ |
#define | QUEUE_SENTINEL 4 /* not an queue index, but mark for sentinel */ |
#define | BUF_DOMAINS 8 |
#define | TRANSIENT_DENOM 10 |
#define | BUF_CHECK_MAPPED(bp) do {} while (0) |
#define | BUF_CHECK_UNMAPPED(bp) do {} while (0) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static | MALLOC_DEFINE (M_BIOBUF, "biobuf", "BIO buffer") |
struct bufqueue | __aligned (CACHE_LINE_SIZE) |
static struct buf * | nbufp (unsigned i) |
static void | vm_hold_free_pages (struct buf *bp, int newbsize) |
static void | vm_hold_load_pages (struct buf *bp, vm_offset_t from, vm_offset_t to) |
static void | vfs_page_set_valid (struct buf *bp, vm_ooffset_t off, vm_page_t m) |
static void | vfs_page_set_validclean (struct buf *bp, vm_ooffset_t off, vm_page_t m) |
static void | vfs_clean_pages_dirty_buf (struct buf *bp) |
static void | vfs_setdirty_range (struct buf *bp) |
static void | vfs_vmio_invalidate (struct buf *bp) |
static void | vfs_vmio_truncate (struct buf *bp, int npages) |
static void | vfs_vmio_extend (struct buf *bp, int npages, int size) |
static int | vfs_bio_clcheck (struct vnode *vp, int size, daddr_t lblkno, daddr_t blkno) |
static void | breada (struct vnode *, daddr_t *, int *, int, struct ucred *, int, void(*)(struct buf *)) |
static int | buf_flush (struct vnode *vp, struct bufdomain *, int) |
static int | flushbufqueues (struct vnode *, struct bufdomain *, int, int) |
static void | buf_daemon (void) |
static __inline void | bd_wakeup (void) |
static int | sysctl_runningspace (SYSCTL_HANDLER_ARGS) |
static void | bufkva_reclaim (vmem_t *, int) |
static void | bufkva_free (struct buf *) |
static int | buf_import (void *, void **, int, int, int) |
static void | buf_release (void *, void **, int) |
static void | maxbcachebuf_adjust (void) |
static struct bufdomain * | bufdomain (struct buf *) |
static void | bq_remove (struct bufqueue *bq, struct buf *bp) |
static void | bq_insert (struct bufqueue *bq, struct buf *bp, bool unlock) |
static int | buf_recycle (struct bufdomain *, bool kva) |
static void | bq_init (struct bufqueue *bq, int qindex, int cpu, const char *lockname) |
static void | bd_init (struct bufdomain *bd) |
static int | bd_flushall (struct bufdomain *bd) |
static int | sysctl_bufdomain_long (SYSCTL_HANDLER_ARGS) |
static int | sysctl_bufdomain_int (SYSCTL_HANDLER_ARGS) |
static int | sysctl_bufspace (SYSCTL_HANDLER_ARGS) |
SYSCTL_INT (_vfs, OID_AUTO, vmiodirenable, CTLFLAG_RW, &vmiodirenable, 0, "Use the VM system for directory writes") | |
SYSCTL_LONG (_vfs, OID_AUTO, runningbufspace, CTLFLAG_RD, &runningbufspace, 0, "Amount of presently outstanding async buffer io") | |
SYSCTL_PROC (_vfs, OID_AUTO, bufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RD, NULL, 0, sysctl_bufspace, "L", "Physical memory used for buffers") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, bufkvaspace, CTLFLAG_RD, &bufkvaspace, "Kernel virtual memory used for buffers") | |
SYSCTL_PROC (_vfs, OID_AUTO, maxbufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &maxbufspace, __offsetof(struct bufdomain, bd_maxbufspace), sysctl_bufdomain_long, "L", "Maximum allowed value of bufspace (including metadata)") | |
SYSCTL_LONG (_vfs, OID_AUTO, bufmallocspace, CTLFLAG_RD, &bufmallocspace, 0, "Amount of malloced memory for buffers") | |
SYSCTL_LONG (_vfs, OID_AUTO, maxmallocbufspace, CTLFLAG_RW, &maxbufmallocspace, 0, "Maximum amount of malloced memory for buffers") | |
SYSCTL_PROC (_vfs, OID_AUTO, lobufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &lobufspace, __offsetof(struct bufdomain, bd_lobufspace), sysctl_bufdomain_long, "L", "Minimum amount of buffers we want to have") | |
SYSCTL_PROC (_vfs, OID_AUTO, hibufspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &hibufspace, __offsetof(struct bufdomain, bd_hibufspace), sysctl_bufdomain_long, "L", "Maximum allowed value of bufspace (excluding metadata)") | |
SYSCTL_PROC (_vfs, OID_AUTO, bufspacethresh, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &bufspacethresh, __offsetof(struct bufdomain, bd_bufspacethresh), sysctl_bufdomain_long, "L", "Bufspace consumed before waking the daemon to free some") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, buffreekvacnt, CTLFLAG_RW, &buffreekvacnt, "Number of times we have freed the KVA space from some buffer") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, bufdefragcnt, CTLFLAG_RW, &bufdefragcnt, "Number of times we have had to repeat buffer allocation to defragment") | |
SYSCTL_PROC (_vfs, OID_AUTO, lorunningspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &lorunningspace, 0, sysctl_runningspace, "L", "Minimum preferred space used for in-progress I/O") | |
SYSCTL_PROC (_vfs, OID_AUTO, hirunningspace, CTLTYPE_LONG|CTLFLAG_MPSAFE|CTLFLAG_RW, &hirunningspace, 0, sysctl_runningspace, "L", "Maximum amount of space to use for in-progress I/O") | |
SYSCTL_INT (_vfs, OID_AUTO, dirtybufferflushes, CTLFLAG_RW, &dirtybufferflushes, 0, "Number of bdwrite to bawrite conversions to limit dirty buffers") | |
SYSCTL_INT (_vfs, OID_AUTO, bdwriteskip, CTLFLAG_RW, &bdwriteskip, 0, "Number of buffers supplied to bdwrite with snapshot deadlock risk") | |
SYSCTL_INT (_vfs, OID_AUTO, altbufferflushes, CTLFLAG_RW|CTLFLAG_STATS, &altbufferflushes, 0, "Number of fsync flushes to limit dirty buffers") | |
SYSCTL_INT (_vfs, OID_AUTO, recursiveflushes, CTLFLAG_RW|CTLFLAG_STATS, &recursiveflushes, 0, "Number of flushes skipped due to being recursive") | |
static int | sysctl_numdirtybuffers (SYSCTL_HANDLER_ARGS) |
SYSCTL_PROC (_vfs, OID_AUTO, numdirtybuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RD, NULL, 0, sysctl_numdirtybuffers, "I", "Number of buffers that are dirty (has unwritten changes) at the moment") | |
SYSCTL_PROC (_vfs, OID_AUTO, lodirtybuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RW, &lodirtybuffers, __offsetof(struct bufdomain, bd_lodirtybuffers), sysctl_bufdomain_int, "I", "How many buffers we want to have free before bufdaemon can sleep") | |
SYSCTL_PROC (_vfs, OID_AUTO, hidirtybuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RW, &hidirtybuffers, __offsetof(struct bufdomain, bd_hidirtybuffers), sysctl_bufdomain_int, "I", "When the number of dirty buffers is considered severe") | |
SYSCTL_PROC (_vfs, OID_AUTO, dirtybufthresh, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RW, &dirtybufthresh, __offsetof(struct bufdomain, bd_dirtybufthresh), sysctl_bufdomain_int, "I", "Number of bdwrite to bawrite conversions to clear dirty buffers") | |
SYSCTL_INT (_vfs, OID_AUTO, numfreebuffers, CTLFLAG_RD, &numfreebuffers, 0, "Number of free buffers") | |
SYSCTL_PROC (_vfs, OID_AUTO, lofreebuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RW, &lofreebuffers, __offsetof(struct bufdomain, bd_lofreebuffers), sysctl_bufdomain_int, "I", "Target number of free buffers") | |
SYSCTL_PROC (_vfs, OID_AUTO, hifreebuffers, CTLTYPE_INT|CTLFLAG_MPSAFE|CTLFLAG_RW, &hifreebuffers, __offsetof(struct bufdomain, bd_hifreebuffers), sysctl_bufdomain_int, "I", "Threshold for clean buffer recycling") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, getnewbufcalls, CTLFLAG_RD, &getnewbufcalls, "Number of calls to getnewbuf") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RD, &getnewbufrestarts, "Number of times getnewbuf has had to restart a buffer acquisition") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, mappingrestarts, CTLFLAG_RD, &mappingrestarts, "Number of times getblk has had to restart a buffer mapping for " "unmapped buffer") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, numbufallocfails, CTLFLAG_RW, &numbufallocfails, "Number of times buffer allocations failed") | |
SYSCTL_INT (_vfs, OID_AUTO, flushbufqtarget, CTLFLAG_RW, &flushbufqtarget, 0, "Amount of work to do in flushbufqueues when helping bufdaemon") | |
SYSCTL_COUNTER_U64 (_vfs, OID_AUTO, notbufdflushes, CTLFLAG_RD, ¬bufdflushes, "Number of dirty buffer flushes done by the bufdaemon helpers") | |
SYSCTL_LONG (_vfs, OID_AUTO, barrierwrites, CTLFLAG_RW|CTLFLAG_STATS, &barrierwrites, 0, "Number of barrier writes") | |
SYSCTL_INT (_vfs, OID_AUTO, unmapped_buf_allowed, CTLFLAG_RD, &unmapped_buf_allowed, 0, "Permit the use of the unmapped i/o") | |
SYSCTL_INT (_vfs, OID_AUTO, maxbcachebuf, CTLFLAG_RDTUN, &maxbcachebuf, 0, "Maximum size of a buffer cache block") | |
BITSET_DEFINE (bufdomainset, BUF_DOMAINS) | |
static void | bdirtywakeup (void) |
static void | bd_clear (struct bufdomain *bd) |
static void | bd_set (struct bufdomain *bd) |
static void | bdirtysub (struct buf *bp) |
static void | bdirtyadd (struct buf *bp) |
static void | bufspace_daemon_wakeup (struct bufdomain *bd) |
static void | bufspace_adjust (struct buf *bp, int bufsize) |
static int | bufspace_reserve (struct bufdomain *bd, int size, bool metadata) |
static void | bufspace_release (struct bufdomain *bd, int size) |
static void | bufspace_wait (struct bufdomain *bd, struct vnode *vp, int gbflags, int slpflag, int slptimeo) |
static void | bufspace_daemon_shutdown (void *arg, int howto __unused) |
static void | bufspace_daemon (void *arg) |
static void | bufmallocadjust (struct buf *bp, int bufsize) |
static void | runningwakeup (void) |
void | runningbufwakeup (struct buf *bp) |
void | waitrunningbufspace (void) |
static __inline void | vfs_buf_test_cache (struct buf *bp, vm_ooffset_t foff, vm_offset_t off, vm_offset_t size, vm_page_t m) |
void | bd_speedup (void) |
caddr_t | kern_vfs_bio_buffer_alloc (caddr_t v, long physmem_est) |
void | bufinit (void) |
static int | isbufbusy (struct buf *bp) |
void | bufshutdown (int show_busybufs) |
static void | bpmap_qenter (struct buf *bp) |
static struct bufqueue * | bufqueue (struct buf *bp) |
static struct bufqueue * | bufqueue_acquire (struct buf *bp) |
static void | binsfree (struct buf *bp, int qindex) |
static void | buf_free (struct buf *bp) |
static struct buf * | buf_alloc (struct bufdomain *bd) |
void | bremfree (struct buf *bp) |
void | bremfreef (struct buf *bp) |
static void | bd_flush (struct bufdomain *bd, struct bufqueue *bq) |
static int | bufkva_alloc (struct buf *bp, int maxsize, int gbflags) |
int | breadn_flags (struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, daddr_t *rablkno, int *rabsize, int cnt, struct ucred *cred, int flags, void(*ckhashfunc)(struct buf *), struct buf **bpp) |
int | bufwrite (struct buf *bp) |
void | bufbdflush (struct bufobj *bo, struct buf *bp) |
void | bdwrite (struct buf *bp) |
void | bdirty (struct buf *bp) |
void | bundirty (struct buf *bp) |
void | bawrite (struct buf *bp) |
void | babarrierwrite (struct buf *bp) |
int | bbarrierwrite (struct buf *bp) |
void | bwillwrite (void) |
int | buf_dirty_count_severe (void) |
void | brelse (struct buf *bp) |
void | bqrelse (struct buf *bp) |
static void | vfs_vmio_iodone (struct buf *bp) |
int | vfs_bio_awrite (struct buf *bp) |
static int | getnewbuf_kva (struct buf *bp, int gbflags, int maxsize) |
static struct buf * | getnewbuf (struct vnode *vp, int slpflag, int slptimeo, int maxsize, int gbflags) |
SYSINIT (bufdaemon, SI_SUB_KTHREAD_BUF, SI_ORDER_FIRST, kproc_start, &buf_kp) | |
static void | buf_daemon_shutdown (void *arg __unused, int howto __unused) |
SYSCTL_INT (_vfs, OID_AUTO, flushwithdeps, CTLFLAG_RW|CTLFLAG_STATS, &flushwithdeps, 0, "Number of buffers flushed with dependencies that require rollbacks") | |
struct buf * | incore (struct bufobj *bo, daddr_t blkno) |
bool | inmem (struct vnode *vp, daddr_t blkno) |
static void | bp_unmapped_get_kva (struct buf *bp, daddr_t blkno, int size, int gbflags) |
struct buf * | getblk (struct vnode *vp, daddr_t blkno, int size, int slpflag, int slptimeo, int flags) |
int | getblkx (struct vnode *vp, daddr_t blkno, daddr_t dblkno, int size, int slpflag, int slptimeo, int flags, struct buf **bpp) |
struct buf * | geteblk (int size, int flags) |
static void | vfs_nonvmio_truncate (struct buf *bp, int newbsize) |
static void | vfs_nonvmio_extend (struct buf *bp, int newbsize) |
int | allocbuf (struct buf *bp, int size) |
void | biodone (struct bio *bp) |
int | biowait (struct bio *bp, const char *wmesg) |
void | biofinish (struct bio *bp, struct devstat *stat, int error) |
int | bufwait (struct buf *bp) |
void | bufdone (struct buf *bp) |
void | vfs_unbusy_pages (struct buf *bp) |
void | vfs_busy_pages_acquire (struct buf *bp) |
void | vfs_busy_pages_release (struct buf *bp) |
void | vfs_busy_pages (struct buf *bp, int clear_modify) |
void | vfs_bio_set_valid (struct buf *bp, int base, int size) |
void | vfs_bio_clrbuf (struct buf *bp) |
void | vfs_bio_bzero_buf (struct buf *bp, int base, int size) |
static void | b_io_dismiss (struct buf *bp, int ioflag, bool release) |
void | vfs_bio_brelse (struct buf *bp, int ioflag) |
void | vfs_bio_set_flags (struct buf *bp, int ioflag) |
int | vmapbuf (struct buf *bp, void *uaddr, size_t len, int mapbuf) |
void | vunmapbuf (struct buf *bp) |
void | bdone (struct buf *bp) |
void | bwait (struct buf *bp, u_char pri, const char *wchan) |
int | bufsync (struct bufobj *bo, int waitfor) |
void | bufstrategy (struct bufobj *bo, struct buf *bp) |
void | bufobj_init (struct bufobj *bo, void *private) |
void | bufobj_wrefl (struct bufobj *bo) |
void | bufobj_wref (struct bufobj *bo) |
void | bufobj_wdrop (struct bufobj *bo) |
int | bufobj_wwait (struct bufobj *bo, int slpflag, int timeo) |
void | bdata2bio (struct buf *bp, struct bio *bip) |
SYSCTL_INT (_vfs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, &buf_pager_relbuf, 0, "Make buffer pager release buffers after reading") | |
int | vfs_bio_getpages (struct vnode *vp, vm_page_t *ma, int count, int *rbehind, int *rahead, vbg_get_lblkno_t get_lblkno, vbg_get_blksize_t get_blksize) |
Variables | |
struct bio_ops | bioops |
struct buf_ops | buf_ops_bio |
struct mtx_padalign | bq_lock |
struct bufqueue | bd_subq [MAXCPU+1] |
struct bufqueue | bd_dirtyq |
struct bufqueue * | bd_cleanq |
struct mtx_padalign | bd_run_lock |
long | bd_maxbufspace |
long | bd_hibufspace |
long | bd_lobufspace |
long | bd_bufspacethresh |
int | bd_hifreebuffers |
int | bd_lofreebuffers |
int | bd_hidirtybuffers |
int | bd_lodirtybuffers |
int | bd_dirtybufthresh |
int | bd_lim |
int | bd_wanted |
bool | bd_shutdown |
static char * | buf |
caddr_t __read_mostly | unmapped_buf |
struct proc * | bufdaemonproc |
int | vmiodirenable = TRUE |
long | runningbufspace |
static counter_u64_t | bufkvaspace |
static long | maxbufspace |
static long | bufmallocspace |
static long | maxbufmallocspace |
static long | lobufspace |
long | hibufspace |
long | bufspacethresh |
static counter_u64_t | buffreekvacnt |
static counter_u64_t | bufdefragcnt |
static long | lorunningspace |
static long | hirunningspace |
int | dirtybufferflushes |
int | bdwriteskip |
int | altbufferflushes |
static int | recursiveflushes |
static int | lodirtybuffers |
static int | hidirtybuffers |
int | dirtybufthresh |
static int | numfreebuffers |
static int | lofreebuffers |
static int | hifreebuffers |
static counter_u64_t | getnewbufcalls |
static counter_u64_t | getnewbufrestarts |
static counter_u64_t | mappingrestarts |
static counter_u64_t | numbufallocfails |
static int | flushbufqtarget = 100 |
static counter_u64_t | notbufdflushes |
static long | barrierwrites |
int | maxbcachebuf = MAXBCACHEBUF |
static struct mtx_padalign __exclusive_cache_line | bdlock |
static struct mtx_padalign __exclusive_cache_line | rbreqlock |
static struct mtx_padalign __exclusive_cache_line | bdirtylock |
static int | bd_request |
static int | bd_speedupreq |
static int | runningbufreq |
static int | bdirtywait |
struct bufdomainset | bdlodirty |
struct bufdomainset | bdhidirty |
static int __read_mostly | buf_domains |
struct bufdomain __exclusive_cache_line | bdomain [BUF_DOMAINS] |
struct bufqueue __exclusive_cache_line | bqempty |
uma_zone_t | buf_zone |
static const char | buf_wmesg [] = "bufwait" |
static struct kproc_desc | buf_kp |
static int | flushwithdeps = 0 |
int | inflight_transient_maps |
static struct bio_queue | nondump_bios |
static int | buf_pager_relbuf = 0 |
#define BD_ASSERT_LOCKED | ( | bd | ) | mtx_assert(BD_LOCKPTR((bd)), MA_OWNED) |
#define BD_LOCK | ( | bd | ) | mtx_lock(BD_LOCKPTR((bd))) |
#define BD_RUN_LOCK | ( | bd | ) | mtx_lock(BD_RUN_LOCKPTR((bd))) |
#define BD_RUN_LOCKPTR | ( | bd | ) | (&(bd)->bd_run_lock) |
#define BD_RUN_UNLOCK | ( | bd | ) | mtx_unlock(BD_RUN_LOCKPTR((bd))) |
#define BD_UNLOCK | ( | bd | ) | mtx_unlock(BD_LOCKPTR((bd))) |
#define BQ_ASSERT_LOCKED | ( | bq | ) | mtx_assert(BQ_LOCKPTR((bq)), MA_OWNED) |
#define BQ_LOCK | ( | bq | ) | mtx_lock(BQ_LOCKPTR((bq))) |
#define BQ_UNLOCK | ( | bq | ) | mtx_unlock(BQ_LOCKPTR((bq))) |
#define QUEUE_SENTINEL 4 /* not an queue index, but mark for sentinel */ |
struct bufqueue __aligned | ( | CACHE_LINE_SIZE | ) |
References bufbdflush(), bufstrategy(), bufsync(), and bufwrite().
__FBSDID | ( | "$FreeBSD$" | ) |
int allocbuf | ( | struct buf * | bp, |
int | size | ||
) |
Definition at line 4359 of file vfs_bio.c.
References bufspace_adjust(), panic(), vfs_nonvmio_extend(), vfs_nonvmio_truncate(), vfs_vmio_extend(), and vfs_vmio_truncate().
Referenced by brelse(), getblkx(), and geteblk().
|
static |
Definition at line 4925 of file vfs_bio.c.
References bqrelse(), and brelse().
Referenced by vfs_bio_brelse(), and vfs_bio_set_flags().
void bawrite | ( | struct buf * | bp | ) |
Definition at line 2580 of file vfs_bio.c.
Referenced by bufbdflush(), cluster_wbuild(), cluster_write(), vn_fsync_buf(), and vtruncbuf().
|
static |
Definition at line 539 of file vfs_bio.c.
References BD_DOMAIN, bufdomain::bd_hidirtybuffers, bufdomain::bd_lodirtybuffers, bdhidirty, bdirtylock, bdlodirty, and BUF_DOMAINS.
Referenced by bdirtysub().
Definition at line 1953 of file vfs_bio.c.
References bufdomain::bd_cleanq, BD_LOCK, BD_UNLOCK, bufdomain::bd_wanted, BQ_ASSERT_LOCKED, buf, and wakeup().
Referenced by bd_flushall(), and bq_insert().
|
static |
Definition at line 1978 of file vfs_bio.c.
References bd_flush(), bufdomain::bd_lim, bufdomain::bd_subq, BQ_LOCK, BQ_UNLOCK, and mp_maxid.
Referenced by bufspace_daemon().
|
static |
Definition at line 1910 of file vfs_bio.c.
References bufdomain::bd_cleanq, bufdomain::bd_dirtyq, bufdomain::bd_run_lock, bufdomain::bd_subq, bq_init(), mp_maxid, QUEUE_CLEAN, and QUEUE_DIRTY.
Referenced by bufinit().
|
static |
Definition at line 557 of file vfs_bio.c.
References BD_DOMAIN, bufdomain::bd_hidirtybuffers, bufdomain::bd_lodirtybuffers, bdhidirty, bdirtylock, bdlodirty, and BUF_DOMAINS.
Referenced by bdirtyadd().
void bd_speedup | ( | void | ) |
Definition at line 1025 of file vfs_bio.c.
References bd_request, bd_speedupreq, bdlock, and wakeup().
Referenced by bufspace_daemon().
|
static |
Definition at line 987 of file vfs_bio.c.
References bd_request, bdlock, and wakeup().
Referenced by bdirtyadd().
void bdata2bio | ( | struct buf * | bp, |
struct bio * | bip | ||
) |
Definition at line 5192 of file vfs_bio.c.
References unmapped_buf.
void bdirty | ( | struct buf * | bp | ) |
Definition at line 2521 of file vfs_bio.c.
References bdirtyadd(), QUEUE_NONE, and reassignbuf().
Referenced by bdwrite(), and brelse().
|
static |
Definition at line 595 of file vfs_bio.c.
References bufdomain::bd_hidirtybuffers, bufdomain::bd_lodirtybuffers, bd_set(), bd_wakeup(), and bufdomain().
Referenced by bdirty().
|
static |
Definition at line 575 of file vfs_bio.c.
References bd_clear(), bufdomain::bd_hidirtybuffers, bufdomain::bd_lodirtybuffers, bdirtywakeup(), and bufdomain().
Referenced by brelse(), and bundirty().
|
static |
Definition at line 522 of file vfs_bio.c.
References bdirtylock, bdirtywait, and wakeup().
Referenced by bdirtysub(), and buf_daemon().
void bdone | ( | struct buf * | bp | ) |
Definition at line 5077 of file vfs_bio.c.
References mtx, mtx_pool_find(), mtxpool_sleep, and wakeup().
Referenced by bufdone().
void bdwrite | ( | struct buf * | bp | ) |
Definition at line 2428 of file vfs_bio.c.
References bdirty(), bqrelse(), brelse(), recursiveflushes, and vfs_clean_pages_dirty_buf().
Referenced by cluster_write().
|
static |
Definition at line 1577 of file vfs_bio.c.
References bufdomain::bd_cleanq, bufdomain::bd_dirtyq, bufdomain::bd_lim, bufdomain::bd_subq, bq_insert(), bq_remove(), BQ_UNLOCK, bufdomain(), bufqueue_acquire(), QUEUE_CLEAN, and QUEUE_DIRTY.
Referenced by bqrelse(), and brelse().
void biodone | ( | struct bio * | bp | ) |
Definition at line 4412 of file vfs_bio.c.
References biodone(), dumping, inflight_transient_maps, mtx, mtx_pool_find(), mtxpool_sleep, nondump_bios, start, unmapped_buf, vmem_free(), and wakeup().
Referenced by biodone(), biofinish(), and bufdone().
void biofinish | ( | struct bio * | bp, |
struct devstat * | stat, | ||
int | error | ||
) |
Definition at line 4476 of file vfs_bio.c.
References biodone(), and devstat_end_transaction_bio().
Referenced by bioq_flush(), dead_strategy(), giant_strategy(), and no_strategy().
int biowait | ( | struct bio * | bp, |
const char * | wmesg | ||
) |
Definition at line 4459 of file vfs_bio.c.
References mtx, mtx_pool_find(), and mtxpool_sleep.
Referenced by physio().
BITSET_DEFINE | ( | bufdomainset | , |
BUF_DOMAINS | |||
) |
|
static |
Definition at line 3841 of file vfs_bio.c.
References bpmap_qenter(), BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, bufdomain(), bufkva_alloc(), bufspace_wait(), mappingrestarts, panic(), unmapped_buf, and vn_isdisk().
Referenced by getblkx().
|
static |
Definition at line 1501 of file vfs_bio.c.
References BUF_CHECK_MAPPED.
Referenced by bp_unmapped_get_kva(), and vfs_vmio_extend().
|
static |
Definition at line 1899 of file vfs_bio.c.
References bufqueue::bq_lock.
Referenced by bd_init(), and bufinit().
Definition at line 2001 of file vfs_bio.c.
References bufdomain::bd_cleanq, bd_flush(), bufdomain::bd_lim, bufdomain::bd_wanted, BQ_LOCK, BQ_UNLOCK, bufdomain(), panic(), QUEUE_CLEAN, and QUEUE_NONE.
Referenced by binsfree(), and bufinit().
Definition at line 1930 of file vfs_bio.c.
References BQ_ASSERT_LOCKED, bufqueue(), QUEUE_EMPTY, and QUEUE_NONE.
Referenced by binsfree(), bremfreef(), buf_import(), and buf_recycle().
void bqrelse | ( | struct buf * | bp | ) |
Definition at line 2872 of file vfs_bio.c.
References binsfree(), brelse(), bremfreef(), panic(), QUEUE_CLEAN, QUEUE_DIRTY, and QUEUE_NONE.
Referenced by b_io_dismiss(), bdwrite(), brelse(), buf_recycle(), bufdone(), cluster_rbuild(), cluster_read(), cluster_wbuild(), and vfs_bio_getpages().
|
static |
Definition at line 2143 of file vfs_bio.c.
References brelse(), buf, crhold(), flags, getblk(), inmem(), and vfs_busy_pages().
Referenced by breadn_flags().
void brelse | ( | struct buf * | bp | ) |
Definition at line 2663 of file vfs_bio.c.
References allocbuf(), bdirty(), bdirtysub(), binsfree(), bqrelse(), brelvp(), buf_free(), bundirty(), panic(), QUEUE_CLEAN, QUEUE_DIRTY, vfs_vmio_invalidate(), and vn_isdisk().
Referenced by b_io_dismiss(), bdwrite(), bnoreuselist(), bqrelse(), breada(), breadn_flags(), buf_recycle(), bufdone(), bufwrite(), cluster_collectbufs(), cluster_read(), cluster_write(), flushbuflist(), flushbufqueues(), getblkx(), getnewbuf(), v_inval_buf_range_locked(), and vfs_bio_getpages().
void bremfree | ( | struct buf * | bp | ) |
Definition at line 1869 of file vfs_bio.c.
References QUEUE_NONE.
Referenced by bnoreuselist(), bufbdflush(), cluster_wbuild(), flushbuflist(), flushbufqueues(), getblkx(), v_inval_buf_range_locked(), vfs_bio_awrite(), vn_fsync_buf(), and vtruncbuf().
void bremfreef | ( | struct buf * | bp | ) |
Definition at line 1889 of file vfs_bio.c.
References bq_remove(), BQ_UNLOCK, and bufqueue_acquire().
Referenced by bqrelse(), buf_free(), and flushbufqueues().
Definition at line 1699 of file vfs_bio.c.
References BD_DOMAIN, bufdomain::bd_lofreebuffers, buf, buf_zone, bufspace_daemon_wakeup(), numbufallocfails, and unmapped_buf.
Referenced by getnewbuf().
|
static |
Definition at line 3430 of file vfs_bio.c.
References bufdomain::bd_lodirtybuffers, bd_request, bd_shutdown, bd_speedupreq, bdirtywakeup(), bdlock, bdlodirty, bdomain, buf_daemon_shutdown(), BUF_DOMAINS, buf_domains, buf_flush(), bufspace_daemon(), hz, kern_yield(), kthread_add(), kthread_exit(), lorunningspace, panic(), runningbufspace, runningwakeup(), and wakeup().
|
static |
Definition at line 3415 of file vfs_bio.c.
References bd_request, bd_shutdown, bdlock, hz, printf(), and wakeup().
Referenced by buf_daemon().
int buf_dirty_count_severe | ( | void | ) |
Definition at line 2649 of file vfs_bio.c.
References bdhidirty, and BUF_DOMAINS.
Referenced by bwillwrite().
|
static |
Definition at line 3396 of file vfs_bio.c.
References flushbufqueues().
Referenced by buf_daemon(), and bufspace_wait().
|
static |
Definition at line 1617 of file vfs_bio.c.
References bremfreef(), buf_zone, bufdomain(), bufkva_free(), crfree(), and panic().
Referenced by brelse().
|
static |
|
static |
Definition at line 1774 of file vfs_bio.c.
References bufdomain::bd_cleanq, BD_DOMAIN, BD_LOCKPTR, bufdomain::bd_wanted, BQ_LOCK, BQ_LOCKPTR, bq_remove(), BQ_UNLOCK, bqrelse(), brelse(), buf, bufdefragcnt, and QUEUE_CLEAN.
Referenced by bufkva_reclaim(), bufspace_daemon(), and getnewbuf().
|
static |
void bufbdflush | ( | struct bufobj * | bo, |
struct buf * | bp | ||
) |
Definition at line 2376 of file vfs_bio.c.
References altbufferflushes, bawrite(), bufdomain::bd_dirtybufthresh, bdomain, bremfree(), buf, dirtybufferflushes, panic(), and vfs_bio_awrite().
Referenced by __aligned().
Definition at line 1517 of file vfs_bio.c.
References bdomain.
Referenced by bdirtyadd(), bdirtysub(), binsfree(), bp_unmapped_get_kva(), bq_insert(), buf_free(), bufqueue(), bufspace_adjust(), getblkx(), and geteblk().
void bufdone | ( | struct buf * | bp | ) |
Definition at line 4542 of file vfs_bio.c.
References bdone(), biodone(), bqrelse(), brelse(), buf, bufobj_wdrop(), runningbufwakeup(), and vfs_vmio_iodone().
Referenced by cluster_callback(), and vop_nostrategy().
void bufinit | ( | void | ) |
Definition at line 1190 of file vfs_bio.c.
References bufdomain::bd_bufspacethresh, bufdomain::bd_dirtybufthresh, bufdomain::bd_hibufspace, bufdomain::bd_hidirtybuffers, bufdomain::bd_hifreebuffers, bd_init(), bufdomain::bd_lim, bufdomain::bd_lobufspace, bufdomain::bd_lodirtybuffers, bufdomain::bd_lofreebuffers, bufdomain::bd_maxbufspace, bdirtylock, bdlock, bdomain, bq_init(), bq_insert(), bqempty, buf, BUF_DOMAINS, buf_domains, buf_import(), buf_release(), buf_wmesg, buf_zone, bufdefragcnt, buffreekvacnt, bufkva_reclaim(), bufkvaspace, bufspacethresh, counter_u64_alloc(), dirtybufthresh, getnewbufcalls, getnewbufrestarts, hibufspace, hidirtybuffers, hifreebuffers, hirunningspace, lobufspace, lodirtybuffers, lofreebuffers, lorunningspace, mappingrestarts, maxbcachebuf, maxbufmallocspace, maxbufspace, maxphys, mp_maxid, mp_ncpus, nbuf, nbufp(), notbufdflushes, numbufallocfails, numfreebuffers, QUEUE_EMPTY, QUEUE_NONE, rbreqlock, unmapped_buf, and vmem_set_reclaim().
|
static |
Definition at line 2078 of file vfs_bio.c.
References addr, BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, bufkva_free(), bufkvaspace, maxbcachebuf, unmapped_buf, and vmem_alloc().
Referenced by bp_unmapped_get_kva(), and getnewbuf_kva().
|
static |
Definition at line 2049 of file vfs_bio.c.
References BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, buffreekvacnt, bufkvaspace, unmapped_buf, and vmem_free().
Referenced by buf_free(), and bufkva_alloc().
|
static |
Definition at line 2120 of file vfs_bio.c.
References bdomain, buf_domains, and buf_recycle().
Referenced by bufinit().
|
static |
Definition at line 877 of file vfs_bio.c.
References bufmallocspace.
Referenced by vfs_nonvmio_extend(), and vfs_nonvmio_truncate().
void bufobj_init | ( | struct bufobj * | bo, |
void * | private | ||
) |
Definition at line 5125 of file vfs_bio.c.
References buf_domains.
Referenced by vnode_init().
void bufobj_wdrop | ( | struct bufobj * | bo | ) |
void bufobj_wref | ( | struct bufobj * | bo | ) |
Definition at line 5147 of file vfs_bio.c.
Referenced by bufwrite(), and cluster_wbuild().
int bufobj_wwait | ( | struct bufobj * | bo, |
int | slpflag, | ||
int | timeo | ||
) |
Definition at line 5171 of file vfs_bio.c.
Referenced by bufobj_invalbuf(), vn_fsync_buf(), and vtruncbuf().
Definition at line 1524 of file vfs_bio.c.
References bd_dirtyq, bd_subq, bqempty, bufdomain(), panic(), QUEUE_CLEAN, QUEUE_DIRTY, QUEUE_EMPTY, QUEUE_NONE, and QUEUE_SENTINEL.
Referenced by bq_remove(), and bufqueue_acquire().
Definition at line 1548 of file vfs_bio.c.
References BQ_LOCK, BQ_UNLOCK, and bufqueue().
Referenced by binsfree(), and bremfreef().
void bufshutdown | ( | int | show_busybufs | ) |
Definition at line 1373 of file vfs_bio.c.
References buf, isbufbusy(), kern_sync(), mi_switch(), mountlist, nbuf, nbufp(), printf(), show_busybufs, vfs_unmountall(), and vn_printf().
Referenced by kern_reboot().
|
static |
Definition at line 639 of file vfs_bio.c.
References bd_bufspacethresh, bufdomain::bd_bufspacethresh, bufdomain(), and bufspace_daemon_wakeup().
Referenced by allocbuf(), vfs_nonvmio_extend(), and vfs_nonvmio_truncate().
|
static |
Definition at line 786 of file vfs_bio.c.
References bufdomain::bd_bufspacethresh, bd_flushall(), bufdomain::bd_hifreebuffers, bufdomain::bd_lobufspace, BD_LOCK, BD_LOCKPTR, bufdomain::bd_lofreebuffers, BD_RUN_LOCK, BD_RUN_LOCKPTR, BD_RUN_UNLOCK, bufdomain::bd_shutdown, bd_speedup(), BD_UNLOCK, bufdomain::bd_wanted, buf_recycle(), bufspace_daemon_shutdown(), hz, kthread_exit(), maybe_yield(), and wakeup().
Referenced by buf_daemon().
|
static |
Definition at line 763 of file vfs_bio.c.
References BD_RUN_LOCK, BD_RUN_LOCKPTR, BD_RUN_UNLOCK, bufdomain::bd_shutdown, hz, printf(), and wakeup().
Referenced by bufspace_daemon().
|
static |
Definition at line 618 of file vfs_bio.c.
References BD_RUN_LOCK, BD_RUN_UNLOCK, and wakeup().
Referenced by buf_alloc(), bufspace_adjust(), and bufspace_reserve().
|
static |
Definition at line 697 of file vfs_bio.c.
Referenced by getblkx(), geteblk(), and getnewbuf().
|
static |
Definition at line 668 of file vfs_bio.c.
References bd_bufspacethresh, bufdomain::bd_bufspacethresh, bufdomain::bd_hibufspace, bufdomain::bd_maxbufspace, and bufspace_daemon_wakeup().
Referenced by getnewbuf().
|
static |
Definition at line 711 of file vfs_bio.c.
References BD_LOCK, BD_LOCKPTR, BD_UNLOCK, bufdomain::bd_wanted, buf_flush(), and flushbufqtarget.
Referenced by bp_unmapped_get_kva(), and getnewbuf().
void bufstrategy | ( | struct bufobj * | bo, |
struct buf * | bp | ||
) |
Definition at line 5108 of file vfs_bio.c.
Referenced by __aligned().
int bufsync | ( | struct bufobj * | bo, |
int | waitfor | ||
) |
Definition at line 5101 of file vfs_bio.c.
Referenced by __aligned().
int bufwait | ( | struct buf * | bp | ) |
Definition at line 4505 of file vfs_bio.c.
References bwait().
Referenced by breadn_flags(), bufwrite(), and cluster_read().
int bufwrite | ( | struct buf * | bp | ) |
Definition at line 2286 of file vfs_bio.c.
References barrierwrites, brelse(), bufobj_wref(), bufwait(), bundirty(), hirunningspace, runningbufspace, vfs_busy_pages(), and waitrunningbufspace().
Referenced by __aligned().
void bundirty | ( | struct buf * | bp | ) |
Definition at line 2551 of file vfs_bio.c.
References bdirtysub(), QUEUE_NONE, and reassignbuf().
Referenced by brelse(), bufwrite(), and cluster_wbuild().
void bwait | ( | struct buf * | bp, |
u_char | pri, | ||
const char * | wchan | ||
) |
Definition at line 5089 of file vfs_bio.c.
References mtx, mtx_pool_find(), and mtxpool_sleep.
Referenced by bufwait().
void bwillwrite | ( | void | ) |
Definition at line 2631 of file vfs_bio.c.
References bdirtylock, bdirtywait, and buf_dirty_count_severe().
Referenced by aio_process_rw(), kern_fhlinkat(), kern_frmdirat(), kern_funlinkat(), kern_linkat(), kern_mkdirat(), kern_mkfifoat(), kern_mknodat(), kern_renameat(), kern_symlinkat(), sys_undelete(), vn_deallocate_impl(), vn_fallocate(), vn_open_cred(), vn_rdwr_inchunks(), vn_write(), and vn_write_outvp().
|
static |
Definition at line 3545 of file vfs_bio.c.
References bufdomain::bd_dirtyq, BQ_LOCK, BQ_UNLOCK, brelse(), bremfree(), bremfreef(), buf, bufdaemonproc, flushwithdeps, free(), hirunningspace, malloc(), maybe_yield(), notbufdflushes, QUEUE_SENTINEL, runningbufspace, vfs_bio_awrite(), vn_finished_write(), vn_start_write(), and waitrunningbufspace().
Referenced by buf_flush().
struct buf * getblk | ( | struct vnode * | vp, |
daddr_t | blkno, | ||
int | size, | ||
int | slpflag, | ||
int | slptimeo, | ||
int | flags | ||
) |
Definition at line 3896 of file vfs_bio.c.
References buf, flags, and getblkx().
Referenced by breada(), cluster_rbuild(), and cluster_read().
int getblkx | ( | struct vnode * | vp, |
daddr_t | blkno, | ||
daddr_t | dblkno, | ||
int | size, | ||
int | slpflag, | ||
int | slptimeo, | ||
int | flags, | ||
struct buf ** | bpp | ||
) |
Definition at line 3952 of file vfs_bio.c.
References allocbuf(), bgetvp(), bp_unmapped_get_kva(), brelse(), bremfree(), buf, BUF_CHECK_MAPPED, bufdomain(), bufspace_release(), flags, gbincore(), gbincore_unlocked(), getnewbuf(), kern_yield(), maxbcachebuf, panic(), QUEUE_NONE, and vn_isdisk().
Referenced by breadn_flags(), cluster_read(), and getblk().
struct buf * geteblk | ( | int | size, |
int | flags | ||
) |
Definition at line 4253 of file vfs_bio.c.
References allocbuf(), buf, bufdomain(), bufspace_release(), flags, and getnewbuf().
|
static |
Definition at line 3330 of file vfs_bio.c.
References bdomain, brelse(), buf, buf_alloc(), buf_recycle(), bufspace_release(), bufspace_reserve(), bufspace_wait(), getnewbuf_kva(), getnewbufcalls, and getnewbufrestarts.
Referenced by getblkx(), and geteblk().
|
static |
Definition at line 3297 of file vfs_bio.c.
References bufkva_alloc().
Referenced by getnewbuf().
struct buf * incore | ( | struct bufobj * | bo, |
daddr_t | blkno | ||
) |
Definition at line 3682 of file vfs_bio.c.
References gbincore_unlocked().
Referenced by inmem().
bool inmem | ( | struct vnode * | vp, |
daddr_t | blkno | ||
) |
|
static |
Definition at line 1361 of file vfs_bio.c.
Referenced by bufshutdown().
caddr_t kern_vfs_bio_buffer_alloc | ( | caddr_t | v, |
long | physmem_est | ||
) |
Definition at line 1053 of file vfs_bio.c.
References bio_transient_maxcnt, buf, maxbcache, maxbcachebuf, maxbcachebuf_adjust(), maxphys, nbuf, nswbuf, printf(), and TRANSIENT_DENOM.
|
static |
|
static |
Definition at line 1002 of file vfs_bio.c.
References bootverbose, maxbcachebuf, maxphys, and printf().
Referenced by kern_vfs_bio_buffer_alloc().
|
static |
Definition at line 155 of file vfs_bio.c.
References buf, and maxbcachebuf.
Referenced by bufinit(), and bufshutdown().
void runningbufwakeup | ( | struct buf * | bp | ) |
Definition at line 915 of file vfs_bio.c.
References lorunningspace, runningbufspace, and runningwakeup().
Referenced by bufdone(), and vfs_unbusy_pages().
|
static |
Definition at line 898 of file vfs_bio.c.
References rbreqlock, runningbufreq, and wakeup().
Referenced by buf_daemon(), and runningbufwakeup().
|
static |
Definition at line 433 of file vfs_bio.c.
References bdomain, buf_domains, sysctl_handle_int(), and value.
|
static |
Definition at line 452 of file vfs_bio.c.
References bdomain, buf_domains, sysctl_handle_long(), and value.
|
static |
Definition at line 492 of file vfs_bio.c.
References bdomain, buf_domains, and sysctl_handle_long().
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
bufdefragcnt | , | ||
CTLFLAG_RW | , | ||
& | bufdefragcnt, | ||
"Number of times we have had to repeat buffer allocation to defragment" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
buffreekvacnt | , | ||
CTLFLAG_RW | , | ||
& | buffreekvacnt, | ||
"Number of times we have freed the KVA space from some buffer" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
bufkvaspace | , | ||
CTLFLAG_RD | , | ||
& | bufkvaspace, | ||
"Kernel virtual memory used for buffers" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
getnewbufcalls | , | ||
CTLFLAG_RD | , | ||
& | getnewbufcalls, | ||
"Number of calls to getnewbuf" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
getnewbufrestarts | , | ||
CTLFLAG_RD | , | ||
& | getnewbufrestarts, | ||
"Number of times getnewbuf has had to restart a buffer acquisition" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
mappingrestarts | , | ||
CTLFLAG_RD | , | ||
& | mappingrestarts, | ||
"Number of times getblk has had to restart a buffer mapping for " "unmapped buffer" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
notbufdflushes | , | ||
CTLFLAG_RD | , | ||
& | notbufdflushes, | ||
"Number of dirty buffer flushes done by the bufdaemon helpers" | |||
) |
SYSCTL_COUNTER_U64 | ( | _vfs | , |
OID_AUTO | , | ||
numbufallocfails | , | ||
CTLFLAG_RW | , | ||
& | numbufallocfails, | ||
"Number of times buffer allocations failed" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
altbufferflushes | , | ||
CTLFLAG_RW| | CTLFLAG_STATS, | ||
& | altbufferflushes, | ||
0 | , | ||
"Number of fsync flushes to limit dirty buffers" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
bdwriteskip | , | ||
CTLFLAG_RW | , | ||
& | bdwriteskip, | ||
0 | , | ||
"Number of buffers supplied to bdwrite with snapshot deadlock risk" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
buf_pager_relbuf | , | ||
CTLFLAG_RWTUN | , | ||
& | buf_pager_relbuf, | ||
0 | , | ||
"Make buffer pager release buffers after reading" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
dirtybufferflushes | , | ||
CTLFLAG_RW | , | ||
& | dirtybufferflushes, | ||
0 | , | ||
"Number of bdwrite to bawrite conversions to limit dirty buffers" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
flushbufqtarget | , | ||
CTLFLAG_RW | , | ||
& | flushbufqtarget, | ||
0 | , | ||
"Amount of work to do in flushbufqueues when helping bufdaemon" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
flushwithdeps | , | ||
CTLFLAG_RW| | CTLFLAG_STATS, | ||
& | flushwithdeps, | ||
0 | , | ||
"Number of buffers flushed with dependencies that require rollbacks" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
maxbcachebuf | , | ||
CTLFLAG_RDTUN | , | ||
& | maxbcachebuf, | ||
0 | , | ||
"Maximum size of a buffer cache block" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
numfreebuffers | , | ||
CTLFLAG_RD | , | ||
& | numfreebuffers, | ||
0 | , | ||
"Number of free buffers" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
recursiveflushes | , | ||
CTLFLAG_RW| | CTLFLAG_STATS, | ||
& | recursiveflushes, | ||
0 | , | ||
"Number of flushes skipped due to being recursive" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
unmapped_buf_allowed | , | ||
CTLFLAG_RD | , | ||
& | unmapped_buf_allowed, | ||
0 | , | ||
"Permit the use of the unmapped i/o" | |||
) |
SYSCTL_INT | ( | _vfs | , |
OID_AUTO | , | ||
vmiodirenable | , | ||
CTLFLAG_RW | , | ||
& | vmiodirenable, | ||
0 | , | ||
"Use the VM system for directory writes" | |||
) |
SYSCTL_LONG | ( | _vfs | , |
OID_AUTO | , | ||
barrierwrites | , | ||
CTLFLAG_RW| | CTLFLAG_STATS, | ||
& | barrierwrites, | ||
0 | , | ||
"Number of barrier writes" | |||
) |
SYSCTL_LONG | ( | _vfs | , |
OID_AUTO | , | ||
bufmallocspace | , | ||
CTLFLAG_RD | , | ||
& | bufmallocspace, | ||
0 | , | ||
"Amount of malloced memory for buffers" | |||
) |
SYSCTL_LONG | ( | _vfs | , |
OID_AUTO | , | ||
maxmallocbufspace | , | ||
CTLFLAG_RW | , | ||
& | maxbufmallocspace, | ||
0 | , | ||
"Maximum amount of malloced memory for buffers" | |||
) |
SYSCTL_LONG | ( | _vfs | , |
OID_AUTO | , | ||
runningbufspace | , | ||
CTLFLAG_RD | , | ||
& | runningbufspace, | ||
0 | , | ||
"Amount of presently outstanding async buffer io" | |||
) |
|
static |
Definition at line 505 of file vfs_bio.c.
References bdomain, buf_domains, sysctl_handle_int(), and value.
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
bufspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RD, | ||
NULL | , | ||
0 | , | ||
sysctl_bufspace | , | ||
"L" | , | ||
"Physical memory used for buffers" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
bufspacethresh | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | bufspacethresh, | ||
__offsetof(struct bufdomain, bd_bufspacethresh) | , | ||
sysctl_bufdomain_long | , | ||
"L" | , | ||
"Bufspace consumed before waking the daemon to free some" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
dirtybufthresh | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | dirtybufthresh, | ||
__offsetof(struct bufdomain, bd_dirtybufthresh) | , | ||
sysctl_bufdomain_int | , | ||
"I" | , | ||
"Number of bdwrite to bawrite conversions to clear dirty buffers" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
hibufspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | hibufspace, | ||
__offsetof(struct bufdomain, bd_hibufspace) | , | ||
sysctl_bufdomain_long | , | ||
"L" | , | ||
"Maximum allowed value of bufspace (excluding metadata)" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
hidirtybuffers | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | hidirtybuffers, | ||
__offsetof(struct bufdomain, bd_hidirtybuffers) | , | ||
sysctl_bufdomain_int | , | ||
"I" | , | ||
"When the number of dirty buffers is considered severe" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
hifreebuffers | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | hifreebuffers, | ||
__offsetof(struct bufdomain, bd_hifreebuffers) | , | ||
sysctl_bufdomain_int | , | ||
"I" | , | ||
"Threshold for clean buffer recycling" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
hirunningspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | hirunningspace, | ||
0 | , | ||
sysctl_runningspace | , | ||
"L" | , | ||
"Maximum amount of space to use for in-progress I/O" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
lobufspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | lobufspace, | ||
__offsetof(struct bufdomain, bd_lobufspace) | , | ||
sysctl_bufdomain_long | , | ||
"L" | , | ||
"Minimum amount of buffers we want to have" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
lodirtybuffers | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | lodirtybuffers, | ||
__offsetof(struct bufdomain, bd_lodirtybuffers) | , | ||
sysctl_bufdomain_int | , | ||
"I" | , | ||
"How many buffers we want to have free before bufdaemon can sleep" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
lofreebuffers | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | lofreebuffers, | ||
__offsetof(struct bufdomain, bd_lofreebuffers) | , | ||
sysctl_bufdomain_int | , | ||
"I" | , | ||
"Target number of free buffers" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
lorunningspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | lorunningspace, | ||
0 | , | ||
sysctl_runningspace | , | ||
"L" | , | ||
"Minimum preferred space used for in-progress I/O" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
maxbufspace | , | ||
CTLTYPE_LONG|CTLFLAG_MPSAFE| | CTLFLAG_RW, | ||
& | maxbufspace, | ||
__offsetof(struct bufdomain, bd_maxbufspace) | , | ||
sysctl_bufdomain_long | , | ||
"L" | , | ||
"Maximum allowed value of bufspace (including metadata)" | |||
) |
SYSCTL_PROC | ( | _vfs | , |
OID_AUTO | , | ||
numdirtybuffers | , | ||
CTLTYPE_INT|CTLFLAG_MPSAFE| | CTLFLAG_RD, | ||
NULL | , | ||
0 | , | ||
sysctl_numdirtybuffers | , | ||
"I" | , | ||
"Number of buffers that are dirty (has unwritten changes) at the moment" | |||
) |
|
static |
Definition at line 405 of file vfs_bio.c.
References hirunningspace, lorunningspace, rbreqlock, sysctl_handle_long(), and value.
SYSINIT | ( | bufdaemon | , |
SI_SUB_KTHREAD_BUF | , | ||
SI_ORDER_FIRST | , | ||
kproc_start | , | ||
& | buf_kp | ||
) |
int vfs_bio_awrite | ( | struct buf * | bp | ) |
Definition at line 3229 of file vfs_bio.c.
References bremfree(), cluster_wbuild(), maxphys, unmapped_buf, and vfs_bio_clcheck().
Referenced by bufbdflush(), flushbufqueues(), and vn_fsync_buf().
void vfs_bio_brelse | ( | struct buf * | bp, |
int | ioflag | ||
) |
Definition at line 4946 of file vfs_bio.c.
References b_io_dismiss().
void vfs_bio_bzero_buf | ( | struct buf * | bp, |
int | base, | ||
int | size | ||
) |
Definition at line 4895 of file vfs_bio.c.
References BUF_CHECK_MAPPED, and BUF_CHECK_UNMAPPED.
|
static |
Definition at line 3186 of file vfs_bio.c.
References buf, and gbincore().
Referenced by vfs_bio_awrite().
void vfs_bio_clrbuf | ( | struct buf * | bp | ) |
Definition at line 4853 of file vfs_bio.c.
References mask, vfs_busy_pages_acquire(), and vfs_busy_pages_release().
int vfs_bio_getpages | ( | struct vnode * | vp, |
vm_page_t * | ma, | ||
int | count, | ||
int * | rbehind, | ||
int * | rahead, | ||
vbg_get_lblkno_t | get_lblkno, | ||
vbg_get_blksize_t | get_blksize | ||
) |
void vfs_bio_set_flags | ( | struct buf * | bp, |
int | ioflag | ||
) |
Definition at line 4953 of file vfs_bio.c.
References b_io_dismiss().
void vfs_bio_set_valid | ( | struct buf * | bp, |
int | base, | ||
int | size | ||
) |
Definition at line 4805 of file vfs_bio.c.
References vfs_busy_pages_acquire(), and vfs_busy_pages_release().
|
static |
Definition at line 969 of file vfs_bio.c.
Referenced by vfs_vmio_extend().
void vfs_busy_pages | ( | struct buf * | bp, |
int | clear_modify | ||
) |
Definition at line 4738 of file vfs_bio.c.
References BUF_CHECK_MAPPED, vfs_busy_pages_acquire(), vfs_page_set_validclean(), and vfs_setdirty_range().
Referenced by breada(), breadn_flags(), bufwrite(), and cluster_read().
void vfs_busy_pages_acquire | ( | struct buf * | bp | ) |
Definition at line 4708 of file vfs_bio.c.
Referenced by cluster_rbuild(), cluster_wbuild(), vfs_bio_clrbuf(), vfs_bio_set_valid(), vfs_busy_pages(), and vfs_clean_pages_dirty_buf().
void vfs_busy_pages_release | ( | struct buf * | bp | ) |
Definition at line 4717 of file vfs_bio.c.
Referenced by vfs_bio_clrbuf(), vfs_bio_set_valid(), and vfs_clean_pages_dirty_buf().
|
static |
Definition at line 3755 of file vfs_bio.c.
References vfs_busy_pages_acquire(), vfs_busy_pages_release(), vfs_page_set_validclean(), and vfs_setdirty_range().
Referenced by bdwrite().
|
static |
Definition at line 4297 of file vfs_bio.c.
References bufmallocadjust(), bufmallocspace, bufspace_adjust(), free(), malloc(), maxbufmallocspace, and vm_hold_load_pages().
Referenced by allocbuf().
|
static |
Definition at line 4274 of file vfs_bio.c.
References bufmallocadjust(), bufspace_adjust(), free(), and vm_hold_free_pages().
Referenced by allocbuf().
|
static |
Definition at line 4647 of file vfs_bio.c.
Referenced by vfs_vmio_iodone().
|
static |
Definition at line 4676 of file vfs_bio.c.
Referenced by vfs_busy_pages(), and vfs_clean_pages_dirty_buf().
|
static |
Definition at line 3784 of file vfs_bio.c.
Referenced by vfs_busy_pages(), and vfs_clean_pages_dirty_buf().
void vfs_unbusy_pages | ( | struct buf * | bp | ) |
Definition at line 4608 of file vfs_bio.c.
References BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, panic(), and runningbufwakeup().
|
static |
Definition at line 3104 of file vfs_bio.c.
References bpmap_qenter(), BUF_CHECK_UNMAPPED, maxbcachebuf, and vfs_buf_test_cache().
Referenced by allocbuf().
|
static |
Definition at line 3006 of file vfs_bio.c.
References BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, flags, and panic().
Referenced by brelse().
|
static |
Definition at line 2935 of file vfs_bio.c.
References BUF_CHECK_MAPPED, panic(), and vfs_page_set_valid().
Referenced by bufdone().
|
static |
Definition at line 3059 of file vfs_bio.c.
References BUF_CHECK_MAPPED, BUF_CHECK_UNMAPPED, and flags.
Referenced by allocbuf().
|
static |
Definition at line 4997 of file vfs_bio.c.
References BUF_CHECK_MAPPED.
Referenced by vfs_nonvmio_truncate().
|
static |
Definition at line 4965 of file vfs_bio.c.
References BUF_CHECK_MAPPED, and maxbcachebuf.
Referenced by vfs_nonvmio_extend().
int vmapbuf | ( | struct buf * | bp, |
void * | uaddr, | ||
size_t | len, | ||
int | mapbuf | ||
) |
Definition at line 5033 of file vfs_bio.c.
References unmapped_buf.
void vunmapbuf | ( | struct buf * | bp | ) |
Definition at line 5064 of file vfs_bio.c.
References unmapped_buf.
void waitrunningbufspace | ( | void | ) |
Definition at line 950 of file vfs_bio.c.
References hirunningspace, rbreqlock, runningbufreq, and runningbufspace.
Referenced by bufwrite(), and flushbufqueues().
int altbufferflushes |
Definition at line 260 of file vfs_bio.c.
Referenced by bufbdflush().
|
static |
Definition at line 319 of file vfs_bio.c.
Referenced by bufwrite().
long bd_bufspacethresh |
Definition at line 8 of file vfs_bio.c.
Referenced by bufspace_adjust(), and bufspace_reserve().
struct bufqueue bd_dirtyq |
Definition at line 1 of file vfs_bio.c.
Referenced by bufqueue().
|
static |
Definition at line 355 of file vfs_bio.c.
Referenced by bd_speedup(), bd_wakeup(), buf_daemon(), and buf_daemon_shutdown().
static bool bd_shutdown |
Definition at line 17 of file vfs_bio.c.
Referenced by buf_daemon(), and buf_daemon_shutdown().
|
static |
Definition at line 363 of file vfs_bio.c.
Referenced by bd_speedup(), and buf_daemon().
struct bufqueue bd_subq[MAXCPU+1] |
Definition at line 0 of file vfs_bio.c.
Referenced by bufqueue().
struct bufdomainset bdhidirty |
Definition at line 390 of file vfs_bio.c.
Referenced by bd_clear(), bd_set(), and buf_dirty_count_severe().
|
static |
Definition at line 343 of file vfs_bio.c.
Referenced by bd_clear(), bd_set(), bdirtywakeup(), bufinit(), and bwillwrite().
|
static |
Definition at line 375 of file vfs_bio.c.
Referenced by bdirtywakeup(), and bwillwrite().
|
static |
Definition at line 332 of file vfs_bio.c.
Referenced by bd_speedup(), bd_wakeup(), buf_daemon(), buf_daemon_shutdown(), and bufinit().
struct bufdomainset bdlodirty |
Definition at line 389 of file vfs_bio.c.
Referenced by bd_clear(), bd_set(), and buf_daemon().
struct bufdomain __exclusive_cache_line bdomain[BUF_DOMAINS] |
Definition at line 396 of file vfs_bio.c.
Referenced by buf_daemon(), bufbdflush(), bufdomain(), bufinit(), bufkva_reclaim(), getnewbuf(), sysctl_bufdomain_int(), sysctl_bufdomain_long(), sysctl_bufspace(), and sysctl_numdirtybuffers().
struct bufqueue __exclusive_cache_line bqempty |
Definition at line 397 of file vfs_bio.c.
Referenced by buf_import(), buf_release(), bufinit(), and bufqueue().
|
static |
Definition at line 153 of file vfs_bio.c.
Referenced by bd_flush(), breada(), breadn_flags(), buf_alloc(), buf_import(), buf_recycle(), buf_release(), bufbdflush(), bufdone(), bufinit(), bufshutdown(), flushbufqueues(), getblk(), getblkx(), geteblk(), getnewbuf(), kern_vfs_bio_buffer_alloc(), nbufp(), vfs_bio_clcheck(), and vfs_bio_getpages().
|
static |
Definition at line 393 of file vfs_bio.c.
Referenced by buf_daemon(), bufinit(), bufkva_reclaim(), bufobj_init(), sysctl_bufdomain_int(), sysctl_bufdomain_long(), sysctl_bufspace(), and sysctl_numdirtybuffers().
|
static |
struct buf_ops buf_ops_bio |
Definition at line 98 of file vfs_bio.c.
Referenced by getnewvnode().
|
static |
Definition at line 5228 of file vfs_bio.c.
Referenced by vfs_bio_getpages().
|
static |
uma_zone_t buf_zone |
Definition at line 402 of file vfs_bio.c.
Referenced by buf_alloc(), buf_free(), and bufinit().
struct proc* bufdaemonproc |
Definition at line 164 of file vfs_bio.c.
Referenced by flushbufqueues().
|
static |
Definition at line 243 of file vfs_bio.c.
Referenced by buf_recycle(), and bufinit().
|
static |
Definition at line 240 of file vfs_bio.c.
Referenced by bufinit(), and bufkva_free().
|
static |
Definition at line 211 of file vfs_bio.c.
Referenced by bufinit(), bufkva_alloc(), and bufkva_free().
|
static |
Definition at line 219 of file vfs_bio.c.
Referenced by bufmallocadjust(), and vfs_nonvmio_extend().
int dirtybufferflushes |
Definition at line 254 of file vfs_bio.c.
Referenced by bufbdflush().
|
static |
Definition at line 313 of file vfs_bio.c.
Referenced by bufspace_wait().
|
static |
Definition at line 3539 of file vfs_bio.c.
Referenced by flushbufqueues().
|
static |
Definition at line 298 of file vfs_bio.c.
Referenced by bufinit(), and getnewbuf().
|
static |
Definition at line 301 of file vfs_bio.c.
Referenced by bufinit(), and getnewbuf().
|
static |
Definition at line 250 of file vfs_bio.c.
Referenced by bufinit(), bufwrite(), flushbufqueues(), sysctl_runningspace(), and waitrunningbufspace().
|
extern |
Referenced by biodone().
|
static |
Definition at line 246 of file vfs_bio.c.
Referenced by buf_daemon(), bufinit(), runningbufwakeup(), and sysctl_runningspace().
|
static |
Definition at line 305 of file vfs_bio.c.
Referenced by bp_unmapped_get_kva(), and bufinit().
int maxbcachebuf = MAXBCACHEBUF |
Definition at line 325 of file vfs_bio.c.
Referenced by bufinit(), bufkva_alloc(), getblkx(), kern_vfs_bio_buffer_alloc(), maxbcachebuf_adjust(), nbufp(), vfs_vmio_extend(), and vm_hold_load_pages().
|
static |
Definition at line 222 of file vfs_bio.c.
Referenced by bufinit(), and vfs_nonvmio_extend().
|
static |
|
static |
Definition at line 316 of file vfs_bio.c.
Referenced by bufinit(), and flushbufqueues().
|
static |
Definition at line 310 of file vfs_bio.c.
Referenced by buf_alloc(), and bufinit().
|
static |
Definition at line 338 of file vfs_bio.c.
Referenced by bufinit(), runningwakeup(), sysctl_runningspace(), and waitrunningbufspace().
|
static |
Definition at line 370 of file vfs_bio.c.
Referenced by runningwakeup(), and waitrunningbufspace().
long runningbufspace |
Definition at line 206 of file vfs_bio.c.
Referenced by buf_daemon(), bufwrite(), flushbufqueues(), runningbufwakeup(), and waitrunningbufspace().
caddr_t __read_mostly unmapped_buf |
Definition at line 161 of file vfs_bio.c.
Referenced by aio_qbio(), bdata2bio(), biodone(), bp_unmapped_get_kva(), buf_alloc(), bufinit(), bufkva_alloc(), bufkva_free(), cluster_rbuild(), cluster_wbuild(), physio(), vfs_bio_awrite(), vmapbuf(), and vunmapbuf().