FreeBSD ZFS
The Zettabyte File System
Defines | Functions | Variables

vdev_queue.c File Reference

#include <sys/zfs_context.h>
#include <sys/vdev_impl.h>
#include <sys/zio.h>
#include <sys/avl.h>
Include dependency graph for vdev_queue.c:

Go to the source code of this file.

Defines

#define IO_SPAN(fio, lio)   ((lio)->io_offset + (lio)->io_size - (fio)->io_offset)
 Compute the range spanned by two i/os, which is the endpoint of the last (lio->io_offset + lio->io_size) minus start of the first (fio->io_offset).
#define IO_GAP(fio, lio)   (-IO_SPAN(lio, fio))

Functions

 SYSCTL_DECL (_vfs_zfs_vdev)
 TUNABLE_INT ("vfs.zfs.vdev.max_pending",&zfs_vdev_max_pending)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, max_pending, CTLFLAG_RW,&zfs_vdev_max_pending, 0,"Maximum I/O requests pending on each device")
 TUNABLE_INT ("vfs.zfs.vdev.min_pending",&zfs_vdev_min_pending)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, min_pending, CTLFLAG_RW,&zfs_vdev_min_pending, 0,"Initial number of I/O requests pending to each device")
 TUNABLE_INT ("vfs.zfs.vdev.time_shift",&zfs_vdev_time_shift)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, time_shift, CTLFLAG_RW,&zfs_vdev_time_shift, 0,"Used for calculating I/O request deadline")
 TUNABLE_INT ("vfs.zfs.vdev.ramp_rate",&zfs_vdev_ramp_rate)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, ramp_rate, CTLFLAG_RW,&zfs_vdev_ramp_rate, 0,"Exponential I/O issue ramp-up rate")
 TUNABLE_INT ("vfs.zfs.vdev.aggregation_limit",&zfs_vdev_aggregation_limit)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, aggregation_limit, CTLFLAG_RW,&zfs_vdev_aggregation_limit, 0,"I/O requests are aggregated up to this size")
 TUNABLE_INT ("vfs.zfs.vdev.read_gap_limit",&zfs_vdev_read_gap_limit)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, read_gap_limit, CTLFLAG_RW,&zfs_vdev_read_gap_limit, 0,"Acceptable gap between two reads being aggregated")
 TUNABLE_INT ("vfs.zfs.vdev.write_gap_limit",&zfs_vdev_write_gap_limit)
 SYSCTL_INT (_vfs_zfs_vdev, OID_AUTO, write_gap_limit, CTLFLAG_RW,&zfs_vdev_write_gap_limit, 0,"Acceptable gap between two writes being aggregated")
int vdev_queue_deadline_compare (const void *x1, const void *x2)
 Virtual device vector for disk I/O scheduling.
int vdev_queue_offset_compare (const void *x1, const void *x2)
void vdev_queue_init (vdev_t *vd)
void vdev_queue_fini (vdev_t *vd)
static void vdev_queue_io_add (vdev_queue_t *vq, zio_t *zio)
static void vdev_queue_io_remove (vdev_queue_t *vq, zio_t *zio)
static void vdev_queue_agg_io_done (zio_t *aio)
static zio_tvdev_queue_io_to_issue (vdev_queue_t *vq, uint64_t pending_limit)
zio_tvdev_queue_io (zio_t *zio)
void vdev_queue_io_done (zio_t *zio)

Variables

int zfs_vdev_max_pending = 10
 The maximum number of i/os concurrently pending to each device.
int zfs_vdev_min_pending = 4
 The initial number of i/os pending to each device (before it starts ramping up to max_pending).
int zfs_vdev_time_shift = 6
 deadline = pri + ddi_get_lbolt64() >> time_shift)
int zfs_vdev_ramp_rate = 2
 exponential I/O issue ramp-up rate
int zfs_vdev_aggregation_limit = SPA_MAXBLOCKSIZE
 To reduce IOPs, we aggregate small adjacent I/Os into one large I/O.
int zfs_vdev_read_gap_limit = 32 << 10
int zfs_vdev_write_gap_limit = 4 << 10

Define Documentation

#define IO_GAP (   fio,
  lio 
)    (-IO_SPAN(lio, fio))

Definition at line 204 of file vdev_queue.c.

#define IO_SPAN (   fio,
  lio 
)    ((lio)->io_offset + (lio)->io_size - (fio)->io_offset)

Compute the range spanned by two i/os, which is the endpoint of the last (lio->io_offset + lio->io_size) minus start of the first (fio->io_offset).

Conveniently, the gap between fio and lio is given by -IO_SPAN(lio, fio); thus fio and lio are adjacent if and only if IO_SPAN(lio, fio) == 0.

Definition at line 203 of file vdev_queue.c.


Function Documentation

SYSCTL_DECL ( _vfs_zfs_vdev  )
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
min_pending  ,
CTLFLAG_RW  ,
zfs_vdev_min_pending,
,
"Initial number of I/O requests pending to each device"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
ramp_rate  ,
CTLFLAG_RW  ,
zfs_vdev_ramp_rate,
,
"Exponential I/O issue ramp-up rate"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
aggregation_limit  ,
CTLFLAG_RW  ,
zfs_vdev_aggregation_limit,
,
"I/O requests are aggregated up to this size"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
max_pending  ,
CTLFLAG_RW  ,
zfs_vdev_max_pending,
,
"Maximum I/O requests pending on each device"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
read_gap_limit  ,
CTLFLAG_RW  ,
zfs_vdev_read_gap_limit,
,
"Acceptable gap between two reads being aggregated"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
time_shift  ,
CTLFLAG_RW  ,
zfs_vdev_time_shift,
,
"Used for calculating I/O request deadline"   
)
SYSCTL_INT ( _vfs_zfs_vdev  ,
OID_AUTO  ,
write_gap_limit  ,
CTLFLAG_RW  ,
zfs_vdev_write_gap_limit,
,
"Acceptable gap between two writes being aggregated"   
)
TUNABLE_INT ( "vfs.zfs.vdev.ramp_rate"  ,
zfs_vdev_ramp_rate 
)
TUNABLE_INT ( "vfs.zfs.vdev.min_pending"  ,
zfs_vdev_min_pending 
)
TUNABLE_INT ( "vfs.zfs.vdev.aggregation_limit"  ,
zfs_vdev_aggregation_limit 
)
TUNABLE_INT ( "vfs.zfs.vdev.max_pending"  ,
zfs_vdev_max_pending 
)
TUNABLE_INT ( "vfs.zfs.vdev.read_gap_limit"  ,
zfs_vdev_read_gap_limit 
)
TUNABLE_INT ( "vfs.zfs.vdev.time_shift"  ,
zfs_vdev_time_shift 
)
TUNABLE_INT ( "vfs.zfs.vdev.write_gap_limit"  ,
zfs_vdev_write_gap_limit 
)
static void vdev_queue_agg_io_done ( zio_t aio) [static]

Definition at line 185 of file vdev_queue.c.

int vdev_queue_deadline_compare ( const void *  x1,
const void *  x2 
)

Virtual device vector for disk I/O scheduling.

Definition at line 95 of file vdev_queue.c.

void vdev_queue_fini ( vdev_t vd)

Definition at line 158 of file vdev_queue.c.

void vdev_queue_init ( vdev_t vd)

Definition at line 138 of file vdev_queue.c.

zio_t* vdev_queue_io ( zio_t zio)

Definition at line 375 of file vdev_queue.c.

static void vdev_queue_io_add ( vdev_queue_t vq,
zio_t zio 
) [static]

Definition at line 171 of file vdev_queue.c.

void vdev_queue_io_done ( zio_t zio)

Definition at line 415 of file vdev_queue.c.

static void vdev_queue_io_remove ( vdev_queue_t vq,
zio_t zio 
) [static]

Definition at line 178 of file vdev_queue.c.

static zio_t* vdev_queue_io_to_issue ( vdev_queue_t vq,
uint64_t  pending_limit 
) [static]

Definition at line 207 of file vdev_queue.c.

int vdev_queue_offset_compare ( const void *  x1,
const void *  x2 
)

Definition at line 119 of file vdev_queue.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines