Re: [PATCH v2] blk-mq: Document the functions that iterate over requests

2018-09-21 Thread Jens Axboe
On 9/21/18 2:34 PM, Bart Van Assche wrote: > Make it easier to understand the purpose of the functions that iterate > over requests by documenting their purpose. Fix several minor spelling > and grammer mistakes in comments in these functions. Applied, thanks Bart. -- Jens Axboe

Re: [PATCH] block: use nanosecond resolution for iostat

2018-09-21 Thread Jens Axboe
On 9/21/18 5:44 PM, Omar Sandoval wrote: > From: Omar Sandoval > > Klaus Kusche reported that the I/O busy time in /proc/diskstats was not > updating properly on 4.18. This is because we started using ktime to > track elapsed time, and we convert nanoseconds to jiffies when we update > the

[PATCH] block: use nanosecond resolution for iostat

2018-09-21 Thread Omar Sandoval
From: Omar Sandoval Klaus Kusche reported that the I/O busy time in /proc/diskstats was not updating properly on 4.18. This is because we started using ktime to track elapsed time, and we convert nanoseconds to jiffies when we update the partition counter. However, this gets rounded down, so any

[PATCH v2] blk-mq: Document the functions that iterate over requests

2018-09-21 Thread Bart Van Assche
Make it easier to understand the purpose of the functions that iterate over requests by documenting their purpose. Fix several minor spelling and grammer mistakes in comments in these functions. Signed-off-by: Bart Van Assche Reviewed-by: Johannes Thumshirn Cc: Christoph Hellwig Cc: Ming Lei

[PATCH v10 8/8] blk-mq: Enable support for runtime power management

2018-09-21 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 v10 3/8] block: Split blk_pm_add_request() and blk_pm_put_request()

2018-09-21 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 v10 1/8] block: Move power management code into a new source file

2018-09-21 Thread Bart Van Assche
Move the code for runtime power management from blk-core.c into the new source file blk-pm.c. Move the corresponding declarations from into . For CONFIG_PM=n, leave out the declarations of the functions that are not used in that mode. This patch not only reduces the number of #ifdefs in the block

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

2018-09-21 Thread Bart Van Assche
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 issue: it is now guaranteed that power management requests will be executed no matter how many

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

2018-09-21 Thread Bart Van Assche
The RQF_PREEMPT flag is used for three purposes: - In the SCSI core, for making sure that power management requests are executed even if a device is in the "quiesced" state. - For domain validation by SCSI drivers that use the parallel port. - In the IDE driver, for IDE preempt requests. Rename

[PATCH v10 5/8] percpu-refcount: Introduce percpu_ref_resurrect()

2018-09-21 Thread Bart Van Assche
This function will be used in a later patch to switch the struct request_queue q_usage_counter from killed back to live. In contrast to percpu_ref_reinit(), this new function does not require that the refcount is zero. Signed-off-by: Bart Van Assche Cc: Tejun Heo Cc: Christoph Hellwig Cc: Ming

[PATCH v10 6/8] block: Allow unfreezing of a queue while requests are in progress

2018-09-21 Thread Bart Van Assche
A later patch will call blk_freeze_queue_start() followed by blk_mq_unfreeze_queue() without waiting for q_usage_counter to drop to zero. Make sure that this doesn't cause a kernel warning to appear by switching from percpu_ref_reinit() to percpu_ref_resurrect(). The former namely requires that

[PATCH v10 4/8] block: Schedule runtime resume earlier

2018-09-21 Thread Bart Van Assche
Instead of scheduling runtime resume of a request queue after a request has been queued, schedule asynchronous resume during request allocation. The new pm_request_resume() calls occur after blk_queue_enter() has increased the q_usage_counter request queue member. This change is needed for a later

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

2018-09-21 Thread Bart Van Assche
Hello Jens, One of the pieces that is missing before blk-mq can be made the default is implementing runtime power management support for blk-mq. This patch series not only implements runtime power management for blk-mq but also fixes a starvation issue in the power management code for the legacy

Re: REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ?

2018-09-21 Thread Hannes Reinecke
On 9/21/18 11:15 AM, Hannes Reinecke wrote: Hi all, there's one thing which decidedly puzzles me: [ .. ] Ah. Screw that. REQ_OP_XXX is a number, and the others are a bitmask. Sorry for the noise. Cheers, Hannes -- Dr. Hannes ReineckeTeamlead Storage & Networking

REQ_OP_WRITE_ZEROES clash with REQ_FAILFAST_TRANSPORT ?

2018-09-21 Thread Hannes Reinecke
Hi all, there's one thing which decidedly puzzles me: We have: #define REQ_OP_BITS 8 #define REQ_OP_MASK ((1 << REQ_OP_BITS) - 1) #define REQ_FLAG_BITS 24 enum req_opf { /* read sectors from the device */ REQ_OP_READ = 0, /* write sectors to the

Re: [GIT PULL] Storage fixes for 4.19-rc5

2018-09-21 Thread Greg Kroah-Hartman
On Thu, Sep 20, 2018 at 03:50:53PM -0600, Jens Axboe wrote: > Hi Greg, > > Three fixes that should go into this series. This pull request > contains: > > - Fix for leaking kernel pointer in floppy ioctl (Andy Whitcroft) > > - NVMe pull request from Christoph, and a single ANA log page fix >

Re: [RFC PATCH 5/6] lightnvm: pblk: Add RAIL interface

2018-09-21 Thread Hans Holmberg
On Fri, Sep 21, 2018 at 1:59 AM Heiner Litz wrote: > > On Wed, Sep 19, 2018 at 12:53 AM Hans Holmberg > wrote: > > > > On Tue, Sep 18, 2018 at 6:11 PM Heiner Litz wrote: > > > > > > On Tue, Sep 18, 2018 at 4:28 AM Hans Holmberg > > > wrote: > > > > > > > > On Mon, Sep 17, 2018 at 7:30 AM