]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: target: tcmu: Make cmd_ring_size changeable via configfs
authorGuixin Liu <kanie@linux.alibaba.com>
Wed, 16 Feb 2022 02:21:49 +0000 (10:21 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 23 Feb 2022 02:11:07 +0000 (21:11 -0500)
commit8ca9bcffb52a4bf52cb4128af7ff32110126f5f2
treef465a5a3eb074e1e2f468605c2970c3d199fda0a
parentd6149c887cdb9458b1ff3f1f1ea4ba68975c647f
scsi: target: tcmu: Make cmd_ring_size changeable via configfs

Make cmd_ring_size changeable similar to the way it is done for
max_data_area_mb. The reason is that our tcmu client will create thousands
of tcmu instances, and this will consume lots of mem with default 8Mb cmd
ring size for every backstore.

One can change the value by typing:

    echo "cmd_ring_size_mb=N" > control

The "N" is a integer between 1 to 8, if set 1, the cmd ring can hold about
6k cmds(tcmu_cmd_entry about 176 byte) at least.

The value is printed when doing:

    cat info

In addition, a new readonly attribute 'cmd_ring_size_mb' returns the value
in read.

Link: https://lore.kernel.org/r/1644978109-14885-1-git-send-email-kanie@linux.alibaba.com
Reviewed-by: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
Reviewed-by: Bodo Stroesser <bostroesser@gmail.com>
Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/target/target_core_user.c