diff --git a/scst/README b/scst/README index 07fe51637..7e29272ce 100644 --- a/scst/README +++ b/scst/README @@ -339,11 +339,11 @@ Module scst supports the following parameters: default it is approximately TotalMem/4. -SCST "/proc" commands +SCST /proc commands --------------------- For communications with user space programs SCST provides proc-based -interface in "/proc/scsi_tgt" directory. It contains the following +interface in /proc/scsi_tgt directory. It contains the following entries: - "help" file, which provides online help for SCST commands @@ -370,14 +370,17 @@ entries: - "version" file, which shows version of SCST - "trace_level" file, which allows to read and set trace (logging) level - for SCST. See "help" file for list of trace levels. If you want to - enable logging options, which produce a lot of events, like "debug", - to not loose logged events you should also: + for SCST. See /proc/scsi_tgt/help file for list of commands and + trace levels. If you want to enable logging options, which produce a + lot of events, like "debug", to not loose logged events you should + also: * Increase in .config of your kernel CONFIG_LOG_BUF_SHIFT variable - to much bigger value, then recompile it. For example, I use 25, - but to use it I needed to modify the maximum allowed value for - CONFIG_LOG_BUF_SHIFT in the corresponding Kconfig. + to much bigger value, then recompile it. For example, value 25 + will provide good protection from logging overflow aven under + high volume of loggin events, but to use it you will need to + modify the maximum allowed value for CONFIG_LOG_BUF_SHIFT in the + corresponding Kconfig file. * Change in your /etc/syslog.conf or other config file of your favorite logging program to store kernel logs in async manner. For example, @@ -573,10 +576,10 @@ LUNs in them. VDISK device handler -------------------- -After loading VDISK device handler creates in "/proc/scsi_tgt/" +After loading VDISK device handler creates in /proc/scsi_tgt/ subdirectories "vdisk" and "vcdrom". They have similar layout: - - "trace_level" and "type" files as described for other dev handlers + - "trace_level" and "type" files as described above - "help" file, which provides online help for VDISK commands @@ -647,6 +650,22 @@ mode is used. For example, "echo "open disk1 /vdisks/disk1" >/proc/scsi_tgt/vdisk/vdisk" will open file /vdisks/disk1 as virtual FILEIO disk with name "disk1". +Also the VDISK handler has module parameter "num_threads", which +specifies count of I/O threads for each VDISK's device. If you have a +workload, which tends to produce rather random accesses (e.g. DB-like), +you should increase this count to a bigger value, like 32. If you have a +rather sequential workload, you should decrease it to a lower value, +like number of CPUs on the target or even 1. Due to some limitations of +Linux I/O subsystem, increasing number of I/O threads leads to +performance drop, especially with deadline scheduler, so decreasing it +can improve sequential performance. The default provides a good +compromise between random and sequential accesses. + +You shouldn't be afraid to have too many VDISK I/O threads if you have +many VDISK devices. Kernel threads consume very little amount of +resources (several KBs) and only necessary threads will be used by SCST, +so the threads will not trash your system. + CAUTION: If you partitioned/formatted your device with block size X, *NEVER* ======== ever try to export and then mount it (even accidentally) with another block size. Otherwise you can *instantly* damage it pretty diff --git a/scst/README_in-tree b/scst/README_in-tree index 15f08e821..7029d25cc 100644 --- a/scst/README_in-tree +++ b/scst/README_in-tree @@ -257,11 +257,11 @@ Module scst supports the following parameters: consumed by the SCST commands for data buffers at any given time. By default it is approximately TotalMem/4. -SCST "/proc" commands +SCST /proc commands --------------------- For communications with user space programs SCST provides proc-based -interface in "/proc/scsi_tgt" directory. It contains the following +interface in /proc/scsi_tgt directory. It contains the following entries: - "help" file, which provides online help for SCST commands @@ -288,14 +288,17 @@ entries: - "version" file, which shows version of SCST - "trace_level" file, which allows to read and set trace (logging) level - for SCST. See "help" file for list of trace levels. If you want to - enable logging options, which produce a lot of events, like "debug", - to not loose logged events you should also: + for SCST. See /proc/scsi_tgt/help file for list of commands and + trace levels. If you want to enable logging options, which produce a + lot of events, like "debug", to not loose logged events you should + also: * Increase in .config of your kernel CONFIG_LOG_BUF_SHIFT variable - to much bigger value, then recompile it. For example, I use 25, - but to use it I needed to modify the maximum allowed value for - CONFIG_LOG_BUF_SHIFT in the corresponding Kconfig. + to much bigger value, then recompile it. For example, value 25 + will provide good protection from logging overflow aven under + high volume of loggin events, but to use it you will need to + modify the maximum allowed value for CONFIG_LOG_BUF_SHIFT in the + corresponding Kconfig file. * Change in your /etc/syslog.conf or other config file of your favorite logging program to store kernel logs in async manner. For example, @@ -489,10 +492,10 @@ LUNs in them. VDISK device handler -------------------- -After loading VDISK device handler creates in "/proc/scsi_tgt/" +After loading VDISK device handler creates in /proc/scsi_tgt/ subdirectories "vdisk" and "vcdrom". They have similar layout: - - "trace_level" and "type" files as described for other dev handlers + - "trace_level" and "type" files as described above - "help" file, which provides online help for VDISK commands @@ -563,6 +566,22 @@ mode is used. For example, "echo "open disk1 /vdisks/disk1" >/proc/scsi_tgt/vdisk/vdisk" will open file /vdisks/disk1 as virtual FILEIO disk with name "disk1". +Also the VDISK handler has module parameter "num_threads", which +specifies count of I/O threads for each VDISK's device. If you have a +workload, which tends to produce rather random accesses (e.g. DB-like), +you should increase this count to a bigger value, like 32. If you have a +rather sequential workload, you should decrease it to a lower value, +like number of CPUs on the target or even 1. Due to some limitations of +Linux I/O subsystem, increasing number of I/O threads leads to +performance drop, especially with deadline scheduler, so decreasing it +can improve sequential performance. The default provides a good +compromise between random and sequential accesses. + +You shouldn't be afraid to have too many VDISK I/O threads if you have +many VDISK devices. Kernel threads consume very little amount of +resources (several KBs) and only necessary threads will be used by SCST, +so the threads will not trash your system. + CAUTION: If you partitioned/formatted your device with block size X, *NEVER* ======== ever try to export and then mount it (even accidentally) with another block size. Otherwise you can *instantly* damage it pretty diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 10eb2688c..9ed2efdf6 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -232,7 +232,12 @@ struct scst_vdisk_thr { static struct kmem_cache *vdisk_thr_cachep; static struct kmem_cache *blockio_work_cachep; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) #define DEF_NUM_THREADS 5 +#else +/* Context RA patch supposed to be applied on the kernel */ +#define DEF_NUM_THREADS 8 +#endif static int num_threads = DEF_NUM_THREADS; module_param_named(num_threads, num_threads, int, S_IRUGO); diff --git a/scst/src/scst_mem.c b/scst/src/scst_mem.c index 94fe41970..dcbeaa9c0 100644 --- a/scst/src/scst_mem.c +++ b/scst/src/scst_mem.c @@ -1293,7 +1293,6 @@ int sgv_pool_init(struct sgv_pool *pool, const char *name, { int res = -ENOMEM; int i; - struct sgv_pool_obj *obj; TRACE_ENTRY(); @@ -1335,8 +1334,8 @@ int sgv_pool_init(struct sgv_pool *pool, const char *name, TRACE_MEM("name %s, sizeof(*obj)=%zd, clustering_type=%d, " "single_alloc_pages=%d, max_caches=%d, max_cached_pages=%d", - name, sizeof(*obj), clustering_type, single_alloc_pages, - pool->max_caches, pool->max_cached_pages); + name, sizeof(struct sgv_pool_obj), clustering_type, + single_alloc_pages, pool->max_caches, pool->max_cached_pages); strncpy(pool->name, name, sizeof(pool->name)-1); pool->name[sizeof(pool->name)-1] = '\0'; diff --git a/www/comparison.html b/www/comparison.html index a0a3328f7..188a84f67 100644 --- a/www/comparison.html +++ b/www/comparison.html @@ -167,7 +167,7 @@ ORDERED commands + + -,
data Persistent Reservations
(Windows 2008 clustering / RHEL5 I/O fencing) Under development, patch is + "http://sourceforge.net/mailarchive/message.php?msg_name=4A9C21DE.6050700%40open-e.com"> available for testing - - Under development