Re: [PATCH 0/11 v4] block: Fix block device shutdown related races

2017-03-20 Thread Thiago Jung Bauermann
Hello, Am Montag, 13. März 2017, 16:13:59 BRT schrieb Jan Kara: > People, please have a look at patches. They are mostly simple however the > interactions are rather complex so I may have missed something. Also I'm > happy for any additional testing these patches can get - I've stressed them >

Re: [PATCH 2/4] blk-mq: merge mq and sq make_request instances

2017-03-20 Thread Bart Van Assche
On 03/20/2017 04:39 PM, Christoph Hellwig wrote: > @@ -1534,7 +1529,36 @@ static blk_qc_t blk_mq_make_request(struct > request_queue *q, struct bio *bio) > } > > plug = current->plug; > - if (((plug && !blk_queue_nomerges(q)) || is_sync)) { > + if (plug && q->nr_hw_queues ==

Re: [PATCH 3/4] blk-mq: improve blk_mq_try_issue_directly

2017-03-20 Thread Bart Van Assche
On 03/20/2017 04:39 PM, Christoph Hellwig wrote: > Rename blk_mq_try_issue_directly to __blk_mq_try_issue_directly and add a > new wrapper that takes care of RCU / SRCU locking to avoid having > boileplate code in the caller which would get duplicated with new callers. Reviewed-by: Bart Van

[RFC PATCH 0/1] nbd: fix crash when unmaping nbd device with fs still mounted

2017-03-20 Thread Ming Lin
Hi all, I run into a BUG_ON(!buffer_mapped(bh)) crash with below script. $ rbd-nbd map mypool/myimg $ mkfs.ext4 /dev/nbd0 $ mount /dev/nbd0 /mnt/ $ rbd-nbd unmap /dev/nbd0 $ umount /mnt [ 1248.870131] kernel BUG at /home/mlin/linux/fs/buffer.c:3103! [ 1248.871214] invalid opcode: [#1]

[PATCH 5/7] block: add a max_discard_segment_size queue limit

2017-03-20 Thread Christoph Hellwig
ATA only allows 16 bits, so we need a limit. Signed-off-by: Christoph Hellwig --- block/blk-core.c | 6 ++ block/blk-merge.c | 9 + block/blk-settings.c | 14 ++ include/linux/blkdev.h | 8 4 files changed, 37 insertions(+) diff

[PATCH 3/7] libata: remove SCT WRITE SAME support

2017-03-20 Thread Christoph Hellwig
This was already disabled a while ago because it caused I/O errors, and it's severly getting into the way of the discard / write zeroes rework. Signed-off-by: Christoph Hellwig --- drivers/ata/libata-scsi.c | 128 +++--- 1 file changed, 29

[PATCH 2/7] sd: provide a new ata trim provisioning mode

2017-03-20 Thread Christoph Hellwig
This uses a vendor specific command to pass the ATA TRIM payload to libata without having to rewrite it in place. Support for it is indicated by a new flag in struct scsi_device that libata will set in it's slave_configure routine. A second flag indicates if TRIM will reliably zero data.

[PATCH 7/7] sd: use ZERO_PAGE for WRITE_SAME payloads

2017-03-20 Thread Christoph Hellwig
We're never touching the contents of the page, so save a memory allocation for these cases. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index

[PATCH 6/7] sd: support multi-range TRIM for ATA disks

2017-03-20 Thread Christoph Hellwig
Almost the same scheme as the older multi-range support for NVMe. Signed-off-by: Christoph Hellwig --- drivers/scsi/sd.c | 37 + 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index

[PATCH 1/7] ѕd: split sd_setup_discard_cmnd

2017-03-20 Thread Christoph Hellwig
Split sd_setup_discard_cmnd into one function per provisioning type. While this creates some very slight duplication of boilerplate code it keeps the code modular for additions of new provisioning types, and for reusing the write same functions for the upcoming scsi implementation of the Write

[PATCH 4/7] libata: simplify the trim implementation

2017-03-20 Thread Christoph Hellwig
Don't try to fake up basic SCSI logical block provisioning and WRITE SAME support, but offer support for the Linux Vendor Specific TRIM command instead. This simplifies the implementation a lot, and avoids rewriting the data out buffer in the I/O path. Note that this new command is only offered

support ranges TRIM for libata

2017-03-20 Thread Christoph Hellwig
This series implements rangeѕ discard for ATA SSDs. Compared to the initial NVMe support there are two things that complicate the ATA support: - ATA only suports 16-bit long ranges - the whole mess of generating a SCSI command first and then translating it to an ATA one. This series adds

unify and streamline the blk-mq make_request implementations V2

2017-03-20 Thread Christoph Hellwig
A bunch of cleanups to get us a nice I/O submission path. Changes since V1: - rebase on top of the recent blk_mq_try_issue_directly changes - incorporate comments from Bart

[PATCH 4/4] blk-mq: streamline blk_mq_make_request

2017-03-20 Thread Christoph Hellwig
Turn the different ways of merging or issuing I/O into a series of if/else statements instead of the current maze of gotos. Note that this means we pin the CPU a little longer for some cases as the CTX put is moved to common code at the end of the function. Signed-off-by: Christoph Hellwig

[PATCH 1/4] blk-mq: remove BLK_MQ_F_DEFER_ISSUE

2017-03-20 Thread Christoph Hellwig
This flag was never used since it was introduced. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 8 +--- include/linux/blk-mq.h | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 159187a28d66..acf0ddf4af52

[PATCH 3/4] blk-mq: improve blk_mq_try_issue_directly

2017-03-20 Thread Christoph Hellwig
Rename blk_mq_try_issue_directly to __blk_mq_try_issue_directly and add a new wrapper that takes care of RCU / SRCU locking to avoid having boileplate code in the caller which would get duplicated with new callers. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 32

[PATCH 2/4] blk-mq: merge mq and sq make_request instances

2017-03-20 Thread Christoph Hellwig
They are mostly the same code anyway - this just one small conditional for the plug case that is different for both variants. Signed-off-by: Christoph Hellwig --- block/blk-mq.c | 164 +++-- 1 file changed, 31 insertions(+), 133

Re: [PATCH RFC 00/14] Add the BFQ I/O Scheduler to blk-mq

2017-03-20 Thread Jens Axboe
On 03/18/2017 01:46 PM, Bart Van Assche wrote: > On Sat, 2017-03-18 at 18:09 +0100, Linus Walleij wrote: >> On Sat, Mar 18, 2017 at 11:52 AM, Paolo Valente >> wrote: Il giorno 14 mar 2017, alle ore 16:32, Bart Van Assche ha

Re: [PATCH 5/8] nowait aio: return on congested block device

2017-03-20 Thread Jan Kara
On Fri 17-03-17 07:23:24, Goldwyn Rodrigues wrote: > On 03/16/2017 04:31 PM, Dave Chinner wrote: > > On Wed, Mar 15, 2017 at 04:51:04PM -0500, Goldwyn Rodrigues wrote: > >> From: Goldwyn Rodrigues > >> > >> A new flag BIO_NOWAIT is introduced to identify bio's > >> orignating