All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Lin Ming <ming.m.lin@intel.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	Alan Stern <stern@rowland.harvard.edu>,
	"Rafael J. Wysocki" <rjw@sisk.pl>, Shaohua Li <shli@kernel.org>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	linux-scsi@vger.kernel.org
Subject: Re: [PATCH v5 3/4] block: implement runtime pm strategy
Date: Fri, 6 Jul 2012 01:27:52 -0600	[thread overview]
Message-ID: <20120706072752.GD17681@parisc-linux.org> (raw)
In-Reply-To: <1341547472-6863-4-git-send-email-ming.m.lin@intel.com>

On Fri, Jul 06, 2012 at 12:04:31PM +0800, Lin Ming wrote:
> When a request is added:
>     If device is suspended or is suspending and the request is not a
>     PM request, resume the device.
> 
> When a request finishes:
>     Call pm_runtime_mark_last_busy().
> 
> When pick a request:
>     If device is resuming/suspending, then only PM request is allowed to go.
>     Return NULL for other cases.

This only works for drivers which are struct request based.  For those
that handle struct bio directly, nr_pending will always be 0.

I think the right place to increment nr_pending is in generic_make_request.
But I'm not sure where to decrement it.  I think we need a blk_bio_endio()
which does some housekeeping and then calls bio_endio().

-- 
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

  parent reply	other threads:[~2012-07-06  7:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06  4:04 [PATCH v5 0/4] block layer runtime pm Lin Ming
2012-07-06  4:04 ` [PATCH v5 1/4] block: add a flag to identify PM request Lin Ming
2012-07-06  4:04 ` [PATCH v5 2/4] block: add runtime pm helpers Lin Ming
2012-07-06  4:04 ` [PATCH v5 3/4] block: implement runtime pm strategy Lin Ming
2012-07-06  5:00   ` James Bottomley
2012-07-06  6:07     ` Lin Ming
2012-07-06  8:05       ` James Bottomley
2012-07-06 14:59         ` Alan Stern
2012-07-06 14:59           ` Alan Stern
2013-01-14  7:18         ` Aaron Lu
2012-07-06  7:27   ` Matthew Wilcox [this message]
2012-07-06 14:21   ` Alan Stern
2012-07-06 14:21     ` Alan Stern
2012-07-06 14:51     ` Lin Ming
2012-07-06  4:04 ` [PATCH v5 4/4] [SCSI] sd: change to auto suspend mode Lin Ming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120706072752.GD17681@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=ming.m.lin@intel.com \
    --cc=rjw@sisk.pl \
    --cc=shli@kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.