public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC V2 0/3] blk-mq: support runtime PM
@ 2018-07-13  8:05 Ming Lei
  2018-07-13  8:06 ` [PATCH RFC V2 1/3] block: put runtime PM code into common helpers Ming Lei
                   ` (3 more replies)
  0 siblings, 4 replies; 34+ messages in thread
From: Ming Lei @ 2018-07-13  8:05 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Ming Lei, Rafael J. Wysocki, Alan Stern, linux-pm,
	Greg Kroah-Hartman, Christoph Hellwig, Bart Van Assche,
	Hannes Reinecke, Johannes Thumshirn, Adrian Hunter,
	James E.J. Bottomley, Martin K. Petersen, linux-scsi

Hi Guys,

Runtime PM is usually enabled for SCSI devices, and we are switching to
SCSI_MQ recently, but runtime PM isn't supported yet by blk-mq, and
people may complain that.

This patch tries to support runtime PM for blk-mq. And one chanllenge is
that it can be quite expensive to account the active in-flight IOs for
figuring out when to mark the last busy. This patch simply marks busy
after each non-PM IO is done, and this way is workable because:

1) pm_runtime_mark_last_busy() is very cheap

2) in-flight non-PM IO is checked in blk_pre_runtime_suspend(), so
if there is any IO queued, the device will be prevented from being
suspened.

3) Generally speaking, autosuspend_delay_ms is often big, and should
be in unit of second, so it shouldn't be a big deal to check if queue
is idle in blk_pre_runtime_suspend().


V2:
	- re-organize code as suggested by Christoph
	- use seqlock to sync runtime PM and IO path

Ming Lei (3):
  block: put runtime PM code into common helpers
  blk-mq: prepare for supporting runtime PM
  scsi_mq: enable runtime PM

 block/blk-core.c        | 176 +++++++++++++++++++++++++++++++++++++++---------
 block/blk-mq.c          |  71 +++++++++++++++++++
 block/blk-mq.h          |  10 +++
 drivers/scsi/scsi_lib.c |   3 +-
 include/linux/blk-mq.h  |   1 +
 include/linux/blkdev.h  |   1 +
 6 files changed, 228 insertions(+), 34 deletions(-)

Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: linux-pm@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org


-- 
2.9.5

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2018-07-19 14:43 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13  8:05 [PATCH RFC V2 0/3] blk-mq: support runtime PM Ming Lei
2018-07-13  8:06 ` [PATCH RFC V2 1/3] block: put runtime PM code into common helpers Ming Lei
2018-07-17 13:21   ` Christoph Hellwig
2018-07-13  8:06 ` [PATCH RFC V2 2/3] blk-mq: prepare for supporting runtime PM Ming Lei
2018-07-13 20:16   ` Alan Stern
2018-07-17 13:23   ` Christoph Hellwig
2018-07-13  8:06 ` [PATCH RFC V2 3/3] scsi_mq: enable " Ming Lei
2018-07-17 13:24   ` Christoph Hellwig
2018-07-17 15:30     ` Ming Lei
2018-07-17 15:34       ` Bart Van Assche
2018-07-17 15:38         ` Ming Lei
2018-07-17 19:50           ` hch
2018-07-17 20:54             ` Alan Stern
2018-07-17 21:49           ` Jens Axboe
2018-07-18 12:06             ` Ming Lei
2018-07-18 12:28               ` Johannes Thumshirn
2018-07-18 12:37                 ` Ming Lei
2018-07-18 14:12                 ` Alan Stern
2018-07-18 14:18                   ` Johannes Thumshirn
2018-07-18 15:01                     ` Alan Stern
2018-07-19  6:41                       ` Johannes Thumshirn
2018-07-19 14:35                         ` Alan Stern
2018-07-19 14:43                           ` Johannes Thumshirn
2018-07-18 14:50                   ` Jens Axboe
2018-07-18 18:46                     ` Alan Stern
2018-07-18 23:08                     ` Ming Lei
2018-07-18 12:43               ` Hannes Reinecke
2018-07-18 13:05                 ` Ming Lei
2018-07-13 14:21 ` [PATCH RFC V2 0/3] blk-mq: support " Jens Axboe
2018-07-14  2:37   ` Ming Lei
2018-07-14  2:54     ` Jens Axboe
2018-07-16 16:21       ` Bart Van Assche
2018-07-16 16:03     ` Bart Van Assche
2018-07-17  1:12       ` Ming Lei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox