Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-10-26 Thread Ming Lei
Hello Bart, On Fri, Oct 27, 2017 at 04:53:18AM +, Bart Van Assche wrote: > On Fri, 2017-10-27 at 12:43 +0800, Ming Lei wrote: > > The 1st patch removes the RESTART for TAG-SHARED because SCSI handles it > > by itself, and not necessary to waste CPU to do the expensive RESTART. > > And Roman

Re: [PATCH V2 0/2] block: remove unnecessary RESTART

2017-10-26 Thread Bart Van Assche
On Fri, 2017-10-27 at 12:43 +0800, Ming Lei wrote: > The 1st patch removes the RESTART for TAG-SHARED because SCSI handles it > by itself, and not necessary to waste CPU to do the expensive RESTART. > And Roman Pen reported that this RESTART cuts half of IOPS in his case. > > The 2nd patch

[PATCH V2 0/2] block: remove unnecessary RESTART

2017-10-26 Thread Ming Lei
Hi Jens, The 1st patch removes the RESTART for TAG-SHARED because SCSI handles it by itself, and not necessary to waste CPU to do the expensive RESTART. And Roman Pen reported that this RESTART cuts half of IOPS in his case. The 2nd patch removes the RESTART when .get_budget returns

[PATCH V2 2/2] blk-mq: don't restart queue when .get_budget returns BLK_STS_RESOURCE

2017-10-26 Thread Ming Lei
SCSI restarts its queue in scsi_end_request() automatically, so we don't need to handle this case in blk-mq. Especailly any request won't be dequeued in this case, we needn't to worry about IO hang caused by restart vs. dispatch. Signed-off-by: Ming Lei ---

RE: [PATCH 00/12 v4] multiqueue for MMC/SD

2017-10-26 Thread Hunter, Adrian
> -Original Message- > From: Linus Walleij [mailto:linus.wall...@linaro.org] > Sent: Thursday, October 26, 2017 5:20 PM > To: Hunter, Adrian > Cc: linux-...@vger.kernel.org; Ulf Hansson ; > linux-block ; Jens

[PATCH 4/4] block: add WARN_ON if bdi register fail

2017-10-26 Thread weiping zhang
device_add_disk need do more safety error handle, so this patch just add WARN_ON. Signed-off-by: weiping zhang --- block/genhd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/block/genhd.c b/block/genhd.c index dd305c65ffb0..cb55eea821eb

[PATCH 3/4] bdi: add error handle for bdi_debug_register

2017-10-26 Thread weiping zhang
In order to make error handle more cleaner we call bdi_debug_register before set state to WB_registered, that we can avoid call bdi_unregister in release_bdi(). Signed-off-by: weiping zhang --- mm/backing-dev.c | 7 ++- 1 file changed, 6 insertions(+), 1

[PATCH 1/4] bdi: add check for bdi_debug_root

2017-10-26 Thread weiping zhang
this patch add a check for bdi_debug_root and do error handle for it. we should make sure it was created success, otherwise when add new block device's bdi folder(eg, 8:0) will be create a debugfs root directory. Signed-off-by: weiping zhang --- mm/backing-dev.c |

[PATCH 2/4] bdi: convert bdi_debug_register to int

2017-10-26 Thread weiping zhang
Convert bdi_debug_register to int and then do error handle for it. Signed-off-by: weiping zhang --- mm/backing-dev.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index

[PATCH 0/4] add error handle for bdi debugfs register

2017-10-26 Thread weiping zhang
this series add error handle for bdi debugfs register flow, the first three patches try to convert void function to int and do some cleanup if create dir or file fail. the fourth patch only add a WARN_ON in device_add_disk, no function change. weiping zhang (4): bdi: add check for

[GIT PULL] Block fixes for 4.14-rc

2017-10-26 Thread Jens Axboe
Hi Linus, A few select fixes that should go into this series. Mainly for NVMe, but also a single stable fix for nbd from Josef. Please pull! git://git.kernel.dk/linux-block.git for-linus James Smart (3): nvme-fc: fix

Re: [PATCH V12 0/5] mmc: Add Command Queue support

2017-10-26 Thread Linus Walleij
On Thu, Oct 26, 2017 at 3:49 PM, Adrian Hunter wrote: > On 26/10/17 16:32, Linus Walleij wrote: >> My patch series switches the stack around to make it possible >> to do this. But it doesn't go the whole way to complete the requests >> from interrupt context. >> >> Since

Re: [PATCH 00/12 v4] multiqueue for MMC/SD

2017-10-26 Thread Linus Walleij
On Thu, Oct 26, 2017 at 3:34 PM, Adrian Hunter wrote: > On 26/10/17 15:57, Linus Walleij wrote: >> I have now worked on it for more than a year. I was side >> tracked to clean up some code, move request allocation to >> be handled by the block layer, delete bounce buffer

Re: [PATCH V12 0/5] mmc: Add Command Queue support

2017-10-26 Thread Adrian Hunter
On 26/10/17 16:32, Linus Walleij wrote: > On Tue, Oct 24, 2017 at 10:40 AM, Adrian Hunter > wrote: > >> Here is V12 of the hardware command queue patches without the software >> command queue patches, now using blk-mq and now with blk-mq support for >> non-CQE I/O. > >

Re: [PATCH 00/12 v4] multiqueue for MMC/SD

2017-10-26 Thread Adrian Hunter
On 26/10/17 15:57, Linus Walleij wrote: > This switches the MMC/SD stack over to unconditionally > using the multiqueue block interface for block access. > This modernizes the MMC/SD stack and makes it possible > to enable BFQ scheduling on these single-queue devices. > > This is the v4 version

Re: [PATCH V12 0/5] mmc: Add Command Queue support

2017-10-26 Thread Linus Walleij
On Tue, Oct 24, 2017 at 10:40 AM, Adrian Hunter wrote: > Here is V12 of the hardware command queue patches without the software > command queue patches, now using blk-mq and now with blk-mq support for > non-CQE I/O. Since I had my test setup going I gave this a spin

[PATCH 12/12 v4] mmc: switch MMC/SD to use blk-mq multiqueueing

2017-10-26 Thread Linus Walleij
This switches the MMC/SD stack to use the multiqueue block layer interface. We kill off the kthread that was just calling blk_fetch_request() and let blk-mq drive all traffic, nice, that is how it should work. Due to having switched the submission mechanics around so that the completion of

[PATCH 11/12 v4] mmc: block: issue requests in massive parallel

2017-10-26 Thread Linus Walleij
This makes a crucial change to the issueing mechanism for the MMC requests: Before commit "mmc: core: move the asynchronous post-processing" some parallelism on the read/write requests was achieved by speculatively postprocessing a request and re-preprocess and re-issue the request if something

[PATCH 09/12 v4] mmc: queue: stop flushing the pipeline with NULL

2017-10-26 Thread Linus Walleij
Remove all the pipeline flush: i.e. repeatedly sending NULL down to the core layer to flush out asynchronous requests, and also sending NULL after "special" commands to achieve the same flush. Instead: let the "special" commands wait for any ongoing asynchronous transfers using the completion,

[PATCH 07/12 v4] mmc: queue: simplify queue logic

2017-10-26 Thread Linus Walleij
The if() statment checking if there is no current or previous request is now just looking ahead at something that will be concluded a few lines below. Simplify the logic by moving the assignment of .asleep. Signed-off-by: Linus Walleij --- drivers/mmc/core/queue.c | 9

[PATCH 10/12 v4] mmc: queue/block: pass around struct mmc_queue_req*s

2017-10-26 Thread Linus Walleij
Instead of passing two pointers around several pointers to mmc_queue_req, request, mmc_queue, and reassigning to the left and right, issue mmc_queue_req and dereference the queue and request from the mmq_queue_req where needed. The struct mmc_queue_req is the thing that has a lifecycle after all:

[PATCH 06/12 v4] mmc: core: kill off the context info

2017-10-26 Thread Linus Walleij
The last member of the context info: is_waiting_last_req is just assigned values, never checked. Delete that and the whole context info as a result. Signed-off-by: Linus Walleij --- drivers/mmc/core/block.c | 2 -- drivers/mmc/core/bus.c | 1 -

[PATCH 04/12 v4] mmc: core: do away with is_done_rcv

2017-10-26 Thread Linus Walleij
The "is_done_rcv" in the context info for the host is no longer needed: it is clear from context (ha!) that as long as we are waiting for the asynchronous request to come to completion, we are not done receiving data, and when the finalization work has run and completed the completion, we are

[PATCH 03/12 v4] mmc: core: replace waitqueue with worker

2017-10-26 Thread Linus Walleij
The waitqueue in the host context is there to signal back from mmc_request_done() through mmc_wait_data_done() that the hardware is done with a command, and when the wait is over, the core will typically submit the next asynchronous request that is pending just waiting for the hardware to be

[PATCH 02/12 v4] mmc: core: add a workqueue for completing requests

2017-10-26 Thread Linus Walleij
As we want to complete requests autonomously from feeding the host with new requests, we create a workqueue to deal with this specifically in response to the callback from a host driver. This is necessary to exploit parallelism properly. This patch just adds the workqueu, later patches will make

[PATCH 05/12 v4] mmc: core: do away with is_new_req

2017-10-26 Thread Linus Walleij
The host context member "is_new_req" is only assigned values, never checked. Delete it. Signed-off-by: Linus Walleij --- drivers/mmc/core/core.c | 1 - drivers/mmc/core/queue.c | 5 - include/linux/mmc/host.h | 2 -- 3 files changed, 8 deletions(-) diff --git

[PATCH 01/12 v4] mmc: core: move the asynchronous post-processing

2017-10-26 Thread Linus Walleij
This moves the asynchronous post-processing of a request over to the finalization function. The patch has a slight semantic change: Both places will be in the code path for if (host->areq) and in the same sequence, but before this patch, the next request was started before performing

[PATCH 00/12 v4] multiqueue for MMC/SD

2017-10-26 Thread Linus Walleij
This switches the MMC/SD stack over to unconditionally using the multiqueue block interface for block access. This modernizes the MMC/SD stack and makes it possible to enable BFQ scheduling on these single-queue devices. This is the v4 version of this v3 patch set from february:

[PATCH v4] virtio_blk: Fix an SG_IO regression

2017-10-26 Thread Bart Van Assche
Avoid that submitting an SG_IO ioctl triggers a kernel oops that is preceded by: usercopy: kernel memory overwrite attempt detected to (null) () (6 bytes) kernel BUG at mm/usercopy.c:72! Reported-by: Dann Frazier Fixes: commit ca18d6f769d2 ("block: Make most

Re: [PATCH v3] virtio_blk: Fix an SG_IO regression

2017-10-26 Thread Bart Van Assche
On Thu, 2017-10-26 at 07:30 +0200, Bart Van Assche wrote: > +static void virtblk_initialize_rq(struct request *req) > +{ > + struct virtblk_req *vbr = blk_mq_rq_to_pdu(req); > + > + scsi_req_init(>sreq); > +} Please ignore v3 - the build fails with this version for