[PATCH v8 5/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-18 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v8 4/8] block, scsi: Change the preempt-only flag into a counter

2018-09-18 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v8 2/8] blk-mq: Introduce blk_mq_queue_rq_iter()

2018-09-18 Thread Bart Van Assche
This function will be used in the patch "Make blk_get_request() block for non-PM requests while suspended". Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-mq-

[PATCH v8 0/8] blk-mq: Implement runtime power management

2018-09-18 Thread Bart Van Assche
Jianchao's feedback including the comment about runtime overhead of switching a per-cpu counter to atomic mode. Changes compared to v1: - Moved the runtime power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (6): block: Move power management code i

Re: [PATCH v7 5/6] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-18 Thread Bart Van Assche
On 9/17/18 7:39 PM, jianchao.wang wrote: On 09/18/2018 04:15 AM, Bart Van Assche wrote: Instead of allowing requests that are not power management requests to enter the queue in runtime suspended status (RPM_SUSPENDED), make the blk_get_request() caller block. This change fixes a starvation

Re: [PATCH v7 0/6] blk-mq: Implement runtime power management

2018-09-17 Thread Bart Van Assche
On 9/17/18 1:11 PM, Bart Van Assche wrote: [ ... ] Please ignore this e-mail thread - it contains a mixup of two versions of this patch series. Bart.

[PATCH v7 5/6] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-17 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mi

[PATCH v7 4/6] block: Schedule runtime resume earlier

2018-09-17 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files

[PATCH v7 6/6] blk-mq: Enable support for runtime power management

2018-09-17 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v7 1/6] block: Move power management code into a new source file

2018-09-17 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v7 2/6] block, scsi: Change the preempt-only flag into a counter

2018-09-17 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v7 3/6] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-17 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v7 0/6] blk-mq: Implement runtime power management

2018-09-17 Thread Bart Van Assche
gement code into a separate file. - Addressed Ming's feedback. Bart Van Assche (6): block: Move power management code into a new source file block, scsi: Change the preempt-only flag into a counter block: Split blk_pm_add_request() and blk_pm_put_request() block: Schedule runtime resume

[PATCH v7 4/6] block: Schedule runtime resume earlier

2018-09-17 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files

[PATCH v7 5/6] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-17 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mi

[PATCH v7 6/7] block: Make blk_get_request() block for non-PM requests while suspended

2018-09-17 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mi

[PATCH v7 7/7] blk-mq: Enable support for runtime power management

2018-09-17 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v7 1/6] block: Move power management code into a new source file

2018-09-17 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v7 5/7] block: Schedule runtime resume earlier

2018-09-17 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/elevator.c | 1 - 2 files

[PATCH v7 6/6] blk-mq: Enable support for runtime power management

2018-09-17 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v7 3/6] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-17 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v7 4/7] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-17 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions and thereby separate legacy block layer code from code that works for both the legacy block layer and blk-mq. A later patch will add calls to the new functions in the blk-mq code. Signed-off-by: Bart Van

[PATCH v7 3/7] block, scsi: Introduce blk_pm_runtime_exit()

2018-09-17 Thread Bart Van Assche
Since it is possible to unbind a SCSI ULD and since unbinding removes the association between a request queue and struct device, the q->dev pointer has to be reset during unbind. Hence introduce a function in the block layer that clears request_queue.dev. Signed-off-by: Bart Van Assche

[PATCH v7 2/6] block, scsi: Change the preempt-only flag into a counter

2018-09-17 Thread Bart Van Assche
" mode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v7 0/6] blk-mq: Implement runtime power management

2018-09-17 Thread Bart Van Assche
gement code into a separate file. - Addressed Ming's feedback. Bart Van Assche (6): block: Move power management code into a new source file block, scsi: Change the preempt-only flag into a counter block: Split blk_pm_add_request() and blk_pm_put_request() block: Schedule runtime resume

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-09-15 Thread Bart Van Assche
On 09/12/18 18:06, Omar Sandoval wrote: Ping, Bart, can you look into this? It'd be nice to get this in. Hello Omar, I will repost this patch series as soon as I have the time. I have been more busy than usual during the past four weeks. Best regards, Bart.

Re: [PATCH 1/5] block: genhd: add 'groups' argument to device_add_disk

2018-09-05 Thread Bart Van Assche
groups were to be created with sysfs_add_groups(). Reviewed-by: Bart Van Assche

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-08-22 Thread Bart Van Assche
On Tue, 2018-08-21 at 08:46 +0200, Johannes Thumshirn wrote: > On Mon, Aug 20, 2018 at 03:46:45PM +0000, Bart Van Assche wrote: > > Moving these tests into the nvme directory is possible but will make it > > harder to run the NVMeOF multipath tests separately. Are you fine with

Re: [PATCH blktests 0/3] Add NVMeOF multipath tests

2018-08-20 Thread Bart Van Assche
On Mon, 2018-08-20 at 09:31 +0200, Johannes Thumshirn wrote: > On Wed, Aug 15, 2018 at 01:37:25PM -0700, Bart Van Assche wrote: > > Hello Omar, > > > > The three patches in this series add several NVMeOF multipath tests. These > > tests are similar in nature to the

Re: [PATCH blktests 3/3] Add NVMeOF dm-mpath tests

2018-08-17 Thread Bart Van Assche
On Fri, 2018-08-17 at 10:24 -0400, Mike Snitzer wrote: > Put differently: until Jens stops taking hch's pull requests despite > concerns being raised against hch's approach (that hch completely > ignores because he rules with an iron fist from the top of a mountain in > the Alps) we're pretty much

[PATCH blktests 3/3] Add NVMeOF dm-mpath tests

2018-08-15 Thread Bart Van Assche
initiator and target drivers instead of the SRP initiator and target drivers. Signed-off-by: Bart Van Assche --- tests/nvmeof-mp/.gitignore| 1 + tests/nvmeof-mp/001 | 50 ++ tests/nvmeof-mp/001.out | 3 + tests/nvmeof-mp/002 | 50 ++ tests

[PATCH blktests 1/3] tests/srp: Remove unused code

2018-08-15 Thread Bart Van Assche
Remove all code that depends on $nvme != "" and also the $nvme variable itself. Signed-off-by: Bart Van Assche --- tests/srp/001 | 19 + tests/srp/002 | 2 +- tests/srp/003 | 2 +- tests/srp/004 | 2 +- tests/srp/011 | 2 +- tests/srp

[PATCH blktests 2/3] tests/srp: Remove /etc/multipath.conf after a test has finished

2018-08-15 Thread Bart Van Assche
Instead of removing /etc/multipath.conf before a test starts, remove it after a test has finished. This change is needed to let the nvmeof-mp tests run after the srp tests have been run. Signed-off-by: Bart Van Assche --- tests/srp/rc | 13 +++-- 1 file changed, 7 insertions(+), 6

[PATCH blktests 0/3] Add NVMeOF multipath tests

2018-08-15 Thread Bart Van Assche
Hello Omar, The three patches in this series add several NVMeOF multipath tests. These tests are similar in nature to the SRP tests. Please consider these patches for the upstream blktests repository. Thanks, Bart. Bart Van Assche (3): tests/srp: Remove unused code tests/srp: Remove /etc

Re: [PATCH 1/6] genhd: drop 'bool' argument from __device_add_disk()

2018-08-13 Thread Bart Van Assche
On Mon, 2018-07-30 at 10:57 +0200, Hannes Reinecke wrote: > On 07/30/2018 10:56 AM, Christoph Hellwig wrote: > > I really don't see the point for this change. > > Okay, I'll be dropping it on the next iteration. Hello Hannes, Have you already decided when you will post the next iteration of this

Re: [PATCH 3/6] nvme: register ns_id attributes as default sysfs groups

2018-08-13 Thread Bart Van Assche
On Mon, 2018-07-30 at 09:12 +0200, Hannes Reinecke wrote: > @@ -3061,11 +3066,7 @@ static void nvme_alloc_ns(struct nvme_ctrl *ctrl, > unsigned nsid) > > nvme_get_ctrl(ctrl); > > - device_add_disk(ctrl->device, ns->disk, NULL); > - if (sysfs_create_group(&disk_to_dev(ns->disk)->k

Re: [PATCH v2 0/2] Fix a race condition related to creation of /dev/nvme0n

2018-08-13 Thread Bart Van Assche
On Mon, 2018-08-13 at 20:42 +0200, Hannes Reinecke wrote: > I have fixed the very same thing with my patchset titled "genhd: > register default groups with device_add_disk" which is waiting for > inclusion. Thanks Hannes for the feedback. I will drop this patch series and review your patches ins

[PATCH v2 1/2] block: Introduce alloc_disk_node_attr()

2018-08-13 Thread Bart Van Assche
This patch does not change the behavior of any existing code but introduces a function that will be used by the next patch. Signed-off-by: Bart Van Assche Cc: Keith Busch Cc: Christoph Hellwig Cc: Greg Kroah-Hartman Cc: Sagi Grimberg Cc: Matias Bjorling Cc: --- block/genhd.c | 26

[PATCH v2 2/2] nvme: Fix race conditions related to creation of /dev/nvme0n

2018-08-13 Thread Bart Van Assche
butes to sysfs") Signed-off-by: Bart Van Assche Cc: Keith Busch Cc: Christoph Hellwig Cc: Greg Kroah-Hartman Cc: Sagi Grimberg Cc: Matias Bjorling Cc: --- drivers/nvme/host/core.c | 17 + drivers/nvme/host/lightnvm.c | 34 +++--- drivers

[PATCH v2 0/2] Fix a race condition related to creation of /dev/nvme0n

2018-08-13 Thread Bart Van Assche
kernel. Thanks, Bart. Bart Van Assche (2): block: Introduce alloc_disk_node_attr() nvme: Fix race conditions related to creation of /dev/nvme0n block/genhd.c| 26 -- drivers/nvme/host/core.c | 17 + drivers/nvme/host/lightnvm.c | 34

Re: [PATCH v6 08/12] block, scsi: Introduce blk_pm_runtime_exit()

2018-08-13 Thread Bart Van Assche
On Mon, 2018-08-13 at 17:24 +0800, jianchao.wang wrote: > I'm afraid this will not work. Since this patch fixes a bug that nobody has reported so far and since no later patches rely on this patch, I will leave it out. Thanks, Bart.

[PATCH] blkcg: Make blkg_root_lookup() work for queues in bypass mode

2018-08-10 Thread Bart Van Assche
Tejun. Suggested-by: Tejun Heo Fixes: 6bad9b210a22 ("blkcg: Introduce blkg_root_lookup()") Signed-off-by: Bart Van Assche Cc: Tejun Heo --- block/blk-sysfs.c | 2 +- include/linux/blk-cgroup.h | 15 +-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --g

Re: [PATCH v6 08/12] block, scsi: Introduce blk_pm_runtime_exit()

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 15:27 +, Bart Van Assche wrote: > On Fri, 2018-08-10 at 10:39 +0800, jianchao.wang wrote: > > On 08/10/2018 03:41 AM, Bart Van Assche wrote: > > > +void blk_pm_runtime_exit(struct request_queue *q) > > > +{ > > > +

Re: [PATCH v6 08/12] block, scsi: Introduce blk_pm_runtime_exit()

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 10:39 +0800, jianchao.wang wrote: > On 08/10/2018 03:41 AM, Bart Van Assche wrote: > > +void blk_pm_runtime_exit(struct request_queue *q) > > +{ > > + if (!q->dev) > > + return; > > + > > + pm_runti

Re: [PATCH v6 11/12] block: Change the runtime power management approach (2/2)

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 09:51 +0800, jianchao.wang wrote: > On 08/10/2018 03:41 AM, Bart Van Assche wrote: > > + > > + blk_set_pm_only(q); > > + /* > > +* This function only gets called if the most recent > > +* pm_request_resume() call occur

Re: [PATCH v6 10/12] block: Change the runtime power management approach (1/2)

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 09:59 +0800, jianchao.wang wrote: > On 08/10/2018 03:41 AM, Bart Van Assche wrote: > > Instead of scheduling runtime resume of a request queue after a > > request has been queued, schedule asynchronous resume during request > > allocation. The new pm_r

Re: [PATCH v6 05/12] block, scsi: Rename QUEUE_FLAG_PREEMPT_ONLY into DV_ONLY and introduce PM_ONLY

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 09:39 +0800, jianchao.wang wrote: > On 08/10/2018 03:41 AM, Bart Van Assche wrote: > > +/* > > + * Whether or not blk_queue_enter() should proceed. RQF_PM requests are > > always > > + * allowed. RQF_DV requests are allowed if the PM_ONLY q

Re: [PATCH v6 02/12] scsi: Alter handling of RQF_DV requests

2018-08-10 Thread Bart Van Assche
On Fri, 2018-08-10 at 09:20 +0800, Ming Lei wrote: > On Thu, Aug 09, 2018 at 12:41:39PM -0700, Bart Van Assche wrote: > > Process all requests in state SDEV_CREATED instead of only RQF_DV > > requests. This does not change the behavior of the SCSI core because > > the SCSI dev

Re: [PATCH v5 1/3] blkcg: Introduce blkg_root_lookup()

2018-08-09 Thread Bart Van Assche
On Thu, 2018-08-09 at 12:56 -0700, Tejun Heo wrote: > Hello, > > On Thu, Aug 09, 2018 at 07:53:36AM -0700, Bart Van Assche wrote: > > +/** > > + * blkg_lookup - look up blkg for the specified request queue > > + * @q: request_queue of interest > > + * > > +

[PATCH v6 01/12] block, scsi: Introduce request flag RQF_DV

2018-08-09 Thread Bart Van Assche
requests already have the RQF_PM flag set. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: David S. Miller Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c| 11 +-- block/blk-mq

[PATCH v6 06/12] scsi: Reallow SPI domain validation during system suspend

2018-08-09 Thread Bart Van Assche
n and system suspend"). Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Woody Suwalski Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- drivers/scsi/scsi_lib.c | 37 +-- dr

[PATCH v6 03/12] scsi: Only set RQF_DV for requests used for domain validation

2018-08-09 Thread Bart Van Assche
accessed easily from inside scsi_execute(). This patch prevents that e.g. event checking can occur during domain validation. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern

[PATCH v6 04/12] scsi: Introduce the SDEV_SUSPENDED device status

2018-08-09 Thread Bart Van Assche
scsi_device_unsuspend() for power management. Rename scsi_device_resume() into scsi_device_unquiesce() to avoid confusion. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- drivers

[PATCH v6 08/12] block, scsi: Introduce blk_pm_runtime_exit()

2018-08-09 Thread Bart Van Assche
Since it is possible to unbind a SCSI ULD and since unbinding removes the association between a request queue and struct device, the q->dev pointer has to be reset during unbind. Hence introduce a function in the block layer that clears request_queue.dev. Signed-off-by: Bart Van Assche

[PATCH v6 05/12] block, scsi: Rename QUEUE_FLAG_PREEMPT_ONLY into DV_ONLY and introduce PM_ONLY

2018-08-09 Thread Bart Van Assche
power management and blk_set_dv_only() and blk_clear_dv_only() functions for SCSI domain validation purposes. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk

[PATCH v6 07/12] block: Move power management code into a new source file

2018-08-09 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v6 02/12] scsi: Alter handling of RQF_DV requests

2018-08-09 Thread Bart Van Assche
whether all states have been handled. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- drivers/scsi/scsi_lib.c | 78 +++-- 1 file

[PATCH v6 12/12] blk-mq: Enable support for runtime power management

2018-08-09 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v6 11/12] block: Change the runtime power management approach (2/2)

2018-08-09 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mi

[PATCH v6 09/12] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-08-09 Thread Bart Van Assche
Move the pm_request_resume() and pm_runtime_mark_last_busy() calls into two new functions. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 1

[PATCH v6 10/12] block: Change the runtime power management approach (1/2)

2018-08-09 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c | 2 ++ block/blk-mq.c | 2 ++ block

[PATCH v6 00/12] blk-mq: Implement runtime power management

2018-08-09 Thread Bart Van Assche
me power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (12): block, scsi: Introduce request flag RQF_DV scsi: Alter handling of RQF_DV requests scsi: Only set RQF_DV for requests used for domain validation scsi: Introduce the SDEV_SUSPENDED device status

Re: [PATCH v5 5/9] block: Change the runtime power management approach (1/2)

2018-08-09 Thread Bart Van Assche
On Thu, 2018-08-09 at 10:52 +0800, Ming Lei wrote: > On Wed, Aug 08, 2018 at 05:28:43PM +0000, Bart Van Assche wrote: > > Some but not all blk_queue_enter() calls are related to request allocation > > so > > The only one I remember is scsi_ioctl_reset(), in which scsi_a

[PATCH v5 3/3] block: Ensure that a request queue is dissociated from the cgroup controller

2018-08-09 Thread Bart Van Assche
eue removal and the block cgroup controller") # v4.17 Signed-off-by: Bart Van Assche Tested-by: Alexandru Moise <00moses.alexande...@gmail.com> Reviewed-by: Johannes Thumshirn Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Alexandru Moise <00moses.alexande...@gma

[PATCH v5 0/3] Ensure that a request queue is dissociated from the cgroup controller

2018-08-09 Thread Bart Van Assche
. Changes between v3 and v4: - Added "Cc: stable" tags. Changes between v2 and v3: - Avoid code duplication by introducing a new helper function. Changes between v1 and v2: - Fixed the build for CONFIG_BLK_CGROUP=n. Bart Van Assche (3): blkcg: Introduce blkg_root_lookup() block:

[PATCH v5 1/3] blkcg: Introduce blkg_root_lookup()

2018-08-09 Thread Bart Van Assche
This new function will be used in a later patch to verify whether a queue has been dissociated from the cgroup controller before being released. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Omar Sandoval Cc: Johannes Thumshirn Cc: Alexandru Moise

[PATCH v5 2/3] block: Introduce blk_exit_queue()

2018-08-09 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Cc: Ming Lei Cc: Omar Sandoval Cc: Alexandru Moise <00moses.alexande...@gmail.com> Cc: Joseph Qi Cc: --- block/blk-core.

[PATCH] block: Remove two superfluous #include directives

2018-08-09 Thread Bart Van Assche
Commit 12f5b9314545 ("blk-mq: Remove generation seqeunce") removed the only seqcount_t and u64_stats_sync instances from but did not remove the corresponding #include directives. Since these include directives are no longer needed, remove them. Signed-off-by: Bart Van Assche Cc:

Re: [PATCH v5 4/9] percpu-refcount: Introduce percpu_ref_is_in_use()

2018-08-09 Thread Bart Van Assche
On Wed, 2018-08-08 at 08:23 -0700, Tejun Heo wrote: > On Tue, Aug 07, 2018 at 03:51:28PM -0700, Bart Van Assche wrote: > > Introduce a function that allows to determine whether a per-cpu refcount > > is in use. This function will be used in a later patch to determine > > whe

Re: [PATCH v5 6/9] block: Change the runtime power management approach (2/2)

2018-08-08 Thread Bart Van Assche
On Wed, 2018-08-08 at 16:50 +0800, Ming Lei wrote: > On Tue, Aug 07, 2018 at 03:51:30PM -0700, Bart Van Assche wrote: > > Instead of allowing requests that are not power management requests > > to enter the queue in runtime suspended status (RPM_SUSPENDED), make > > the blk

Re: [PATCH v5 5/9] block: Change the runtime power management approach (1/2)

2018-08-08 Thread Bart Van Assche
On Wed, 2018-08-08 at 14:43 +0800, jianchao.wang wrote: > > On 08/08/2018 02:11 PM, jianchao.wang wrote: > > Hi Bart > > > > On 08/08/2018 06:51 AM, Bart Van Assche wrote: > > > @@ -391,6 +393,9 @@ static struct request *blk_mq_get_reque

Re: [PATCH v5 1/9] block: Change the preempt-only flag into a counter

2018-08-08 Thread Bart Van Assche
On Wed, 2018-08-08 at 16:21 +0800, Ming Lei wrote: > On Tue, Aug 07, 2018 at 03:51:25PM -0700, Bart Van Assche wrote: > > The RQF_PREEMPT flag is used for three purposes: > > - In the SCSI core, for making sure that power management requests > > are executed if a devic

Re: [PATCH v4 2/2] block: Ensure that a request queue is dissociated from the cgroup controller

2018-08-08 Thread Bart Van Assche
On Wed, 2018-08-08 at 08:41 -0600, Jens Axboe wrote: > On 7/30/18 3:10 PM, Bart Van Assche wrote: > > +#ifdef CONFIG_BLK_CGROUP > > + { > > + struct blkcg_gq *blkg; > > + > > + rcu_read_lock(); > > +

[PATCH 2/2] cfq: Suppress compiler warnings about comparisons

2018-08-07 Thread Bart Van Assche
E_FUNCTION(cfq_group_idle_us_store, &cfqd->cfq_group_idle, 0, UINT_MAX); ^~~ Signed-off-by: Bart Van Assche --- block/cfq-iosched.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c ind

[PATCH 0/2] CFQ: Suppress W=1 compiler warnings

2018-08-07 Thread Bart Van Assche
Hello Jens, This patch series suppresses the compiler warnings that are reported when building the CFQ I/O scheduler with W=1. Please consider these patches for kernel v4.19. Thanks, Bart. Bart Van Assche (2): cfq: Annotate fall-through in a switch statement cfq: Suppress compiler warnings

[PATCH 1/2] cfq: Annotate fall-through in a switch statement

2018-08-07 Thread Bart Van Assche
This patch avoids that gcc complains about fall-through when building with W=1. Signed-off-by: Bart Van Assche --- block/cfq-iosched.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 82b6c27b3245..ec6acdd58b7a 100644 --- a/block/cfq-iosched.c

Re: [PATCH v3 4/9] percpu-refcount: Introduce percpu_ref_read()

2018-08-07 Thread Bart Van Assche
On Mon, 2018-08-06 at 10:18 -0700, Tejun Heo wrote: > I'm worried that this is too inviting for misuses and subtle problems. > For example, your patch which uses this function uses > synchronize_rcu() to synchronize against per-cpu counts after the > first snoop; however, percpu_ref uses sched rcu,

[PATCH v5 5/9] block: Change the runtime power management approach (1/2)

2018-08-07 Thread Bart Van Assche
patch that will make request allocation block while the queue status is not RPM_ACTIVE. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-core.c| 11 +++ block/blk-mq.c

[PATCH v5 1/9] block: Change the preempt-only flag into a counter

2018-08-07 Thread Bart Van Assche
ode as long as a block device is runtime suspended, make it possible to set "pm-only" mode from more than one context. Since with this change scsi_device_quiesce() is no longer idempotent, make that function return early if it is called for a quiesced queue. Signed-off-by: Bart Van A

[PATCH v5 4/9] percpu-refcount: Introduce percpu_ref_is_in_use()

2018-08-07 Thread Bart Van Assche
Introduce a function that allows to determine whether a per-cpu refcount is in use. This function will be used in a later patch to determine whether or not any block layer requests are being executed. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao

[PATCH v5 0/9] blk-mq: Implement runtime power management

2018-08-07 Thread Bart Van Assche
o detect missing pm_runtime_get*() calls. - Addressed Jianchao's feedback including the comment about runtime overhead of switching a per-cpu counter to atomic mode. Changes compared to v1: - Moved the runtime power management code into a separate file. - Addressed Ming's feedback. Bar

[PATCH v5 3/9] block, scsi: Introduce blk_pm_runtime_exit()

2018-08-07 Thread Bart Van Assche
Since it is possible to unbind a SCSI ULD and since unbinding removes the association between a request queue and struct device, the q->dev pointer has to be reset during unbind. Hence introduce a function in the block layer that clears request_queue.dev. Signed-off-by: Bart Van Assche

[PATCH v5 2/9] block: Move power management code into a new source file

2018-08-07 Thread Bart Van Assche
layer core code but also reduces the size of header file and hence should help to reduce the build time of the Linux kernel if CONFIG_PM is not defined. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan

[PATCH v5 7/9] block: Remove blk_pm_requeue_request()

2018-08-07 Thread Bart Van Assche
Since this function is now empty, remove it. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-pm.h | 8 block/elevator.c | 2 -- 2 files changed, 10 deletions(-) diff

[PATCH v5 9/9] blk-mq: Enable support for runtime power management

2018-08-07 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn

[PATCH v5 8/9] blk-mq: Insert a blk_pm_put_request() call

2018-08-07 Thread Bart Van Assche
Call blk_pm_put_request() after a request has finished. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Ming Lei Cc: Jianchao Wang Cc: Hannes Reinecke Cc: Johannes Thumshirn Cc: Alan Stern --- block/blk-mq.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/blk-mq.c b

[PATCH v5 6/9] block: Change the runtime power management approach (2/2)

2018-08-07 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Mi

Re: [PATCH v4 0/2] Ensure that a request queue is dissociated from the cgroup controller

2018-08-07 Thread Bart Van Assche
On Mon, 2018-07-30 at 14:10 -0700, Bart Van Assche wrote: > Several block drivers call alloc_disk() followed by put_disk() if something > fails before device_add_disk() is called without calling blk_cleanup_queue(). > Make sure that also for this scenario a request queue is dissociated

Re: [PATCH v3 4/9] percpu-refcount: Introduce percpu_ref_read()

2018-08-06 Thread Bart Van Assche
On Mon, 2018-08-06 at 10:18 -0700, Tejun Heo wrote: > I'm worried that this is too inviting for misuses and subtle problems. > For example, your patch which uses this function uses > synchronize_rcu() to synchronize against per-cpu counts after the > first snoop; however, percpu_ref uses sched rcu,

Re: [PATCH v4 07/10] block, scsi: Rework runtime power management

2018-08-06 Thread Bart Van Assche
On Sat, 2018-08-04 at 18:01 +0800, Ming Lei wrote: > On Sat, Aug 4, 2018 at 8:03 AM, Bart Van Assche > wrote: > > > > diff --git a/block/blk-pm.c b/block/blk-pm.c > > index 2a4632d0be4b..0708185ead61 100644 > > --- a/block/blk-pm.c > > +++ b/block/bl

Re: [PATCH v4 07/10] block, scsi: Rework runtime power management

2018-08-06 Thread Bart Van Assche
On Mon, 2018-08-06 at 10:46 +0800, jianchao.wang wrote: > On 08/04/2018 08:03 AM, Bart Van Assche wrote: > > Instead of allowing requests that are not power management requests > > to enter the queue in runtime suspended status (RPM_SUSPENDED), make > > the blk_get_r

Re: [PATCH v4 05/10] block: Serialize queue freezing and blk_pre_runtime_suspend()

2018-08-06 Thread Bart Van Assche
On Sat, 2018-08-04 at 18:23 +0800, Ming Lei wrote: > From user view, it isn't reasonable to prevent runtime suspend from happening > during queue freeze. The period can be a bit long, and it should be one > perfect > opportunity to suspend device during the period since no any IO is possible. Hel

Re: [PATCH v4 02/10] block, scsi: Give RQF_PREEMPT back its original meaning

2018-08-06 Thread Bart Van Assche
On Sat, 2018-08-04 at 09:16 +0800, Ming Lei wrote: > The above change will cause regression on SPI transport, please see > spi_dv_device(), where non-PM command is sent to device via > scsi_execute() after the device is put to QUIESCE. Hello Ming, I will drop this patch for now and revisit this c

Re: [PATCH v4 02/10] block, scsi: Give RQF_PREEMPT back its original meaning

2018-08-06 Thread Bart Van Assche
On Mon, 2018-08-06 at 08:27 +0200, Hannes Reinecke wrote: > I am not sure this is going to work for SCSI parallel; we're using the > QUIESCE state there to do domain validation, and all commands there are > most definitely not PM requests. > Can you please validate your patches with eg aic7xxx and

[PATCH v4 02/10] block, scsi: Give RQF_PREEMPT back its original meaning

2018-08-03 Thread Bart Van Assche
. Signed-off-by: Bart Van Assche Cc: Martin K. Petersen Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Alan Stern Cc: Johannes Thumshirn --- block/blk-core.c| 9 + drivers/scsi/scsi_lib.c | 28 include/linux/blk-mq.h | 2 ++ include

[PATCH v4 09/10] blk-mq: Insert blk_pm_{add,put}_request() calls

2018-08-03 Thread Bart Van Assche
Make sure that blk_pm_add_request() is called exactly once before a request is added to a software queue, to the scheduler and also before .queue_rq() is called directly. Call blk_pm_put_request() after a request has finished. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Jianchao

[PATCH v4 07/10] block, scsi: Rework runtime power management

2018-08-03 Thread Bart Van Assche
blk_get_request() callers are waiting. Instead of maintaining the q->nr_pending counter, rely on q->q_usage_counter. Call pm_runtime_mark_last_busy() every time a request finishes instead of only if the queue depth drops to zero. Signed-off-by: Bart Van Assche Cc: Martin K. Peters

[PATCH v4 03/10] block, ide: Remove flag BLK_MQ_REQ_PREEMPT

2018-08-03 Thread Bart Van Assche
). Signed-off-by: Bart Van Assche Cc: David S. Miller Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Alan Stern Cc: Johannes Thumshirn --- block/blk-core.c | 9 +++-- block/blk-mq.c | 2 -- drivers/ide/ide-pm.c | 3 ++- include/linux/blk-mq.h | 4 +--- 4 files

[PATCH v4 10/10] blk-mq: Enable support for runtime power management

2018-08-03 Thread Bart Van Assche
Now that the blk-mq core processes power management requests (marked with RQF_PREEMPT) in other states than RPM_ACTIVE, enable runtime power management for blk-mq. Signed-off-by: Bart Van Assche Cc: Christoph Hellwig Cc: Jianchao Wang Cc: Ming Lei Cc: Alan Stern Cc: Johannes Thumshirn

[PATCH v4 00/10] blk-mq: Enable runtime power management

2018-08-03 Thread Bart Van Assche
of switching a per-cpu counter to atomic mode. Changes compared to v1: - Moved the runtime power management code into a separate file. - Addressed Ming's feedback. Bart Van Assche (10): block: Change the preempt-only flag into a counter block, scsi: Give RQF_PREEMPT back its original meani

<    1   2   3   4   5   6   7   8   9   10   >