Re: [PATCH v2 4/5] block, scsi: Rework runtime power management

2018-07-29 Thread jianchao.wang
On 07/27/2018 11:29 PM, Bart Van Assche wrote: > On Fri, 2018-07-27 at 09:57 +0800, jianchao.wang wrote: >> Something like: >> >> percpu_ref_switch_to_atomic_sync(>q_usage_counter); >> if (!percpu_ref_is_zero(>q_usage_counter)) { >> ret = -EBUSY; >>

Re: [PATCH v2 4/5] block, scsi: Rework runtime power management

2018-07-29 Thread jianchao.wang
Hi Bart On 07/27/2018 11:09 PM, Bart Van Assche wrote: > On Fri, 2018-07-27 at 09:57 +0800, jianchao.wang wrote: >> If q_usage_counter is not zero here, we will leave the request_queue in >> preempt only mode. > > That's on purpose. If q_usage_counter is not zero then >

Re: [PATCH] block/023: performance test on queue creation & cleanup

2018-07-29 Thread Ming Lei
On Wed, Jul 25, 2018 at 02:33:14PM -0700, Omar Sandoval wrote: > On Wed, Jul 04, 2018 at 01:29:56PM +0800, Ming Lei wrote: > > SCSI may have lots of channels, targets or LUNs, so it may > > take long time for creating and cleaning up queues. > > > > So introduce block/023 and uses null_blk to run

[PATCH v5 1/3] block: move ref_tag calculation func to the block layer

2018-07-29 Thread Max Gurtovoy
Currently this function is implemented in the scsi layer, but it's actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen Signed-off-by: Max

[PATCH v5 2/3] block: move dif_prepare/dif_complete functions to block layer

2018-07-29 Thread Max Gurtovoy
Currently these functions are implemented in the scsi layer, but their actual place should be the block layer since T10-PI is a general data integrity feature that is used in the nvme protocol as well. Also, use the tuple size from the integrity profile since it may vary between integrity types.

[PATCH v5 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-29 Thread Max Gurtovoy
Also moved the logic of the remapping to the nvme core driver instead of implementing it in the nvme pci driver. This way all the other nvme transport drivers will benefit from it (in case they'll implement metadata support). Suggested-by: Christoph Hellwig Cc: Jens Axboe Cc: Martin K. Petersen