Skip to content

scsi: target: tcmu: Allow data block size greater than PAGE_SIZE

Bodo Stroesser linux-scsi target-devel 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 0 repliesNew
  2. v16 patches 0 repliesSuperseded

Changes in v2 from the cover letter

Changed From and Singed-off-by to contain proper email address bostroesser ... gmail

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6scsi: target: tcmu: Adjust names of variables and definitionsdrivers/target/target_core_user.c+22 -170 replies
2/6scsi: target: tcmu: Prepare for PAGE_SIZE != DATA_BLOCK_SIZEdrivers/target/target_core_user.c+41 -410 replies
3/6scsi: target: tcmu: Support DATA_BLOCK_SIZE = N * PAGE_SIZEdrivers/target/target_core_user.c+121 -940 replies
4/6scsi: target: tcmu: Remove function tcmu_get_block_pagedrivers/target/target_core_user.c+1 -70 replies
5/6scsi: target: tcmu: Replace block size definitions with new udev membersdrivers/target/target_core_user.c+45 -370 replies
6/6scsi: target: tcmu: Make data_pages_per_blk changeable via configFSdrivers/target/target_core_user.c+53 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] scsi: target: tcmu: Allow data block size greater than PAGE_SIZE

I'm resending this series as v2, because the previous patches partly contained my old email address. So please silently ignore them.
Sorry for the noise.

V2:
Changed From and Singed-off-by to contain proper email address bostroesser ... gmail

-----

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(-)
Signature · 1 line
2.12.3