FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/capsicum.h>
#include <sys/eventhandler.h>
#include <sys/sysproto.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/module.h>
#include <sys/kthread.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/unistd.h>
#include <sys/posix4.h>
#include <sys/proc.h>
#include <sys/resourcevar.h>
#include <sys/signalvar.h>
#include <sys/syscallsubr.h>
#include <sys/protosw.h>
#include <sys/rwlock.h>
#include <sys/sema.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/syscall.h>
#include <sys/sysent.h>
#include <sys/sysctl.h>
#include <sys/syslog.h>
#include <sys/sx.h>
#include <sys/taskqueue.h>
#include <sys/vnode.h>
#include <sys/conf.h>
#include <sys/event.h>
#include <sys/mount.h>
#include <geom/geom.h>
#include <machine/atomic.h>
#include <vm/vm.h>
#include <vm/vm_page.h>
#include <vm/vm_extern.h>
#include <vm/pmap.h>
#include <vm/vm_map.h>
#include <vm/vm_object.h>
#include <vm/uma.h>
#include <sys/aio.h>
Go to the source code of this file.
Data Structures | |
struct | aioproc |
struct | aioliojob |
struct | kaioinfo |
struct | aiocb_ops |
Macros | |
#define | MAX_AIO_PER_PROC 32 |
#define | MAX_AIO_QUEUE_PER_PROC 256 |
#define | MAX_AIO_QUEUE 1024 /* Bigger than MAX_AIO_QUEUE_PER_PROC */ |
#define | MAX_BUF_AIO 16 |
#define | KAIOCB_QUEUEING 0x01 |
#define | KAIOCB_CANCELLED 0x02 |
#define | KAIOCB_CANCELLING 0x04 |
#define | KAIOCB_CHECKSYNC 0x08 |
#define | KAIOCB_CLEARED 0x10 |
#define | KAIOCB_FINISHED 0x20 |
#define | AIOP_FREE 0x1 /* proc on free queue */ |
#define | LIOJ_SIGNAL 0x1 /* signal on all done (lio) */ |
#define | LIOJ_SIGNAL_POSTED 0x2 /* signal has been posted */ |
#define | LIOJ_KEVENT_POSTED 0x4 /* kevent triggered */ |
#define | AIO_LOCK(ki) mtx_lock(&(ki)->kaio_mtx) |
#define | AIO_UNLOCK(ki) mtx_unlock(&(ki)->kaio_mtx) |
#define | AIO_LOCK_ASSERT(ki, f) mtx_assert(&(ki)->kaio_mtx, (f)) |
#define | AIO_MTX(ki) (&(ki)->kaio_mtx) |
#define | KAIO_RUNDOWN 0x1 /* process is being run down */ |
#define | KAIO_WAKEUP 0x2 /* wakeup process when AIO completes */ |
Functions | |
__FBSDID ("$FreeBSD$") | |
FEATURE (aio, "Asynchronous I/O") | |
SYSCTL_DECL (_p1003_1b) | |
static | MALLOC_DEFINE (M_LIO, "lio", "listio aio control block list") |
static | MALLOC_DEFINE (M_AIOS, "aios", "aio_suspend aio control block list") |
static | SYSCTL_NODE (_vfs, OID_AUTO, aio, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Async IO management") |
SYSCTL_INT (_vfs_aio, OID_AUTO, enable_unsafe, CTLFLAG_RW, &enable_aio_unsafe, 0, "Permit asynchronous IO on all file types, not just known-safe types") | |
SYSCTL_UINT (_vfs_aio, OID_AUTO, unsafe_warningcnt, CTLFLAG_RW, &unsafe_warningcnt, 0, "Warnings that will be triggered upon failed IO requests on unsafe files") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, max_aio_procs, CTLFLAG_RW, &max_aio_procs, 0, "Maximum number of kernel processes to use for handling async IO ") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, num_aio_procs, CTLFLAG_RD, &num_aio_procs, 0, "Number of presently active kernel processes for async IO") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, target_aio_procs, CTLFLAG_RW, &target_aio_procs, 0, "Preferred number of ready kernel processes for async IO") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, max_aio_queue, CTLFLAG_RW, &max_queue_count, 0, "Maximum number of aio requests to queue, globally") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, num_queue_count, CTLFLAG_RD, &num_queue_count, 0, "Number of queued aio requests") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, num_buf_aio, CTLFLAG_RD, &num_buf_aio, 0, "Number of aio requests presently handled by the buf subsystem") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, num_unmapped_aio, CTLFLAG_RD, &num_unmapped_aio, 0, "Number of aio requests presently handled by unmapped I/O buffers") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, aiod_lifetime, CTLFLAG_RW, &aiod_lifetime, 0, "Maximum lifetime for idle aiod") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, max_aio_per_proc, CTLFLAG_RW, &max_aio_per_proc, 0, "Maximum active aio requests per process") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, max_aio_queue_per_proc, CTLFLAG_RW, &max_aio_queue_per_proc, 0, "Maximum queued aio requests per process") | |
SYSCTL_INT (_vfs_aio, OID_AUTO, max_buf_aio, CTLFLAG_RW, &max_buf_aio, 0, "Maximum buf aio requests per process") | |
SYSCTL_INT (_p1003_1b, CTL_P1003_1B_AIO_LISTIO_MAX, aio_listio_max, CTLFLAG_RD|CTLFLAG_CAPRD, &max_aio_queue_per_proc, 0, "Maximum aio requests for a single lio_listio call") | |
static | TAILQ_HEAD (aioproc) |
TASKQUEUE_DEFINE_THREAD (aiod_kick) | |
static int | aio_modload (struct module *module, int cmd, void *arg) |
DECLARE_MODULE (aio, aio_mod, SI_SUB_VFS, SI_ORDER_ANY) | |
MODULE_VERSION (aio, 1) | |
static int | aio_onceonly (void) |
void | aio_init_aioinfo (struct proc *p) |
static int | aio_sendsig (struct proc *p, struct sigevent *sigev, ksiginfo_t *ksi, bool ext) |
static int | aio_free_entry (struct kaiocb *job) |
static void | aio_proc_rundown_exec (void *arg, struct proc *p, struct image_params *imgp __unused) |
static int | aio_cancel_job (struct proc *p, struct kaioinfo *ki, struct kaiocb *job) |
static void | aio_proc_rundown (void *arg, struct proc *p) |
static struct kaiocb * | aio_selectjob (struct aioproc *aiop) |
static int | aio_fsync_vnode (struct thread *td, struct vnode *vp, int op) |
static void | aio_process_rw (struct kaiocb *job) |
static void | aio_process_sync (struct kaiocb *job) |
static void | aio_process_mlock (struct kaiocb *job) |
static void | aio_bio_done_notify (struct proc *userp, struct kaiocb *job) |
static void | aio_schedule_fsync (void *context, int pending) |
bool | aio_cancel_cleared (struct kaiocb *job) |
static bool | aio_clear_cancel_function_locked (struct kaiocb *job) |
bool | aio_clear_cancel_function (struct kaiocb *job) |
static bool | aio_set_cancel_function_locked (struct kaiocb *job, aio_cancel_fn_t *func) |
bool | aio_set_cancel_function (struct kaiocb *job, aio_cancel_fn_t *func) |
void | aio_complete (struct kaiocb *job, long status, int error) |
void | aio_cancel (struct kaiocb *job) |
void | aio_switch_vmspace (struct kaiocb *job) |
static void | aio_daemon (void *_id) |
static int | aio_newproc (int *start) |
static int | aio_qbio (struct proc *p, struct kaiocb *job) |
static int | aiocb_copyin (struct aiocb *ujob, struct kaiocb *kjob, int type) |
static long | aiocb_fetch_status (struct aiocb *ujob) |
static long | aiocb_fetch_error (struct aiocb *ujob) |
static int | aiocb_store_status (struct aiocb *ujob, long status) |
static int | aiocb_store_error (struct aiocb *ujob, long error) |
static int | aiocb_store_kernelinfo (struct aiocb *ujob, long jobref) |
static int | aiocb_store_aiocb (struct aiocb **ujobp, struct aiocb *ujob) |
int | aio_aqueue (struct thread *td, struct aiocb *ujob, struct aioliojob *lj, int type, struct aiocb_ops *ops) |
static void | aio_cancel_daemon_job (struct kaiocb *job) |
void | aio_schedule (struct kaiocb *job, aio_handle_fn_t *func) |
static void | aio_cancel_sync (struct kaiocb *job) |
int | aio_queue_file (struct file *fp, struct kaiocb *job) |
static void | aio_kick_nowait (struct proc *userp) |
static int | aio_kick (struct proc *userp) |
static void | aio_kick_helper (void *context, int pending) |
static int | kern_aio_return (struct thread *td, struct aiocb *ujob, struct aiocb_ops *ops) |
int | sys_aio_return (struct thread *td, struct aio_return_args *uap) |
static int | kern_aio_suspend (struct thread *td, int njoblist, struct aiocb **ujoblist, struct timespec *ts) |
int | sys_aio_suspend (struct thread *td, struct aio_suspend_args *uap) |
int | sys_aio_cancel (struct thread *td, struct aio_cancel_args *uap) |
static int | kern_aio_error (struct thread *td, struct aiocb *ujob, struct aiocb_ops *ops) |
int | sys_aio_error (struct thread *td, struct aio_error_args *uap) |
int | sys_aio_read (struct thread *td, struct aio_read_args *uap) |
int | sys_aio_readv (struct thread *td, struct aio_readv_args *uap) |
int | sys_aio_write (struct thread *td, struct aio_write_args *uap) |
int | sys_aio_writev (struct thread *td, struct aio_writev_args *uap) |
int | sys_aio_mlock (struct thread *td, struct aio_mlock_args *uap) |
static int | kern_lio_listio (struct thread *td, int mode, struct aiocb *const *uacb_list, struct aiocb **acb_list, int nent, struct sigevent *sig, struct aiocb_ops *ops) |
int | sys_lio_listio (struct thread *td, struct lio_listio_args *uap) |
static void | aio_biocleanup (struct bio *bp) |
static void | aio_biowakeup (struct bio *bp) |
static int | kern_aio_waitcomplete (struct thread *td, struct aiocb **ujobp, struct timespec *ts, struct aiocb_ops *ops) |
int | sys_aio_waitcomplete (struct thread *td, struct aio_waitcomplete_args *uap) |
static int | kern_aio_fsync (struct thread *td, int op, struct aiocb *ujob, struct aiocb_ops *ops) |
int | sys_aio_fsync (struct thread *td, struct aio_fsync_args *uap) |
static int | filt_aioattach (struct knote *kn) |
static void | filt_aiodetach (struct knote *kn) |
static int | filt_aio (struct knote *kn, long hint) |
static int | filt_lioattach (struct knote *kn) |
static void | filt_liodetach (struct knote *kn) |
static int | filt_lio (struct knote *kn, long hint) |
Variables | |
static u_long | jobrefid |
static uint64_t | jobseqno |
static int | enable_aio_unsafe = 0 |
static unsigned int | unsafe_warningcnt = 1 |
static int | max_aio_procs = MAX_AIO_PROCS |
static int | num_aio_procs = 0 |
static int | target_aio_procs = TARGET_AIO_PROCS |
static int | max_queue_count = MAX_AIO_QUEUE |
static int | num_queue_count = 0 |
static int | num_buf_aio = 0 |
static int | num_unmapped_aio = 0 |
static int | num_aio_resv_start = 0 |
static int | aiod_lifetime |
static int | max_aio_per_proc = MAX_AIO_PER_PROC |
static int | max_aio_queue_per_proc = MAX_AIO_QUEUE_PER_PROC |
static int | max_buf_aio = MAX_BUF_AIO |
static struct filterops | lio_filtops |
static eventhandler_tag | exit_tag |
static eventhandler_tag | exec_tag |
static moduledata_t | aio_mod |
static struct aiocb_ops | aiocb_ops |
#define AIO_LOCK_ASSERT | ( | ki, | |
f | |||
) | mtx_assert(&(ki)->kaio_mtx, (f)) |
#define KAIO_WAKEUP 0x2 /* wakeup process when AIO completes */ |
#define LIOJ_SIGNAL_POSTED 0x2 /* signal has been posted */ |
#define MAX_AIO_QUEUE 1024 /* Bigger than MAX_AIO_QUEUE_PER_PROC */ |
__FBSDID | ( | "$FreeBSD$" | ) |
int aio_aqueue | ( | struct thread * | td, |
struct aiocb * | ujob, | ||
struct aioliojob * | lj, | ||
int | type, | ||
struct aiocb_ops * | ops | ||
) |
Definition at line 1506 of file vfs_aio.c.
References aio_bio_done_notify(), aiocb_ops::aio_copyin, aio_init_aioinfo(), AIO_LOCK, AIO_MTX, aio_process_mlock(), aio_queue_file(), aio_schedule(), AIO_UNLOCK, cap_fsync_rights, cap_no_rights, cap_pread_rights, cap_pwrite_rights, crfree(), crhold(), fd, fget(), fget_read(), fget_write(), free(), jobrefid, jobseqno, kaioinfo::kaio_count, KAIOCB_FINISHED, KAIOCB_QUEUEING, knlist_init_mtx(), kqfd_register(), aioliojob::lioj_count, max_aio_queue_per_proc, max_queue_count, num_queue_count, path_fileops, aiocb_ops::store_error, aiocb_ops::store_kernelinfo, aiocb_ops::store_status, and type.
Referenced by kern_aio_fsync(), kern_lio_listio(), sys_aio_mlock(), sys_aio_read(), sys_aio_readv(), sys_aio_write(), and sys_aio_writev().
|
static |
Definition at line 878 of file vfs_aio.c.
References aio_clear_cancel_function_locked(), AIO_LOCK_ASSERT, aio_sendsig(), kaioinfo::kaio_flags, KAIO_RUNDOWN, KAIO_WAKEUP, KAIOCB_CHECKSYNC, KAIOCB_FINISHED, aioliojob::lioj_count, aioliojob::lioj_finished_count, aioliojob::lioj_flags, LIOJ_KEVENT_POSTED, aioliojob::lioj_signal, LIOJ_SIGNAL, LIOJ_SIGNAL_POSTED, taskqueue_enqueue(), and wakeup().
Referenced by aio_aqueue(), aio_cancel_job(), and aio_complete().
|
static |
Definition at line 2446 of file vfs_aio.c.
References AIO_LOCK, AIO_UNLOCK, buf, free(), maxphys, num_buf_aio, and num_unmapped_aio.
Referenced by aio_biowakeup(), and aio_qbio().
|
static |
Definition at line 2473 of file vfs_aio.c.
References aio_biocleanup(), aio_complete(), flags, and nbytes.
Referenced by aio_qbio().
void aio_cancel | ( | struct kaiocb * | job | ) |
Definition at line 1053 of file vfs_aio.c.
References aio_complete().
Referenced by aio_cancel_daemon_job(), aio_cancel_sync(), aio_queue_file(), aio_schedule(), soaio_process_job(), and soo_aio_cancel().
bool aio_cancel_cleared | ( | struct kaiocb * | job | ) |
Definition at line 966 of file vfs_aio.c.
References KAIOCB_CLEARED.
Referenced by aio_cancel_daemon_job(), aio_cancel_sync(), and soo_aio_cancel().
|
static |
Definition at line 1751 of file vfs_aio.c.
References aio_cancel(), and aio_cancel_cleared().
Referenced by aio_schedule().
|
static |
Definition at line 579 of file vfs_aio.c.
References aio_bio_done_notify(), AIO_LOCK, AIO_LOCK_ASSERT, AIO_UNLOCK, KAIOCB_CANCELLED, KAIOCB_CANCELLING, and KAIOCB_FINISHED.
Referenced by aio_proc_rundown(), and sys_aio_cancel().
|
static |
Definition at line 1778 of file vfs_aio.c.
References aio_cancel(), aio_cancel_cleared(), AIO_LOCK, and AIO_UNLOCK.
Referenced by aio_queue_file().
bool aio_clear_cancel_function | ( | struct kaiocb * | job | ) |
Definition at line 993 of file vfs_aio.c.
References aio_clear_cancel_function_locked(), AIO_LOCK, and AIO_UNLOCK.
Referenced by aio_selectjob(), and soaio_process_sb().
|
static |
Definition at line 979 of file vfs_aio.c.
References AIO_LOCK_ASSERT, KAIOCB_CANCELLING, and KAIOCB_CLEARED.
Referenced by aio_bio_done_notify(), and aio_clear_cancel_function().
void aio_complete | ( | struct kaiocb * | job, |
long | status, | ||
int | error | ||
) |
Definition at line 1030 of file vfs_aio.c.
References aio_bio_done_notify(), AIO_LOCK, AIO_UNLOCK, KAIOCB_CANCELLING, KAIOCB_FINISHED, and KAIOCB_QUEUEING.
Referenced by aio_biowakeup(), aio_cancel(), aio_process_mlock(), aio_process_rw(), aio_process_sync(), soaio_process_job(), and soo_aio_cancel().
|
static |
Definition at line 1071 of file vfs_aio.c.
References aio_selectjob(), aiod_lifetime, AIOP_FREE, aioproc::aioprocflags, free_unr(), kaioinfo::kaio_active_count, kproc_exit(), num_aio_procs, and target_aio_procs.
Referenced by aio_newproc().
|
static |
Definition at line 494 of file vfs_aio.c.
References AIO_LOCK, AIO_LOCK_ASSERT, AIO_UNLOCK, crfree(), free(), kaioinfo::kaio_count, KAIOCB_FINISHED, aioliojob::lioj_count, aioliojob::lioj_finished_count, num_queue_count, and sigqueue_take().
Referenced by aio_proc_rundown(), kern_aio_return(), and kern_aio_waitcomplete().
|
static |
Definition at line 724 of file vfs_aio.c.
References vn_finished_write(), and vn_start_write().
Referenced by aio_process_sync().
void aio_init_aioinfo | ( | struct proc * | p | ) |
Definition at line 437 of file vfs_aio.c.
References aio_kick_helper(), aio_newproc(), aio_schedule_fsync(), kaioinfo::kaio_active_count, kaioinfo::kaio_buffer_count, kaioinfo::kaio_count, kaioinfo::kaio_flags, kaioinfo::kaio_mtx, max_aio_procs, num_aio_procs, and target_aio_procs.
Referenced by aio_aqueue(), kern_aio_waitcomplete(), and kern_lio_listio().
|
static |
Definition at line 1870 of file vfs_aio.c.
References aio_newproc(), aioproc::aioprocflags, kaioinfo::kaio_active_count, max_aio_per_proc, max_aio_procs, num_aio_procs, num_aio_resv_start, and wakeup().
Referenced by aio_kick_helper().
|
static |
Definition at line 1899 of file vfs_aio.c.
References aio_kick().
Referenced by aio_init_aioinfo().
|
static |
Definition at line 1853 of file vfs_aio.c.
References aioproc::aioprocflags, kaioinfo::kaio_active_count, max_aio_per_proc, max_aio_procs, num_aio_procs, num_aio_resv_start, taskqueue_enqueue(), and wakeup().
Referenced by aio_schedule().
|
static |
Definition at line 371 of file vfs_aio.c.
References aio_onceonly().
|
static |
Definition at line 1178 of file vfs_aio.c.
References aio_daemon(), alloc_unr(), free_unr(), kproc_create(), num_aio_procs, and start.
Referenced by aio_init_aioinfo(), and aio_kick().
|
static |
Definition at line 401 of file vfs_aio.c.
References aio_proc_rundown(), aio_proc_rundown_exec(), aiod_lifetime, exec_tag, exit_tag, jobrefid, kqueue_add_filteropts(), lio_filtops, MAX_AIO_QUEUE, new_unrhdr(), p31b_setcfg(), and sema_init().
Referenced by aio_modload().
|
static |
Definition at line 633 of file vfs_aio.c.
References aio_cancel_job(), aio_free_entry(), AIO_LOCK, AIO_MTX, AIO_UNLOCK, hz, kaioinfo::kaio_active_count, kaioinfo::kaio_flags, kaioinfo::kaio_mtx, KAIO_RUNDOWN, KAIO_WAKEUP, aioliojob::lioj_count, aioliojob::lioj_finished_count, panic(), sigqueue_take(), and taskqueue_drain().
Referenced by aio_onceonly(), and aio_proc_rundown_exec().
|
static |
Definition at line 572 of file vfs_aio.c.
References aio_proc_rundown().
Referenced by aio_onceonly().
|
static |
Definition at line 863 of file vfs_aio.c.
References aio_complete(), and aio_switch_vmspace().
Referenced by aio_aqueue().
|
static |
Definition at line 763 of file vfs_aio.c.
References aio_complete(), aio_switch_vmspace(), bwillwrite(), and kern_psignal().
Referenced by aio_queue_file().
|
static |
Definition at line 840 of file vfs_aio.c.
References aio_complete(), and aio_fsync_vnode().
Referenced by aio_queue_file(), and aio_schedule_fsync().
|
static |
Definition at line 1213 of file vfs_aio.c.
References aio_biocleanup(), aio_biowakeup(), AIO_LOCK, AIO_UNLOCK, buf, dev_relthread(), devvn_refthread(), free(), kaioinfo::kaio_buffer_count, malloc(), max_buf_aio, maxphys, nbytes, num_buf_aio, num_unmapped_aio, and unmapped_buf.
Referenced by aio_queue_file().
int aio_queue_file | ( | struct file * | fp, |
struct kaiocb * | job | ||
) |
Definition at line 1791 of file vfs_aio.c.
References aio_cancel(), aio_cancel_sync(), AIO_LOCK, aio_process_rw(), aio_process_sync(), aio_qbio(), aio_schedule(), aio_set_cancel_function_locked(), AIO_UNLOCK, counted_warning(), enable_aio_unsafe, KAIOCB_CHECKSYNC, and unsafe_warningcnt.
Referenced by aio_aqueue().
void aio_schedule | ( | struct kaiocb * | job, |
aio_handle_fn_t * | func | ||
) |
Definition at line 1762 of file vfs_aio.c.
References aio_cancel(), aio_cancel_daemon_job(), aio_kick_nowait(), and aio_set_cancel_function().
Referenced by aio_aqueue(), aio_queue_file(), and aio_schedule_fsync().
|
static |
Definition at line 948 of file vfs_aio.c.
References AIO_LOCK, aio_process_sync(), aio_schedule(), and AIO_UNLOCK.
Referenced by aio_init_aioinfo().
|
static |
Definition at line 694 of file vfs_aio.c.
References aio_clear_cancel_function(), kaioinfo::kaio_active_count, and max_aio_per_proc.
Referenced by aio_daemon().
|
static |
Definition at line 470 of file vfs_aio.c.
References sigev_findtd(), and tdsendsignal().
Referenced by aio_bio_done_notify(), and kern_lio_listio().
bool aio_set_cancel_function | ( | struct kaiocb * | job, |
aio_cancel_fn_t * | func | ||
) |
Definition at line 1017 of file vfs_aio.c.
References AIO_LOCK, aio_set_cancel_function_locked(), and AIO_UNLOCK.
Referenced by aio_schedule(), soaio_process_job(), and soo_aio_queue().
|
static |
Definition at line 1006 of file vfs_aio.c.
References AIO_LOCK_ASSERT, and KAIOCB_CANCELLED.
Referenced by aio_queue_file(), and aio_set_cancel_function().
void aio_switch_vmspace | ( | struct kaiocb * | job | ) |
Definition at line 1060 of file vfs_aio.c.
Referenced by aio_process_mlock(), aio_process_rw(), and soaio_process_job().
|
static |
Definition at line 1418 of file vfs_aio.c.
References copyinuio(), and type.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
DECLARE_MODULE | ( | aio | , |
aio_mod | , | ||
SI_SUB_VFS | , | ||
SI_ORDER_ANY | |||
) |
FEATURE | ( | aio | , |
"Asynchronous I/O" | |||
) |
|
static |
Definition at line 2666 of file vfs_aio.c.
References KAIOCB_FINISHED.
|
static |
Definition at line 2629 of file vfs_aio.c.
References knlist_add().
|
static |
Definition at line 2652 of file vfs_aio.c.
References knlist_empty(), and knlist_remove().
|
static |
Definition at line 2716 of file vfs_aio.c.
References aioliojob::lioj_flags, and LIOJ_KEVENT_POSTED.
|
static |
Definition at line 2679 of file vfs_aio.c.
References knlist_add().
|
static |
Definition at line 2702 of file vfs_aio.c.
References knlist_empty(), and knlist_remove().
|
static |
Definition at line 2126 of file vfs_aio.c.
References AIO_LOCK, AIO_UNLOCK, aiocb_ops::fetch_error, aiocb_ops::fetch_status, and KAIOCB_FINISHED.
Referenced by sys_aio_error().
|
static |
Definition at line 2601 of file vfs_aio.c.
References aio_aqueue().
Referenced by sys_aio_fsync().
|
static |
Definition at line 1916 of file vfs_aio.c.
References aio_free_entry(), AIO_LOCK, AIO_UNLOCK, KAIOCB_FINISHED, aiocb_ops::store_error, and aiocb_ops::store_status.
Referenced by sys_aio_return().
|
static |
Definition at line 1962 of file vfs_aio.c.
References AIO_LOCK, AIO_MTX, AIO_UNLOCK, itimerfix(), kaioinfo::kaio_flags, KAIO_WAKEUP, KAIOCB_FINISHED, ts, and tvtohz().
Referenced by sys_aio_suspend().
|
static |
Definition at line 2513 of file vfs_aio.c.
References aio_free_entry(), aio_init_aioinfo(), AIO_LOCK, AIO_MTX, AIO_UNLOCK, itimerfix(), kaioinfo::kaio_flags, KAIO_WAKEUP, KAIOCB_FINISHED, aiocb_ops::store_aiocb, aiocb_ops::store_error, aiocb_ops::store_status, ts, and tvtohz().
Referenced by sys_aio_waitcomplete().
|
static |
Definition at line 2231 of file vfs_aio.c.
References aio_aqueue(), aio_init_aioinfo(), AIO_LOCK, AIO_MTX, aio_sendsig(), AIO_UNLOCK, kaioinfo::kaio_flags, KAIO_WAKEUP, knlist_init_mtx(), kqfd_register(), aioliojob::lioj_count, aioliojob::lioj_finished_count, aioliojob::lioj_flags, LIOJ_KEVENT_POSTED, aioliojob::lioj_signal, LIOJ_SIGNAL, LIOJ_SIGNAL_POSTED, max_aio_queue_per_proc, mode, and sigqueue_take().
Referenced by sys_lio_listio().
|
static |
|
static |
MODULE_VERSION | ( | aio | , |
1 | |||
) |
int sys_aio_cancel | ( | struct thread * | td, |
struct aio_cancel_args * | uap | ||
) |
Definition at line 2050 of file vfs_aio.c.
References aio_cancel_job(), AIO_LOCK, AIO_UNLOCK, cap_no_rights, fget(), and vn_isdisk().
int sys_aio_error | ( | struct thread * | td, |
struct aio_error_args * | uap | ||
) |
Definition at line 2167 of file vfs_aio.c.
References kern_aio_error().
int sys_aio_fsync | ( | struct thread * | td, |
struct aio_fsync_args * | uap | ||
) |
Definition at line 2621 of file vfs_aio.c.
References kern_aio_fsync().
int sys_aio_mlock | ( | struct thread * | td, |
struct aio_mlock_args * | uap | ||
) |
Definition at line 2224 of file vfs_aio.c.
References aio_aqueue().
int sys_aio_read | ( | struct thread * | td, |
struct aio_read_args * | uap | ||
) |
Definition at line 2185 of file vfs_aio.c.
References aio_aqueue().
int sys_aio_readv | ( | struct thread * | td, |
struct aio_readv_args * | uap | ||
) |
Definition at line 2192 of file vfs_aio.c.
References aio_aqueue().
int sys_aio_return | ( | struct thread * | td, |
struct aio_return_args * | uap | ||
) |
Definition at line 1952 of file vfs_aio.c.
References kern_aio_return().
int sys_aio_suspend | ( | struct thread * | td, |
struct aio_suspend_args * | uap | ||
) |
Definition at line 2021 of file vfs_aio.c.
References free(), kern_aio_suspend(), malloc(), max_aio_queue_per_proc, and ts.
int sys_aio_waitcomplete | ( | struct thread * | td, |
struct aio_waitcomplete_args * | uap | ||
) |
Definition at line 2583 of file vfs_aio.c.
References kern_aio_waitcomplete(), and ts.
int sys_aio_write | ( | struct thread * | td, |
struct aio_write_args * | uap | ||
) |
Definition at line 2210 of file vfs_aio.c.
References aio_aqueue().
int sys_aio_writev | ( | struct thread * | td, |
struct aio_writev_args * | uap | ||
) |
Definition at line 2217 of file vfs_aio.c.
References aio_aqueue().
int sys_lio_listio | ( | struct thread * | td, |
struct lio_listio_args * | uap | ||
) |
Definition at line 2415 of file vfs_aio.c.
References free(), kern_lio_listio(), malloc(), and max_aio_queue_per_proc.
SYSCTL_DECL | ( | _p1003_1b | ) |
SYSCTL_INT | ( | _p1003_1b | , |
CTL_P1003_1B_AIO_LISTIO_MAX | , | ||
aio_listio_max | , | ||
CTLFLAG_RD| | CTLFLAG_CAPRD, | ||
& | max_aio_queue_per_proc, | ||
0 | , | ||
"Maximum aio requests for a single lio_listio call" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
aiod_lifetime | , | ||
CTLFLAG_RW | , | ||
& | aiod_lifetime, | ||
0 | , | ||
"Maximum lifetime for idle aiod" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
enable_unsafe | , | ||
CTLFLAG_RW | , | ||
& | enable_aio_unsafe, | ||
0 | , | ||
"Permit asynchronous IO on all file | types, | ||
not just known-safe types" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
max_aio_per_proc | , | ||
CTLFLAG_RW | , | ||
& | max_aio_per_proc, | ||
0 | , | ||
"Maximum active aio requests per process" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
max_aio_procs | , | ||
CTLFLAG_RW | , | ||
& | max_aio_procs, | ||
0 | , | ||
"Maximum number of kernel processes to use for handling async IO " | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
max_aio_queue | , | ||
CTLFLAG_RW | , | ||
& | max_queue_count, | ||
0 | , | ||
"Maximum number of aio requests to | queue, | ||
globally" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
max_aio_queue_per_proc | , | ||
CTLFLAG_RW | , | ||
& | max_aio_queue_per_proc, | ||
0 | , | ||
"Maximum queued aio requests per process" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
max_buf_aio | , | ||
CTLFLAG_RW | , | ||
& | max_buf_aio, | ||
0 | , | ||
"Maximum buf aio requests per process" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
num_aio_procs | , | ||
CTLFLAG_RD | , | ||
& | num_aio_procs, | ||
0 | , | ||
"Number of presently active kernel processes for async IO" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
num_buf_aio | , | ||
CTLFLAG_RD | , | ||
& | num_buf_aio, | ||
0 | , | ||
"Number of aio requests presently handled by the buf subsystem" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
num_queue_count | , | ||
CTLFLAG_RD | , | ||
& | num_queue_count, | ||
0 | , | ||
"Number of queued aio requests" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
num_unmapped_aio | , | ||
CTLFLAG_RD | , | ||
& | num_unmapped_aio, | ||
0 | , | ||
"Number of aio requests presently handled by unmapped I/O buffers" | |||
) |
SYSCTL_INT | ( | _vfs_aio | , |
OID_AUTO | , | ||
target_aio_procs | , | ||
CTLFLAG_RW | , | ||
& | target_aio_procs, | ||
0 | , | ||
"Preferred number of ready kernel processes for async IO" | |||
) |
|
static |
SYSCTL_UINT | ( | _vfs_aio | , |
OID_AUTO | , | ||
unsafe_warningcnt | , | ||
CTLFLAG_RW | , | ||
& | unsafe_warningcnt, | ||
0 | , | ||
"Warnings that will be triggered upon failed IO requests on unsafe files" | |||
) |
TASKQUEUE_DEFINE_THREAD | ( | aiod_kick | ) |
|
static |
|
static |
Definition at line 160 of file vfs_aio.c.
Referenced by aio_daemon(), and aio_onceonly().
|
static |
Definition at line 113 of file vfs_aio.c.
Referenced by aio_queue_file().
|
static |
Definition at line 363 of file vfs_aio.c.
Referenced by aio_onceonly().
|
static |
Definition at line 363 of file vfs_aio.c.
Referenced by aio_onceonly().
|
static |
Definition at line 81 of file vfs_aio.c.
Referenced by aio_aqueue(), and aio_onceonly().
|
static |
Definition at line 86 of file vfs_aio.c.
Referenced by aio_aqueue().
|
static |
Definition at line 356 of file vfs_aio.c.
Referenced by aio_onceonly().
|
static |
Definition at line 164 of file vfs_aio.c.
Referenced by aio_kick(), aio_kick_nowait(), and aio_selectjob().
|
static |
Definition at line 122 of file vfs_aio.c.
Referenced by aio_init_aioinfo(), aio_kick(), and aio_kick_nowait().
|
static |
Definition at line 169 of file vfs_aio.c.
Referenced by aio_aqueue(), kern_lio_listio(), sys_aio_suspend(), and sys_lio_listio().
|
static |
Definition at line 174 of file vfs_aio.c.
Referenced by aio_qbio().
|
static |
Definition at line 139 of file vfs_aio.c.
Referenced by aio_aqueue().
|
static |
Definition at line 126 of file vfs_aio.c.
Referenced by aio_daemon(), aio_init_aioinfo(), aio_kick(), aio_kick_nowait(), and aio_newproc().
|
static |
Definition at line 158 of file vfs_aio.c.
Referenced by aio_kick(), and aio_kick_nowait().
|
static |
Definition at line 147 of file vfs_aio.c.
Referenced by aio_biocleanup(), and aio_qbio().
|
static |
Definition at line 143 of file vfs_aio.c.
Referenced by aio_aqueue(), and aio_free_entry().
|
static |
Definition at line 151 of file vfs_aio.c.
Referenced by aio_biocleanup(), and aio_qbio().
|
static |
Definition at line 134 of file vfs_aio.c.
Referenced by aio_daemon(), and aio_init_aioinfo().
|
static |
Definition at line 117 of file vfs_aio.c.
Referenced by aio_queue_file().