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

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 11:33 PM, Keith Busch wrote: On Tue, Jul 24, 2018 at 04:33:41PM +0300, Max Gurtovoy wrote: +void t10_pi_prepare(struct request *rq, u8 protection_type) +{ + const int tuple_sz = rq->q->integrity.tuple_size; + u32 ref_tag = t10_pi_ref_tag(rq); + struct bio *bio;

[PATCH for v4.18] blk-mq: Rename BLK_EH_DONE into BLK_EH_DONT_RESET_TIMER

2018-07-24 Thread Bart Van Assche
If a block driver timeout handler returns BLK_EH_DONE that means either that the request has been completed or that the block driver still owns the request. Since the name BLK_EH_DONE is misleading, change it into BLK_EH_DONT_RESET_TIMER. Fixes: 88b0cfad2888 ("block: document the

Re: two small bio cleanups

2018-07-24 Thread Jens Axboe
On 7/24/18 5:04 AM, Christoph Hellwig wrote: > To remove invariants that are odd and in the way of multipage biovecs. Applied for 4.19, thanks. -- Jens Axboe

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

2018-07-24 Thread Keith Busch
On Tue, Jul 24, 2018 at 04:33:41PM +0300, Max Gurtovoy wrote: > +void t10_pi_prepare(struct request *rq, u8 protection_type) > +{ > + const int tuple_sz = rq->q->integrity.tuple_size; > + u32 ref_tag = t10_pi_ref_tag(rq); > + struct bio *bio; > + > + if (protection_type ==

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

2018-07-24 Thread Christoph Hellwig
> /** > * t10_pi_prepare() - prepate PI prior submitting request to device no need for the braces here. > > * @rq: request with PI that should be prepared > * @protection_type: PI type (Type 1/Type 2/Type 3) > * > * Description: No need for the description tag either

Re: [PATCH v2] bcache: set max writeback rate when I/O request is idle

2018-07-24 Thread Coly Li
On 2018/7/24 4:33 PM, Stefan Priebe - Profihost AG wrote: > Am 24.07.2018 um 10:28 schrieb Coly Li: >> On 2018/7/24 3:16 PM, Stefan Priebe - Profihost AG wrote: >>> Am 24.07.2018 um 06:03 schrieb Coly Li: Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") allows the

Re: [PATCH] block: Rename the null_blk_mod kernel module back into null_blk

2018-07-24 Thread Jens Axboe
On 7/23/18 3:18 PM, Bart Van Assche wrote: > Commit ca4b2a011948 ("null_blk: add zone support") breaks several > blktests scripts because it renamed the null_blk kernel module into > null_blk_mod. Hence rename null_blk_mod back into null_blk. Thanks Bart, applied. -- Jens Axboe

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

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 4:55 PM, Christoph Hellwig wrote: +/* + * The virtual start sector is the one that was originally submitted + * by the block layer. Due to partitioning, MD/DM cloning, etc. the + * actual physical start sector is likely to be different. Remap + * protection information to match

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

2018-07-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig

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

2018-07-24 Thread Christoph Hellwig
> +/* > + * The virtual start sector is the one that was originally submitted > + * by the block layer. Due to partitioning, MD/DM cloning, etc. the > + * actual physical start sector is likely to be different. Remap > + * protection information to match the physical LBA. > + * > + * From

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

2018-07-24 Thread Christoph Hellwig
> case NVME_NS_DPS_PI_TYPE2: > control |= NVME_RW_PRINFO_PRCHK_GUARD | > NVME_RW_PRINFO_PRCHK_REF; > - cmnd->rw.reftag = cpu_to_le32( > - nvme_block_nr(ns,

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

2018-07-24 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 1/3] block: move ref_tag calculation func to the block layer

2018-07-24 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 3/3] nvme: use blk API to remap ref tags for IOs with metadata

2018-07-24 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

two small bio cleanups

2018-07-24 Thread Christoph Hellwig
To remove invariants that are odd and in the way of multipage biovecs.

[PATCH 2/2] block: bio_set_pages_dirty can't see NULL bv_page in a valid bio_vec

2018-07-24 Thread Christoph Hellwig
So don't bother handling it. Signed-off-by: Christoph Hellwig Reviewed-by: Ming Lei --- block/bio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/bio.c b/block/bio.c index 504b42278099..07d3ffd95989 100644 --- a/block/bio.c +++ b/block/bio.c @@ -1636,10

[PATCH 1/2] block: simplify bio_check_pages_dirty

2018-07-24 Thread Christoph Hellwig
bio_check_pages_dirty currently inviolates the invariant that bv_page of a bio_vec inside bi_vcnt shouldn't be zero, and that is going to become really annoying with multpath biovecs. Fortunately there isn't any all that good reason for it - once we decide to defer freeing the bio to a workqueue

Re: [PATCH 1/2] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Max Gurtovoy
On 7/24/2018 4:54 AM, Martin K. Petersen wrote: Christoph, +void blk_integrity_dif_prepare(struct request *rq, u8 protection_type, + u32 ref_tag) +{ Maybe call this blk_t10_pi_prepare? The rest of these functions have a blk_integrity_ prefix. So either

Re: [PATCH v2] bcache: set max writeback rate when I/O request is idle

2018-07-24 Thread Stefan Priebe - Profihost AG
Am 24.07.2018 um 10:28 schrieb Coly Li: > On 2018/7/24 3:16 PM, Stefan Priebe - Profihost AG wrote: >> Am 24.07.2018 um 06:03 schrieb Coly Li: >>> Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") >>> allows the writeback rate to be faster if there is no I/O request on a >>>

Re: [PATCH v2] bcache: set max writeback rate when I/O request is idle

2018-07-24 Thread Coly Li
On 2018/7/24 3:16 PM, Stefan Priebe - Profihost AG wrote: > Am 24.07.2018 um 06:03 schrieb Coly Li: >> Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") >> allows the writeback rate to be faster if there is no I/O request on a >> bcache device. It works well if there is only

Re: [PATCH v2] UBI: Add volume read and write statistics

2018-07-24 Thread Richard Weinberger
[Adding linux-block] Am Montag, 23. Juli 2018, 17:39:02 CEST schrieb Per Forlin: > Simple read and write statistics. > * Number of reads > * Number of writes > * Bytes read > * Bytes written > > This is useful to find out how the storage is being utilized. > For block devices this already exists

Re: [PATCH] blk-mq: Avoid that a request queue stalls when restarting a shared hctx

2018-07-24 Thread jianchao.wang
On 07/23/2018 11:50 PM, Bart Van Assche wrote: > The patch below fixes queue stalling when shared hctx marked for restart > (BLK_MQ_S_SCHED_RESTART bit) but q->shared_hctx_restart stays zero. The > root cause is that hctxs are shared between queues, but 'shared_hctx_restart' The blk_mq_hw_ctx

Re: [PATCH 1/2] block: move dif_prepare/dif_complete functions to block layer

2018-07-24 Thread Christoph Hellwig
On Mon, Jul 23, 2018 at 09:54:38PM -0400, Martin K. Petersen wrote: > > Christoph, > > >> +void blk_integrity_dif_prepare(struct request *rq, u8 protection_type, > >> + u32 ref_tag) > >> +{ > > > > Maybe call this blk_t10_pi_prepare? > > The rest of these functions have

Re: [PATCH v2] bcache: set max writeback rate when I/O request is idle

2018-07-24 Thread Stefan Priebe - Profihost AG
Am 24.07.2018 um 06:03 schrieb Coly Li: > Commit b1092c9af9ed ("bcache: allow quick writeback when backing idle") > allows the writeback rate to be faster if there is no I/O request on a > bcache device. It works well if there is only one bcache device attached > to the cache set. If there are