master - device: Queue any aio beyond defined limits.
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3e29c80122b8eb1123e42d143f17dd7bddefedcd Commit: 3e29c80122b8eb1123e42d143f17dd7bddefedcd Parent: db41fe6c5dab7ff66db9c0568f0e1e1b31657be3 Author: Alasdair G Kergon <[email protected]> AuthorDate: Mon Jan 22 18:26:03 2018 +0000 Committer: Alasdair G Kergon <[email protected]> CommitterDate: Thu Feb 8 20:15:37 2018 +0000
device: Queue any aio beyond defined limits.
--- WHATS_NEW | 1 + conf/example.conf.in | 11 +++++ lib/config/config_settings.h | 7 +++ lib/config/defaults.h | 2 + lib/device/dev-io.c | 85 ++++++++++++++++++++++++++++++++++++++++- lib/device/device.h | 1 + 6 files changed, 104 insertions(+), 3 deletions(-)
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.178 - ===================================== + Add devices/use_aio, aio_max, aio_memory to configure AIO limits. Support asynchronous I/O when scanning devices. Detect asynchronous I/O capability in configure or accept --disable-aio. Add AIO_SUPPORTED_CODE_PATH to indicate whether AIO may be used.
conf/example.conf.in +11 -0
@@ -64,6 +64,17 @@ devices { # This configuration option has an automatic default value. # use_aio = 1 + # Configuration option devices/aio_max. + # Maximum number of asynchronous I/Os to issue concurrently. + # This configuration option has an automatic default value. + # aio_max = 128 + + # Configuration option devices/aio_memory. + # Approximate maximum total amount of memory (in MB) used + # for asynchronous I/O buffers. + # This configuration option has an automatic default value. + # aio_memory = 10 + # Configuration option devices/obtain_device_list_from_udev. # Obtain the list of available devices from udev. # This avoids opening or using any inapplicable non-block devices or
lib/config/config_settings.h +7 -0
@@ -229,6 +229,13 @@ cfg_array(devices_scan_CFG, "scan", devices_CFG_SECTION, CFG_ADVANCED, CFG_TYPE_cfg (devices_use_aio_CFG,"use_aio" , devices_CFG_SECTION,CFG_DEFAULT_COMMENTED ,CFG_TYPE_BOOL ,DEFAULT_USE_AIO ,vsn (2 ,2 ,178 ),NULL ,0 ,NULL , "Use linux asynchronous I/O for parallel device access where possible.\n") +cfg (devices_aio_max_CFG,"aio_max" , devices_CFG_SECTION,CFG_DEFAULT_COMMENTED ,CFG_TYPE_INT ,DEFAULT_AIO_MAX ,vsn (2 ,2 ,178 ),NULL ,0 ,NULL , + "Maximum number of asynchronous I/Os to issue concurrently.\n") + +cfg (devices_aio_memory_CFG,"aio_memory" , devices_CFG_SECTION,CFG_DEFAULT_COMMENTED ,CFG_TYPE_INT ,DEFAULT_AIO_MEMORY ,vsn (2 ,2 ,178 ),NULL ,0 ,NULL , +"Approximate maximum total amount of memory (in MB) used\n" + "for asynchronous I/O buffers.\n") + cfg_array(devices_loopfiles_CFG, "loopfiles", devices_CFG_SECTION, CFG_DEFAULT_UNDEFINED | CFG_UNSUPPORTED, CFG_TYPE_STRING, NULL, vsn(1, 2, 0), NULL, 0, NULL, NULL) cfg(devices_obtain_device_list_from_udev_CFG, "obtain_device_list_from_udev", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV, vsn(2, 2, 85), NULL, 0, NULL,
lib/config/defaults.h +2 -0
@@ -33,6 +33,8 @@#define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 1#define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none"#define DEFAULT_USE_AIO 1 +#define DEFAULT_AIO_MAX 128 +#define DEFAULT_AIO_MEMORY 10#define DEFAULT_SYSFS_SCAN 1#define DEFAULT_MD_COMPONENT_DETECTION 1#define DEFAULT_FW_RAID_COMPONENT_DETECTION 0
lib/device/dev-io.c +82 -3
161 lines not on this page · raw message
lib/device/device.h +1 -0
@@ -100,6 +100,7 @@ struct device_buffer {lvm_callback_fn_t dev_read_callback_fn;void *dev_read_callback_context; +struct dm_list aio_queued;/* Queue of async I/O waiting to be issued */ };/*