[PATCH 10/55] skd: Fix spelling in a source code comment

2017-08-17 Thread Bart Van Assche
Change "ptimal" into "optimal" and remove the misleading reference to sysfs. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de>

[PATCH 36/55] skb: Use symbolic names for SCSI opcodes

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 15 +-- 1 fi

[PATCH 34/55] skd: Remove superfluous occurrences of the 'volatile' keyword

2017-08-17 Thread Bart Van Assche
mem_map[i] is accessed through readl() / writel() hence declaring mem_map as volatile is not necessary. Remove the volatile declarations from struct fit_completion_entry_v1 pointers and struct fit_comp_error_info since reading these structures multiple times is safe. Signed-off-by: Bart Van

[PATCH 09/55] skd: Avoid that gcc 7 warns about fall-through when building with W=1

2017-08-17 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dr

[PATCH 14/55] skd: Remove useless barrier() calls

2017-08-17 Thread Bart Van Assche
from the pr_debug() calls. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 42 ++

[PATCH 00/55] Convert skd driver to blk-mq

2017-08-17 Thread Bart Van Assche
0019msec) write: IOPS=63.2k, BW=30.8MiB/s (32.3MB/s)(1846MiB/60003msec) write: IOPS=70.3k, BW=274MiB/s (288MB/s)(16.9GiB/60003msec) write: IOPS=13.2k, BW=823MiB/s (863MB/s)(48.3GiB/60012msec) == Please consider this patch series

[PATCH 27/55] skd: Make the skd_isr() code more brief

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 3 +-- 1 file ch

[PATCH 05/55] skd: Update maintainer information

2017-08-17 Thread Bart Van Assche
E-mails sent to supp...@stec-inc.com bounce. Hence remove that e-mail address from the driver. Add an entry to the MAINTAINERS file instead. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

[PATCH 37/55] skd: Move a function definition

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality but makes the next patch in this series easier to read. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.d

[PATCH 06/55] skd: Remove unneeded #include directives

2017-08-17 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/block/sk

[PATCH 16/55] skd: Fix endianness annotations

2017-08-17 Thread Bart Van Assche
Ensure that sparse does not report any warnings when building the skd driver with sparse verification enabled (C=1 or C=2). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn &

[PATCH 15/55] skd: Switch from the pr_*() to the dev_*() logging functions

2017-08-17 Thread Bart Van Assche
ed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 912 --- 1 file changed, 39

[PATCH 08/55] skd: Remove unnecessary blank lines

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality but makes the skd driver source code more uniform with that of other kernel drivers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes

[PATCH 30/55] skd: Remove superfluous initializations from skd_isr_completion_posted()

2017-08-17 Thread Bart Van Assche
The value of skcmp, cmp_cntxt etc. is overwritten during every loop iteration and is not used after the loop has finished. Hence initializing these variables outside the loop is not necessary. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&

[PATCH 21/55] skd: Reorder the code in skd_process_request()

2017-08-17 Thread Bart Van Assche
Prepare the S/G-list before allocating a FIT msg such that the FIT msg always contains at least one request after the for-loop is finished. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

[PATCH 12/55] skd: Remove set-but-not-used local variables

2017-08-17 Thread Bart Van Assche
These variables have been detected by building with W=1. Declare 'acc' as __maybe_unused because most access_ok() implementations ignore their first argument. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h.

[PATCH 22/55] skd: Simplify the code for deciding whether or not to send a FIT msg

2017-08-17 Thread Bart Van Assche
Due to the previous patch it is guaranteed that the FIT msg contains at least one request after the for-loop has finished. Use this to simplify the code. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.d

[PATCH 20/55] skd: Fix size argument in skd_free_skcomp()

2017-08-17 Thread Bart Van Assche
Pass the correct size to pci_free_consistent() in skd_free_skcomp(). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main

[PATCH 43/55] skd: Enable request tags for the block layer queue

2017-08-17 Thread Bart Van Assche
FIT messages are shared among requests and because updating a FIT message after a request has finished whould trigger a use-after-free. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes

[PATCH 47/55] skd: Move skd_free_sg_list() up

2017-08-17 Thread Bart Van Assche
Issue a warning if a NULL argument is passed to skd_free_sg_list(). Move this function up to make the blk-mq conversion patch easier to read. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

[PATCH 49/55] skd: Convert to blk-mq

2017-08-17 Thread Bart Van Assche
locking to protect skdev->skmsg and *skdev->skmsg against concurrent access from concurrent .queue_rq() calls. Introduce the functions skd_init_request() and skd_exit_request() to set up / clean up the per-request S/G-list. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> C

[PATCH 48/55] skd: Coalesce struct request and struct skd_request_context

2017-08-17 Thread Bart Van Assche
Set request_queue.cmd_size, introduce skd_init_rq() and skd_exit_rq() and remove skd_device.skreq_table. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.d

[PATCH 44/55] skd: Convert several per-device scalar variables into atomics

2017-08-17 Thread Bart Van Assche
Convert the per-device scalar variables that are protected by the queue lock into atomics such that it becomes safe to access these variables without holding the queue lock. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes

[PATCH 52/55] skd: Reduce memory usage

2017-08-17 Thread Bart Van Assche
Every single coherent DMA memory buffer occupies at least one page. Reduce memory usage by switching from coherent buffers to streaming DMA for I/O requests (struct skd_fitmsg_context) and S/G-lists (struct fit_sg_descriptor[]). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&

[PATCH 50/55] skd: Switch to block layer timeout mechanism

2017-08-17 Thread Bart Van Assche
Remove the timeout slot variables and rely on the block layer to detect request timeouts. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- driver

[PATCH 51/55] skd: Remove skd_device.in_flight

2017-08-17 Thread Bart Van Assche
Since skd_device.in_flight is only used to display the number of in-flight requests in debug messages, remove that member and introduce skd_in_flight(). That last function relies on the block layer to determine the number of in flight requests. Signed-off-by: Bart Van Assche <bart.van

[PATCH 04/55] skd: Switch to GPLv2

2017-08-17 Thread Bart Van Assche
This change does not affect any skd driver version derived from a dual licensed code base but makes all code derived from future upstream skd driver versions GPLv2 only. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke &

[PATCH 54/55] skd: Optimize locking

2017-08-17 Thread Bart Van Assche
Only take skdev->lock if necessary. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- drivers/block/skd_main.c | 21 +++-- 1

[PATCH 55/55] skd: Bump driver version

2017-08-17 Thread Bart Van Assche
Bump the driver version. Remove the build ID because build IDs do not make sense for an upstream kernel driver. Keep the driver version in the module information but do not report it during every load, unload or probe. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> --- drivers

Re: [PATCH 1/8] block: Fix declaration of blk-mq debugfs functions

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > index 14542308d25b..a369174a9679 100644 > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -5,6 +5,21 @@ > #include > #include > > +#ifdef

Re: [PATCH 2/8] block: Fix declaration of blk-mq scheduler functions

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > --- a/include/linux/blk-mq.h > +++ b/include/linux/blk-mq.h > @@ -284,6 +284,16 @@ void blk_mq_update_nr_hw_queues(struct blk_mq_tag_set > *set, int nr_hw_queues); > void blk_mq_quiesce_queue_nowait(struct request_queue *q); > > /* >

Re: [PATCH 3/8] scsi: sd_zbc: Move ZBC declarations to scsi_proto.h

2017-09-01 Thread Bart Van Assche
/* 0x4 to 0xf are reserved */ > + ZBC_ZONE_TYPE_RESERVED = 0x4, > +}; Hello Damien, Since no code is using ZBC_ZONE_TYPE_RESERVED, is the comment about reserved values sufficient and can the definition of ZBC_ZONE_TYPE_RESERVED be left out? Anyway: Reviewed-by: Bart

Re: [PATCH 4/8] scsi: sd_zbc: Reorganize and cleanup

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > Introduce sd_zbc.h for zbc related declarations (avoid cluttering sd.h). > > Fix comments style in sd_zbc.c (do not use documentation format) and > add/fix comments to enhance explanations. Also remove a useless blank > line in

Re: [PATCH 5/8] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > The three values starting at byte 8 of the Zoned Block Device > Characteristics VPD page B6h are 32 bits values, not 64bits. So use > get_unaligned_be32() to retrieve the values and not get_unaligned_be64() Reviewed-by: Bart V

Re: [PATCH 6/8] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-01 Thread Bart Van Assche
s helper, wait for the disk capacity and number of zones to > stabilize on the second revalidation pass to allocate and initialize > the bitmaps. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH 7/8] scsi: sd_zbc: Disable zone write locking with scsi-mq

2017-09-01 Thread Bart Van Assche
he scheduler dispatch queue. That is, at the time of > zone locking, the write command may already be out of order. > > Disable zone write locking in sd_zbc_write_lock_zone() if the disk is > used with scsi-mq. Write order guarantees can be provided by an > adapted I/O scheduler. R

Re: [PATCH 8/9] block: allow to allocate req with REQF_PREEMPT when queue is frozen

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 11:55 +0800, Ming Lei wrote: > On Thu, Aug 31, 2017 at 10:50:25PM +0000, Bart Van Assche wrote: > > On Fri, 2017-09-01 at 01:27 +0800, Ming Lei wrote: > > > @@ -1413,9 +1414,17 @@ static struct request *blk_old_get_request(struct > > > request_queu

Re: [PATCH 1/9] percpu-refcount: introduce percpu_ref_is_dead()

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 06:59 -0700, Tejun Heo wrote: > > +/** > > + * percpu_ref_is_dead - test whether a percpu refcount is killed > > + * @ref: percpu_ref to test > > + * > > + * Returns %true if @ref is dead > > + * > > + * This function is safe to call as long as @ref is between init and exit.

Re: blk_get_request sleeps in schedule

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 08:07 +0530, Suraj Choudhari wrote: > On my test system, blk_get_request() continuously hangs in schedule(). > > schedule+0x35/0x80 > schedule_timeout+0x237/0x2d0 > io_schedule_timeout+0xa6/0x110 > get_request+0x258/0x760 > blk_get_request+0x7f/0x100 > > I suspect the

Re: [PATCH 8/8] scsi: Introduce ZBC disk I/O scheduler

2017-09-01 Thread Bart Van Assche
On Fri, 2017-09-01 at 20:36 +0900, Damien Le Moal wrote: > +static struct scsi_disk *__zoned_scsi_disk(struct request_queue *q) > +{ > + struct scsi_device *sdp; > + struct scsi_disk *sdkp; > + > + if (!blk_queue_is_zoned(q)) { > + pr_err("zoned: Not a zoned block

Re: [PATCH 3/5] bfq: Check kstrtoul() return value

2017-09-01 Thread Bart Van Assche
On Sat, 2017-09-02 at 01:37 +0800, weiping zhang wrote: > 2017-09-02 1:14 GMT+08:00 Paolo Valente <paolo.vale...@linaro.org>: > > Il giorno 30 ago 2017, alle ore 20:42, Bart Van Assche > > <bart.vanass...@wdc.com> ha scritto: > > > > > > Make

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-04 Thread Bart Van Assche
On Tue, 2017-09-05 at 00:08 +0800, Ming Lei wrote: > On Mon, Sep 04, 2017 at 03:40:35PM +0000, Bart Van Assche wrote: > > On Mon, 2017-09-04 at 15:16 +0800, Ming Lei wrote: > > > On Mon, Sep 04, 2017 at 04:13:26AM +0000, Bart Van Assche wrote: > > > > Allowing blk_

Re: [PATCH V3 6/8] block: introduce preempt version of blk_[freeze|unfreeze]_queue

2017-09-04 Thread Bart Van Assche
On Sat, 2017-09-02 at 21:08 +0800, Ming Lei wrote: > --- a/include/linux/blkdev.h > +++ b/include/linux/blkdev.h > @@ -565,6 +565,10 @@ struct request_queue { > > int bypass_depth; > atomic_tmq_freeze_depth; > + spinlock_t

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-04 Thread Bart Van Assche
On Mon, 2017-09-04 at 15:16 +0800, Ming Lei wrote: > On Mon, Sep 04, 2017 at 04:13:26AM +0000, Bart Van Assche wrote: > > Allowing blk_get_request() to succeed after the DYING flag has been set is > > completely wrong because that could result in a request being queued after > &

Re: [PATCH V3 06/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-09-01 Thread Bart Van Assche
hold > hctx->lock, we should avoid to add barrier there. Although it is not clear to me how anyone who has not followed this discussion is assumed to figure out all these subtleties, if the other comments get addressed: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V2 6/8] block: allow to allocate req with REQF_PREEMPT when queue is frozen

2017-09-01 Thread Bart Van Assche
st this patch series without trying to reach an agreement about the approach? Anyway, because of the unsafe blk_queue_enter_live() call introduced by this patch, please add the following to the description of this patch whenever you repost it: NAK-ed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH] block: Make blk_dequeue_request() static

2017-08-29 Thread Bart Van Assche
On Tue, 2017-08-29 at 11:54 +0900, Damien Le Moal wrote: > The only caller of this function is blk_start_request() in the same > file. Fix blk_start_request() description accordingly. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

[PATCH 0/2] skd: Two additional patches for kernel v4.14

2017-08-29 Thread Bart Van Assche
Hello Jens, Further code review of the skd driver resulted in two additional patches. Please consider these for kernel v4.14. Thanks, Bart. Bart Van Assche (2): skd: Remove blk_queue_bounce_limit() call skd: Let the block layer core choose .nr_requests drivers/block/skd_main.c | 2 -- 1

[PATCH 2/2] skd: Let the block layer core choose .nr_requests

2017-08-29 Thread Bart Van Assche
Since blk_mq_init_queue() initializes .nr_requests to the tag set size and since that value is a good default for the skd driver, do not overwrite the value set by blk_mq_init_queue(). This change doubles the default value of .nr_requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.

[PATCH 1/2] skd: Remove blk_queue_bounce_limit() call

2017-08-29 Thread Bart Van Assche
Since sTec s1120 devices support 64-bit DMA it is not necessary to request data buffer bouncing. Hence remove the blk_queue_bounce_limit() call. Suggested-by: Christoph Hellwig <h...@lst.de> Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst

Re: [GIT PULL] nvme update for Linux 4.14, take 2

2017-08-30 Thread Bart Van Assche
On Wed, 2017-08-30 at 18:10 +0300, Sagi Grimberg wrote: > I just realized that patch: > -- > commit d352ae205d8b05f3f7558d10f474d8436581b3e2 > Author: Bart Van Assche <bart.vanass...@wdc.com> > Date: Thu Aug 17 16:23:03 2017 -0700 > > blk-mq: Make blk_mq_r

Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-03 Thread Bart Van Assche
On Sat, 2017-09-02 at 21:12 +0800, Ming Lei wrote: > Please let us know if V3 addresses your previous concern about calling > blk_queue_enter_live() during preempt freezing. Do you understand how request queue cleanup works? The algorithm used for request queue cleanup is as follows: * Set the

Memory leak in BFQ?

2017-08-31 Thread Bart Van Assche
Hello Paolo, If I run the following commands: # echo bfq > /sys/block/sda/queue/scheduler # echo 3 >/proc/sys/vm/drop_caches; find / -xdev >/dev/null # echo none > /sys/block/sda/queue/scheduler # echo scan > /sys/kernel/debug/kmemleak Then kmemleak reports the following: unreferenced object

Re: [PATCH V3 05/14] blk-mq-sched: improve dispatching from sw queue

2017-08-31 Thread Bart Van Assche
On Thu, 2017-08-31 at 11:43 +0800, Ming Lei wrote: > On Wed, Aug 30, 2017 at 04:34:47PM +0000, Bart Van Assche wrote: > > On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > > > diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h > > > index 50c648

Re: [PATCH V3 06/14] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-08-31 Thread Bart Van Assche
On Thu, 2017-08-31 at 12:01 +0800, Ming Lei wrote: > On Wed, Aug 30, 2017 at 05:11:00PM +0000, Bart Van Assche wrote: > > On Sun, 2017-08-27 at 00:33 +0800, Ming Lei wrote: > > [ ... ] > > Shouldn't blk_mq_sched_dispatch_requests() set BLK_MQ_S_DISPATCH_BUSY just > &

Re: BFQ + dm-mpath

2017-09-05 Thread Bart Van Assche
On Tue, 2017-09-05 at 09:56 +0200, Paolo Valente wrote: > Ok, my suspects seem confirmed: the path dm_mq_queue_rq -> map_request > -> setup_clone -> blk_rq_prep_clone creates a cloned request without > invoking e->type->ops.mq.prepare_request for the target elevator e. > The cloned request is

Archiving linux-block

2017-09-05 Thread Bart Van Assche
Hello, Since gmane.org is no longer operational linux-block messages are no longer archived. I think it's useful to archive linux-block messages because it makes it possible to review past discussions, especially for people who are not subscribed to the list. How about activating archival by

Re: [PATCH] block: Call .initialize_rq_fn() also for filesystem requests

2017-08-29 Thread Bart Van Assche
On Tue, 2017-08-29 at 19:16 +0800, Ming Lei wrote: > Hi Bart, > > Did you see perf regression on SRP with smaller jobs after applying > my patchset V3? > > I just run the test with 16 jobs(the system has 16 CPU cores) instead of 64, > looks not see perf regression on SRP about

Re: [PATCH v6 9/9] block, scsi: Make SCSI device suspend and resume work reliably

2017-10-09 Thread Bart Van Assche
On Sat, 2017-10-07 at 12:33 +0800, Ming Lei wrote: > On Wed, Oct 04, 2017 at 05:01:10PM -0700, Bart Van Assche wrote: > > It is essential during suspend and resume that neither the filesystem > > state nor the filesystem metadata in RAM changes. This is why while > > the hiber

Re: [PATCH v6 9/9] block, scsi: Make SCSI device suspend and resume work reliably

2017-10-09 Thread Bart Van Assche
On Mon, 2017-10-09 at 14:16 -0700, Bart Van Assche wrote: > On Sat, 2017-10-07 at 12:33 +0800, Ming Lei wrote: > > On Wed, Oct 04, 2017 at 05:01:10PM -0700, Bart Van Assche wrote: > > > int > > > scsi_device_quiesce(struct scsi_device *sdev) > > > { &g

[PATCH v7 0/9] Hello Jens,

2017-10-09 Thread Bart Van Assche
el threads freezable. - Changed the approach for quiescing SCSI devices again. - Addressed Ming's review comments. Changes compared to v1 of this patch series: - Changed the approach and rewrote the patch series. Bart Van Assche (8): md: Rename md_notifier into md_reboot_notifier md:

[PATCH v7 1/9] md: Rename md_notifier into md_reboot_notifier

2017-10-09 Thread Bart Van Assche
This avoids confusion with the pm notifier that will be added through a later patch. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig <h...@lst.de

[PATCH v7 8/9] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-10-09 Thread Bart Van Assche
This flag will be used in the next patch to let the block layer core know whether or not a SCSI request queue has been quiesced. A quiesced SCSI queue namely only processes RQF_PREEMPT requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redha

[PATCH v7 4/9] block: Make q_usage_counter also track legacy requests

2017-10-09 Thread Bart Van Assche
ed a comment and made sure REQ_NOWAIT is handled properly in blk_old_get_request() ] Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn

[PATCH v7 5/9] block: Introduce blk_get_request_flags()

2017-10-09 Thread Bart Van Assche
A side effect of this patch is that the GFP mask that is passed to several allocation functions in the legacy block layer is changed from GFP_KERNEL into __GFP_DIRECT_RECLAIM. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Mi

[PATCH v7 3/9] md: Neither resync nor reshape while the system is frozen

2017-10-09 Thread Bart Van Assche
will restart after the system is resumed and a message similar to the following will appear in the system log: md: md0: data-check interrupted. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming

[PATCH v7 6/9] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-09 Thread Bart Van Assche
Set RQF_PREEMPT if BLK_MQ_REQ_PREEMPT is passed to blk_get_request_flags(). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Ming Lei <ming@redhat.com> Cc: Hannes Reinecke <h...@suse.com> Cc: Johannes Thumshirn <jthumsh

[PATCH v7 9/9] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-09 Thread Bart Van Assche
s=512 --rw=randread \ --ioengine=libaio --numjobs=4 --iodepth=16 --iodepth_batch=1 --thread \ --loops=$((2**31)) & pid=$! sleep 1 systemctl hibernate sleep 10 kill $pid Reported-by: Oleksandr Natalenko <oleksa...@natalenko.name> References: "I/O hangs after resuming from suspend-to-ram&quo

[PATCH v7 2/9] md: Introduce md_stop_all_writes()

2017-10-09 Thread Bart Van Assche
Introduce md_stop_all_writes() because the next patch will add a second caller for this function. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Shaohua Li <s...@kernel.org> Cc: linux-r...@vger.kernel.org Cc: Ming Lei <ming

[PATCH v7 7/9] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-10-09 Thread Bart Van Assche
Convert blk_get_request(q, op, __GFP_RECLAIM) into blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Martin K. Petersen <martin.peter...@oracle.com> Acked-by: David S. Miller <da..

Re: [PATCH v7 0/9] Hello Jens,

2017-10-09 Thread Bart Van Assche
On Mon, 2017-10-09 at 16:13 -0700, Bart Van Assche wrote: > [ ... ] Just like for v6, the title of this series should have been: "block, scsi, md: Improve suspend and resume"

Re: [PATCH v5 2/8] md: Neither resync nor reshape while the system is frozen

2017-10-04 Thread Bart Van Assche
On Wed, 2017-10-04 at 19:30 +0800, Ming Lei wrote: > Last time, I asked which issue is fixed by this patch, but > never get answered, so again, what is issue fixed by > this patch? That's not correct. I did answer your question. See e.g. https://marc.info/?l=linux-block=150695879309606. > Given

Re: [PATCH v5 0/8] block, scsi, md: Improve suspend and resume

2017-10-04 Thread Bart Van Assche
On Wed, 2017-10-04 at 23:31 +0800, Ming Lei wrote: > On Wed, Oct 04, 2017 at 03:18:45PM +0000, Bart Van Assche wrote: > > On Wed, 2017-10-04 at 15:53 +0800, Ming Lei wrote: > > > 2) RCU read lock is missed in fast path > > > > Did you really post this as a rev

Re: [PATCH v8 03/10] md: Neither resync nor reshape while the system is frozen

2017-10-11 Thread Bart Van Assche
On Tue, 2017-10-10 at 18:48 -0700, Shaohua Li wrote: > The problem is __md_stop_writes set some bit like MD_RECOVERY_FROZEN, which > will prevent md_check_recovery restarting resync/reshape. I think we need > preserve mddev->recovery in suspend prepare and restore after resume Hello Shaohua, As

Re: [PATCH v4 5/7] scsi: Reduce suspend latency

2017-09-26 Thread Bart Van Assche
On Wed, 2017-09-27 at 06:23 +0800, Ming Lei wrote: > mutex_lock(>state_mutex); > err = scsi_device_set_state(sdev, SDEV_QUIESCE); > if (err == 0) > blk_set_preempt_only(q, true); > mutex_unlock(>state_mutex); > > if (err) >

Re: [PATCH V6 6/6] SCSI: set block queue at preempt only when SCSI device is put into quiesce

2017-09-27 Thread Bart Van Assche
On Wed, 2017-09-27 at 13:48 +0800, Ming Lei wrote: > @@ -2928,12 +2929,28 @@ scsi_device_quiesce(struct scsi_device *sdev) > { > int err; > > + /* > + * Simply quiesing SCSI device isn't safe, it is easy > + * to use up requests because all these allocated requests > +

Re: [PATCH v8 03/10] md: Neither resync nor reshape while the system is frozen

2017-10-10 Thread Bart Van Assche
On Tue, 2017-10-10 at 15:30 -0700, Shaohua Li wrote: > On Tue, Oct 10, 2017 at 02:03:39PM -0700, Bart Van Assche wrote: > > Some people use the md driver on laptops and use the suspend and > > resume functionality. Since it is essential that submitting of > > new I/O

Re: Fix false positive by LOCKDEP_CROSSRELEASE

2017-10-18 Thread Bart Van Assche
On Wed, 2017-10-18 at 18:38 +0900, Byungchul Park wrote: > Several false positives were reported, so I tried to fix them. > > It would be appreciated if you tell me if it works as expected, or let > me know your opinion. What I have been wondering about is whether the crosslock checking makes

Re: [PATCH v9 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 08:43 +0800, Ming Lei wrote: > On Mon, Oct 16, 2017 at 04:29:04PM -0700, Bart Van Assche wrote: > > [ ... ] > > int > > scsi_device_quiesce(struct scsi_device *sdev) > > { > > + struct request_queue *q = sde

[PATCH v10 03/10] md: Neither resync nor reshape while the system is frozen

2017-10-17 Thread Bart Van Assche
will restart after the system is resumed and a message similar to the following will appear in the system log: md: md0: data-check interrupted. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Shaohua Li <s...@kernel.org> Reviewed-by: Hannes Reinecke <h...@s

[PATCH v10 04/10] block: Make q_usage_counter also track legacy requests

2017-10-17 Thread Bart Van Assche
ed a comment and made sure REQ_NOWAIT is handled properly in blk_old_get_request() ] Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Hannes Reinecke <h...@suse.c

[PATCH v10 06/10] block: Introduce BLK_MQ_REQ_PREEMPT

2017-10-17 Thread Bart Van Assche
Set RQF_PREEMPT if BLK_MQ_REQ_PREEMPT is passed to blk_get_request_flags(). Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Tested-by: Martin Steigerwald <mar...@lichtvoll.de> Cc: Christoph Hellwig <h...@lst.d

[PATCH v10 08/10] block: Add the QUEUE_FLAG_PREEMPT_ONLY request queue flag

2017-10-17 Thread Bart Van Assche
This flag will be used in the next patch to let the block layer core know whether or not a SCSI request queue has been quiesced. A quiesced SCSI queue namely only processes RQF_PREEMPT requests. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...

[PATCH v10 01/10] md: Rename md_notifier into md_reboot_notifier

2017-10-17 Thread Bart Van Assche
This avoids confusion with the pm notifier that will be added through a later patch. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Shaohua Li <s...@kernel.org> Reviewed-by: Hannes Reinecke <

[PATCH v10 07/10] ide, scsi: Tell the block layer at request allocation time about preempt requests

2017-10-17 Thread Bart Van Assche
Convert blk_get_request(q, op, __GFP_RECLAIM) into blk_get_request_flags(q, op, BLK_MQ_PREEMPT). This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Tested-by: Martin Steigerwald <mar...@lichtvoll.de> Acked-by: David S. Miller <da..

[PATCH v10 09/10] block, scsi: Make SCSI quiesce and resume work reliably

2017-10-17 Thread Bart Van Assche
s=512 --rw=randread \ --ioengine=libaio --numjobs=4 --iodepth=16 --iodepth_batch=1 --thread \ --loops=$((2**31)) & pid=$! sleep 1 systemctl hibernate sleep 10 kill $pid Reported-by: Oleksandr Natalenko <oleksa...@natalenko.name> References: "I/O hangs after resuming from suspend-to-ram&quo

[PATCH v10 05/10] block: Introduce blk_get_request_flags()

2017-10-17 Thread Bart Van Assche
A side effect of this patch is that the GFP mask that is passed to several allocation functions in the legacy block layer is changed from GFP_KERNEL into __GFP_DIRECT_RECLAIM. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Teste

[PATCH v10 10/10] block, nvme: Introduce blk_mq_req_flags_t

2017-10-17 Thread Bart Van Assche
functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Hannes Reinecke <h...@suse.com> Cc: linux-n...@lists.infradead.org Cc: Christoph Hellwig <h...@lst.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> Cc: Ming Lei <ming@redhat.com> ---

[PATCH v10 02/10] md: Introduce md_stop_all_writes()

2017-10-17 Thread Bart Van Assche
Introduce md_stop_all_writes() because the next patch will add a second caller for this function. This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Shaohua Li <

Re: [PATCH v10 00/10] block, scsi, md: Improve suspend and resume

2017-10-17 Thread Bart Van Assche
On Tue, 2017-10-17 at 17:28 -0600, Jens Axboe wrote: > On 10/17/2017 05:26 PM, Bart Van Assche wrote: > > It is known that during the resume following a hibernate, especially when > > using an md RAID1 array created on top of SCSI devices, sometimes the system > > hangs

[PATCH v10 00/10] block, scsi, md: Improve suspend and resume

2017-10-17 Thread Bart Van Assche
in this patch series. Changes between v2 and v3: - Made md kernel threads freezable. - Changed the approach for quiescing SCSI devices again. - Addressed Ming's review comments. Changes compared to v1 of this patch series: - Changed the approach and rewrote the patch series. Bart Van Assche (9

Re: [bug report] A race between blk_cleanup_queue and blk_timeout_work

2017-10-18 Thread Bart Van Assche
On Wed, 2017-10-18 at 09:39 -0700, Bart Van Assche wrote: > On Tue, 2017-10-17 at 09:55 +0800, chenxiang (M) wrote: > > I find there is a race between blk_cleanup_queue and blk_timeout_work > > Thanks for the detailed report. Would it be possible to test the patch below &g

Re: [bug report] A race between blk_cleanup_queue and blk_timeout_work

2017-10-18 Thread Bart Van Assche
v10)? Thanks, Bart. Subject: [PATCH] block: Fix race between blk_cleanup_queue() and timeout handling Make sure that if the timeout timer fires after a queue has been marked "dying" that the affected requests are finished. Reported-by: chenxiang (M) <chenxian...@hisilicon.com> Sign

Re: [bug report] regression bisected to "block: Make most scsi_req_init() calls implicit"

2017-10-23 Thread Bart Van Assche
On Mon, 2017-10-23 at 09:41 -0600, dann frazier wrote: > (gdb) list *(sg_io+0x120) > 0x084e71a8 is in sg_io (./include/linux/uaccess.h:113). > 108 static inline unsigned long > 109 _copy_from_user(void *to, const void __user *from, unsigned long n) > 110 { > 111 unsigned

Re: [PATCH] blk-mq: Iterate also over sched_tags requests at blk_mq_tagset_iter()

2017-10-23 Thread Bart Van Assche
On Sun, 2017-10-22 at 13:47 +, Israel Rukshin wrote: > @@ -441,6 +442,8 @@ static int blk_mq_sched_alloc_tags(struct request_queue > *q, > if (!hctx->sched_tags) > return -ENOMEM; > > + set->sched_tags[hctx_idx] = hctx->sched_tags; > + > ret =

Re: [RESEND PATCH 1/3] completion: Add support for initializing completion with lockdep_map

2017-10-22 Thread Bart Van Assche
On Sat, 2017-10-21 at 11:23 +0900, Byungchul Park wrote: > On Sat, Oct 21, 2017 at 4:58 AM, Bart Van Assche <bart.vanass...@wdc.com> > wrote: > > As explained in another e-mail thread, unlike the lock inversion checking > > performed by the <= v4.13 lockdep c

Re: [PATCH] block: fix a comment typo in req_opf

2017-11-27 Thread Bart Van Assche
On Fri, 2017-11-24 at 23:26 +0900, Minwoo Im wrote: > a tiny comment typo fixed. Patch descriptions should use the imperative mood. Anyway: Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V2 1/5] dm-mpath: don't call blk_mq_delay_run_hw_queue() in case of BLK_STS_RESOURCE

2017-11-27 Thread Bart Van Assche
On Mon, 2017-11-27 at 13:07 +0800, Ming Lei wrote: > If .queue_rq() returns BLK_STS_RESOURCE, blk-mq will rerun the queue in > the three situations: > > 1) if BLK_MQ_S_SCHED_RESTART is set > - queue is rerun after one rq is completed, see blk_mq_sched_restart() > which is run from

Re: [PATCH] block: drain queue before waiting for q_usage_counter becoming zero

2017-11-22 Thread Bart Van Assche
On Wed, 2017-11-22 at 13:11 +0800, Ming Lei wrote: > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 11097477eeab..3d3797327491 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -161,6 +161,8 @@ void blk_freeze_queue(struct request_queue *q) >* exported to drivers as the only

Re: [PATCH 00/11] fs: use freeze_fs on suspend/hibernate

2017-11-30 Thread Bart Van Assche
On Wed, 2017-11-29 at 15:23 -0800, Luis R. Rodriguez wrote: > This is a followup from the original RFC which proposed to start > to kill kthread freezing all together [0]. Instead of going straight > out to the jugular for kthread freezing this series only addresses > killing freezer calls on

<    6   7   8   9   10   11   12   13   14   15   >