Re: [dm-devel] question about block-throttle on data device of dm-thin pool

2017-01-10 Thread Hou Tao
On 2017/1/11 3:42, Vivek Goyal wrote: > On Tue, Jan 10, 2017 at 02:47:02PM +0800, Hou Tao wrote: >> Hi, all. >> >> I am trying to test block-throttle on dm-thin devices. I find the throttling >> on dm-thin device is OK, but the throttling doesn't work for the data device >> of dm-thin pool. >> >>

[dm-devel] [PATCH 03/15] block: simplify blk_init_allocated_queue

2017-01-10 Thread Christoph Hellwig
Return an errno value instead of the passed in queue so that the callers don't have to keep track of two queues, and move the assignment of the request_fn and lock to the caller as passing them as argument doesn't simplify anything. While we're at it also remove two pointless NULL assignments,

[dm-devel] [PATCH 09/15] scsi: remove gfp_flags member in scsi_host_cmd_pool

2017-01-10 Thread Christoph Hellwig
When using the slab allocator we already decide at cache creation time if an allocation comes from a GFP_DMA pool using the SLAB_CACHE_DMA flag, and there is no point passing the kmalloc-family only GFP_DMA flag to kmem_cache_alloc. Drop all the infrastructure for doing so. Signed-off-by:

[dm-devel] [PATCH 07/15] scsi_dh_emc: switch to scsi_execute_req_flags()

2017-01-10 Thread Christoph Hellwig
From: Hannes Reinecke Switch to scsi_execute_req_flags() and scsi_get_vpd_page() instead of open-coding it. Using scsi_execute_req_flags() will set REQ_QUIET and REQ_PREEMPT, but this is okay as we're evaluating the errors anyway and should be able to send the command even if the

[dm-devel] [PATCH 11/15] scsi: remove scsi_cmd_dma_pool

2017-01-10 Thread Christoph Hellwig
There is no need for GFP_DMA allocations of the scsi_cmnd structures themselves, all that might be DMAed to or from is the actual payload, or the sense buffers. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi.c | 15 +-- 1 file changed, 1 insertion(+), 14

[dm-devel] [PATCH 01/15] virtio_blk: avoid DMA to stack for the sense buffer

2017-01-10 Thread Christoph Hellwig
Most users of BLOCK_PC requests allocate the sense buffer on the stack, so to avoid DMA to the stack copy them to a field in the heap allocated virtblk_req structure. Without that any attempt at SCSI passthrough I/O, including the SG_IO ioctl from userspace will crash the kernel. Note that this

[dm-devel] [PATCH 05/15] dm: remove incomple BLOCK_PC support

2017-01-10 Thread Christoph Hellwig
DM tries to copy a few fields around for BLOCK_PC requests, but given that no dm-target ever wires up scsi_cmd_ioctl BLOCK_PC can't actually be sent to dm. Signed-off-by: Christoph Hellwig --- drivers/md/dm-rq.c | 16 1 file changed, 16 deletions(-) diff --git

[dm-devel] [PATCH 15/15] block: split scsi_request out of struct request

2017-01-10 Thread Christoph Hellwig
And require all drivers that want to support BLOCK_PC to allocate it as the first thing of their private data. To support this the legacy IDE and BSG code is switched to set cmd_size on their queues to let the block layer allocate the additional space. Signed-off-by: Christoph Hellwig

[dm-devel] [PATCH 04/15] block: allow specifying size for extra command data

2017-01-10 Thread Christoph Hellwig
This mirrors the blk-mq capabilities to allocate extra drivers-specific data behind struct request by setting a cmd_size field, as well as having a constructor / destructor for it. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 59

[dm-devel] [PATCH 13/15] scsi: allocate scsi_cmnd structures as part of struct request

2017-01-10 Thread Christoph Hellwig
Rely on the new block layer functionality to allocate additional driver specific data behind struct request instead of implementing it in SCSI itѕelf. Signed-off-by: Christoph Hellwig --- drivers/scsi/hosts.c | 20 +-- drivers/scsi/scsi.c | 319

[dm-devel] [PATCH 06/15] scsi_dh_rdac: switch to scsi_execute_req_flags()

2017-01-10 Thread Christoph Hellwig
From: Hannes Reinecke Switch to scsi_execute_req_flags() and scsi_get_vpd_page() instead of open-coding it. Using scsi_execute_req_flags() will set REQ_QUIET and REQ_PREEMPT, but this is okay as we're evaluating the errors anyway and should be able to send the command even if the

[dm-devel] [PATCH 10/15] scsi: respect unchecked_isa_dma for blk-mq

2017-01-10 Thread Christoph Hellwig
Currently blk-mq always allocates the sense buffer using normal GFP_KERNEL allocation. Refactor the cmd pool code to split the cmd and sense allocation and share the code to allocate the sense buffers as well as the sense buffer slab caches between the legacy and blk-mq path. Note that this

[dm-devel] [PATCH 12/15] scsi: remove __scsi_alloc_queue

2017-01-10 Thread Christoph Hellwig
Instead do an internal export of __scsi_init_queue for the transport classes that export BSG nodes. Signed-off-by: Christoph Hellwig --- drivers/scsi/scsi_lib.c | 19 --- drivers/scsi/scsi_transport_fc.c| 6 --