All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] scsi: target: tcmu: Allow data block size greater than PAGE_SIZE
@ 2021-03-24 19:28 Bodo Stroesser
  2021-03-24 19:28 ` [PATCH 1/6] scsi: target: tcmu: Adjust names of variables and definitions Bodo Stroesser
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bodo Stroesser @ 2021-03-24 19:28 UTC (permalink / raw)
  To: linux-scsi, target-devel, Martin K. Petersen
  Cc: Bodo Stroesser, Mike Christie

This series is made on top of Martin's for-next branch.

The data area tcmu uses for data transfer to and from userspace
currently is assigned in data blocks of fixed size PAGE_SIZE.
For big data areas this means, that a big bitmap needs to be
searched for free data blocks. It also means, that the data
buffer for a single scsi cmd can consist of pages which are not
consecutive from userspace point of view.
In that case, userspace receives a long list of IO vecs in the
cmd ring, each vec pointing to another part of the cmd's buffer.

The following patches allow to configure data block size as a
multiple of PAGE_SIZE. For compatibility reasons the default
is 1 * PAGE_SIZE.

Memory allocation for the data area is still done in single
pages. So we do not depend on availability of bigger memory
chunks. Since memory is allocated only once and then re-used
for many commands, it does not cause performance issues.

Advantages of big data blocks:
 - bitmap for data block reservation smaller, search of free
   blocks faster and less blocks needed (less searches)
 - Fewer IO vecs in cmd ring
 - If data block size is enhanced to max data tranfer size,
   userspace always receives consecutive data buffers with
   one IO vec only.

Disadvantage:
 - If data block size is big compared to mean size of data
   transfers, memory allocation can be higher compared to
   data block size = PAGE_SIZE.

Remark:
If this patch set is accepted, I probably have to prepare
a change for rtslib-fb to support new UDEV/config param
data_pages_per_blk (UDEV/info: DataPagesPerBlk)

Bodo Stroesser (6):
  scsi: target: tcmu: Adjust names of variables and definitions
  scsi: target: tcmu: Prepare for PAGE_SIZE != DATA_BLOCK_SIZE
  scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE
  scsi: target: tcmu: Remove function tcmu_get_block_page
  scsi: target: tcmu: Replace block size definitions with new udev
    members
  scsi: target: tcmu: Make data_pages_per_blk changeable via configFS

 drivers/target/target_core_user.c | 383 +++++++++++++++++++++++---------------
 1 file changed, 234 insertions(+), 149 deletions(-)

-- 
2.12.3


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-03-24 19:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-24 19:28 [PATCH 0/6] scsi: target: tcmu: Allow data block size greater than PAGE_SIZE Bodo Stroesser
2021-03-24 19:28 ` [PATCH 1/6] scsi: target: tcmu: Adjust names of variables and definitions Bodo Stroesser
2021-03-24 19:28 ` [PATCH 2/6] scsi: target: tcmu: Prepare for PAGE_SIZE != DATA_BLOCK_SIZE Bodo Stroesser
2021-03-24 19:28 ` [PATCH 3/6] scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZE Bodo Stroesser
2021-03-24 19:28 ` [PATCH 4/6] scsi: target: tcmu: Remove function tcmu_get_block_page Bodo Stroesser
2021-03-24 19:28 ` [PATCH 5/6] scsi: target: tcmu: Replace block size definitions with new udev members Bodo Stroesser
2021-03-24 19:28 ` [PATCH 6/6] scsi: target: tcmu: Make data_pages_per_blk changeable via configFS Bodo Stroesser

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.