Re: [PATCH] scsi_debug: change store from vmalloc to sgl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2020-11-05 11:06 p.m., Bart Van Assche wrote:
On 11/5/20 4:38 PM, Douglas Gilbert wrote:
A long time ago this driver's store was allocated by kmalloc() or
alloc_pages(). When this was switched to vmalloc() the author
noticed slower ramdisk access times and more variability in repeated
tests. So try going back with sgl_alloc_order() to get uniformly
sized allocations in a sometimes large scatter gather _array_. That
array is the basis of keeping O(1) access to the store.

Using sgl_alloc_order() and friends requires CONFIG_SGL_ALLOC
so add a 'select' to the Kconfig file.

Remove kcalloc() in resp_verify() as sgl_s can now be compared
directly without forming an intermediate buffer. This is a
performance win for the SCSI VERIFY command implementation.

Make the SCSI COMPARE AND WRITE command yield the offset of the
first miscompared byte when the compare fails (as required by
T10).

This patch depends on: "[PATCH v4 0/4] scatterlist: add new
capabilities".

Hi Doug,

Although I'm fine with this patch: has it been considered to use huge
pages instead of allocating a scatterlist? Would that have the same or
even better performance advantages?

The scsi_debug driver having its store as a scatterlist has the
distinct advantage that the data-in and data-out buffers coming through
from the block layer and the scsi mid-level are also in the form of
scatterlists. Hence most of the media access SCSI commands that the
driver simulates boil down to just a handful of sgl to sgl operations.
The very ones that I am trying to add to the scatterlist API.

If there is some advantage of using huge pages for a store, then I
would prefer that to be done in the scatterlist API. Say a new
allocator like sgl_alloc_huge() that forms a scatter gather array
of huge pages.

I did have a quick look at huge pages and the existing kernel
infrastructure seemed to be aimed at user space usage rather than
driver usage.

Doug Gilbert








[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux