From: Todd E Brandt <todd.e.brandt@linux.intel.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Phillip Susi <psusi@ubuntu.com>, Aaron Lu <aaron.lu@intel.com>,
Tejun Heo <tj@kernel.org>,
SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: Disk spin-up optimization during system resume
Date: Fri, 17 Jan 2014 17:24:21 -0800 [thread overview]
Message-ID: <20140118012420.GA11405@linux.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401170951270.1162-100000@iolanthe.rowland.org>
On Fri, Jan 17, 2014 at 09:57:47AM -0500, Alan Stern wrote:
> On Thu, 16 Jan 2014, Todd E Brandt wrote:
>
> > On Thu, Jan 16, 2014 at 03:05:40PM -0500, Alan Stern wrote:
> > > On Thu, 16 Jan 2014, Todd E Brandt wrote:
> > >
> > > > > Does this plan sound reasonable to everyone? Are there important
> > > > > aspects I haven't considered (such as interactions between the SCSI and
> > > > > ATA layers)?
> > > > >
> > > > > Alan Stern
> > > > >
> > > >
> > > > Both approaches employ non-blocking resume of the scsi disks so why don't
> > > > we treat these two patch sets as parts one and two. My patch just spins
> > > > everything up but sets everything to non-blocking, so it will take care
> > > > of the most common use cases. Your patch will then fine-tune that behavior
> > > > to only spin up those disks that are actually needed. I don't think there
> > > > are any serious conflicts between the two patch sets.
> > >
> > > Hmmm. In your 2/2 patch, sd_resume_complete() gets called in atomic
> > > context. I would need a process context in order to carry out a
> > > runtime resume. Any suggestions?
> >
> > The complete call is really just there to printk any errors and free
> > the sense buffer. Why would you want to carry out a runtime resume in
> > it?
>
> From my earlier message:
>
> Otherwise, check to see whether the disk is spinning up all
> by itself. This presumably will involve issuing a TEST UNIT
> READY command and checking the sense data. Maybe something
> different will be needed for ATA disks; I don't know.
>
> If the disk is spinning, or if you can't tell, call
> pm_runtime_resume() to put the disk back into the
> RPM_ACTIVE state (and spin it up in the case where you
> couldn't tell what it was doing).
>
> As you can see, the runtime resume is carried out in the completion
> routine for the TEST UNIT READY command. Since the command is likely
> to take a long time (Phillip said it can take up to 10 seconds for ATA
> disks), we want it to be asynchronous, like the START-STOP command.
10 seconds?! The only possible way that could happen is if the test unit
ready SCSI command actually triggered an ata port wakeup; at which point
you've already done the one thing you were trying not to do.
>
> > > Also, I don't understand the point of your 1/2 patch. If the whole
> > > point of that patch was to carry out the ATA port resume asynchronously
> > > ("thus allowing the next device in the pm queue to resume"), doesn't
> > > device_enable_async_suspend() already do that for you?
> > >
> > > Alan Stern
> > >
> >
> > The device_enable_async_suspend call is used to set a pm flag which lets
> > the power manager know that this device can be added to the async suspend
> > queue. Basically that means that it can be suspended/resumed in parallel
> > with all the other async devices, but resume still waits for all those
> > devices to finish before completing system resume.
>
> Correct.
>
> > My patch makes ata port and scsi disk resume 'non-blocking' (asynchronous
> > with respect to system resume). Which means once they're called the power
> > manager pays no more attention to them and will complete system resume
> > whenever. Both the power manager and the ata subsystems call these
> > features 'asynchronous' so it can be confusing.
>
> I see. That's not explained very well in the patch description -- it
> talks about going on to resume the next device on the list, but not
> about waiting for the overall system resume to finish.
I'll word it differently if I have to resubmit again, but it does assume
a working knowledge of the pm subsystem.
>
> Alan Stern
>
next prev parent reply other threads:[~2014-01-18 1:29 UTC|newest]
Thread overview: 142+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-17 19:33 [PATCH/RESEND v2 0/2] SATA disk resume time optimization Todd E Brandt
2013-11-07 1:53 ` Phillip Susi
2013-11-07 1:57 ` [PATCH 1/3] sd: don't bother spinning up disks on resume Phillip Susi
2013-11-07 18:21 ` Douglas Gilbert
2013-11-07 21:16 ` Phillip Susi
2013-11-16 18:20 ` James Bottomley
2013-11-17 3:50 ` Phillip Susi
2013-11-17 6:43 ` James Bottomley
2013-11-17 16:15 ` Phillip Susi
2013-11-17 23:54 ` Douglas Gilbert
2013-11-18 1:06 ` Phillip Susi
2013-11-18 15:54 ` Phillip Susi
2013-11-20 14:23 ` Mark Lord
2013-11-20 14:48 ` Phillip Susi
2013-11-28 1:39 ` Phillip Susi
2013-11-18 0:09 ` James Bottomley
2013-11-18 1:11 ` Phillip Susi
2013-11-16 5:23 ` Mark Lord
2013-11-16 14:52 ` Phillip Susi
2013-11-07 1:57 ` [PATCH 2/3] libata: resume in the background Phillip Susi
2013-11-07 1:57 ` [PATCH 3/3] libata: don't start disks on resume Phillip Susi
2013-11-09 1:20 ` [PATCH/RESEND v2 0/2] SATA disk resume time optimization Todd E Brandt
2013-11-09 20:59 ` Phillip Susi
2013-11-09 21:03 ` [PATCH 0/6] Let sleeping disks lie Phillip Susi
2013-12-16 23:30 ` Phillip Susi
2013-12-16 23:30 ` [PATCH 1/6] libata: use sleep instead of standby command Phillip Susi
2013-12-16 23:30 ` [PATCH 2/6] libata: avoid waking disk for several commands Phillip Susi
2013-12-16 23:30 ` [PATCH 3/6] libata: resume in the background Phillip Susi
2014-01-10 22:26 ` Dan Williams
2014-01-11 2:25 ` Phillip Susi
2014-01-11 3:11 ` Dan Williams
2013-12-16 23:30 ` [PATCH 4/6] libata: don't start disks on resume Phillip Susi
2013-12-16 23:30 ` [PATCH 5/6] sd: don't start disks on system resume Phillip Susi
2013-12-17 6:43 ` James Bottomley
2013-12-17 15:01 ` Phillip Susi
2013-12-17 17:48 ` James Bottomley
2013-12-17 18:30 ` Phillip Susi
2013-12-16 23:30 ` [PATCH 6/6] libata: return power status in REQUEST SENSE command Phillip Susi
2013-12-17 18:02 ` Sergei Shtylyov
2013-12-17 18:35 ` Phillip Susi
2014-01-06 2:14 ` REQ_PM vs REQ_TYPE_PM_RESUME Phillip Susi
2014-01-06 7:36 ` Sujit Reddy Thumma
2014-01-06 9:15 ` Aaron Lu
2014-01-06 14:40 ` Phillip Susi
2014-01-06 15:38 ` Alan Stern
2014-01-07 2:44 ` Phillip Susi
2014-01-07 15:20 ` Alan Stern
2014-01-07 15:40 ` Phillip Susi
2014-01-07 15:56 ` Alan Stern
2014-01-09 18:29 ` Douglas Gilbert
2014-01-09 19:20 ` Phillip Susi
2014-01-10 5:23 ` Douglas Gilbert
2014-01-10 14:29 ` Phillip Susi
2014-01-07 7:49 ` Aaron Lu
2014-01-07 14:50 ` Phillip Susi
2014-01-08 1:03 ` Aaron Lu
2014-01-08 1:16 ` Phillip Susi
2014-01-08 1:32 ` Aaron Lu
2014-01-08 1:53 ` Phillip Susi
2014-01-08 2:11 ` Aaron Lu
2014-01-08 2:19 ` Phillip Susi
2014-01-08 2:36 ` Aaron Lu
2014-01-08 5:24 ` Phillip Susi
2014-01-08 7:00 ` Aaron Lu
2014-01-08 19:30 ` Phillip Susi
2014-01-07 15:25 ` Alan Stern
2014-01-07 15:43 ` Phillip Susi
2014-01-07 16:08 ` Alan Stern
2014-01-07 16:37 ` Phillip Susi
2014-01-07 18:05 ` Alan Stern
2014-01-07 18:43 ` Phillip Susi
2014-01-07 19:18 ` Alan Stern
2014-01-07 23:47 ` Phillip Susi
2014-01-08 17:46 ` Alan Stern
2014-01-08 18:31 ` Alan Stern
2014-01-08 20:20 ` Phillip Susi
2014-01-08 21:21 ` Alan Stern
2014-01-08 21:50 ` Phillip Susi
2014-01-09 1:29 ` Aaron Lu
2014-01-09 12:17 ` Rafael J. Wysocki
2014-01-09 13:18 ` Rafael J. Wysocki
2014-01-09 15:40 ` Alan Stern
2014-01-09 15:53 ` Phillip Susi
2014-01-09 16:14 ` Alan Stern
2014-01-09 16:34 ` Phillip Susi
2014-01-09 17:06 ` Alan Stern
2014-01-16 16:59 ` Disk spin-up optimization during system resume Alan Stern
2014-01-16 18:04 ` Todd E Brandt
2014-01-16 18:33 ` Phillip Susi
2014-01-16 20:05 ` Alan Stern
2014-01-16 22:04 ` Todd E Brandt
2014-01-17 14:57 ` Alan Stern
2014-01-17 19:31 ` Dan Williams
2014-01-17 20:15 ` Alan Stern
2014-01-17 20:24 ` Tejun Heo
2014-01-17 20:55 ` Phillip Susi
2014-01-18 14:04 ` Tejun Heo
2014-01-18 1:36 ` Todd E Brandt
2014-01-18 1:41 ` Alan Stern
2014-01-18 2:15 ` Dan Williams
2014-01-18 2:33 ` Alan Stern
2014-01-18 3:24 ` Phillip Susi
2014-01-18 13:59 ` Tejun Heo
2014-01-17 20:49 ` Phillip Susi
2014-01-17 22:17 ` Dan Williams
2014-01-18 3:18 ` Phillip Susi
2014-01-18 4:09 ` Dan Williams
2014-01-18 14:08 ` Alan Stern
2014-01-21 10:12 ` Dan Williams
2014-01-21 14:37 ` Phillip Susi
2014-01-21 16:03 ` Alan Stern
2014-01-21 16:18 ` Phillip Susi
2014-01-21 16:49 ` Alan Stern
2014-01-21 15:44 ` Alan Stern
2014-01-21 16:18 ` Dan Williams
2014-01-21 16:55 ` Dan Williams
2014-01-20 12:38 ` CrashPlan Pro
2014-01-20 14:30 ` Phillip Susi
2014-01-18 1:24 ` Todd E Brandt [this message]
2014-01-18 3:20 ` Phillip Susi
2014-01-16 18:39 ` Phillip Susi
2014-01-16 20:08 ` Alan Stern
2014-01-17 10:16 ` Oliver Neukum
2014-01-17 10:21 ` Tejun Heo
2014-01-17 18:18 ` Alan Stern
2014-01-17 18:39 ` James Bottomley
2014-01-17 19:07 ` Tejun Heo
2013-11-09 21:03 ` [PATCH 1/6] libata: use sleep instead of standby command Phillip Susi
2013-11-09 21:03 ` [PATCH 2/6] libata: avoid waking disk to check power Phillip Susi
2013-11-11 13:05 ` Sergei Shtylyov
2013-11-09 21:03 ` [PATCH 3/6] sd: don't bother spinning up disks on resume Phillip Susi
2013-11-11 13:08 ` Sergei Shtylyov
2013-11-11 14:28 ` Phillip Susi
2013-11-09 21:03 ` [PATCH 4/6] libata: resume in the background Phillip Susi
2013-11-11 13:10 ` Sergei Shtylyov
2013-11-09 21:03 ` [PATCH 5/6] libata: don't start disks on resume Phillip Susi
2013-11-09 21:03 ` [PATCH 6/6] libata: fake some more commands when drive is sleeping Phillip Susi
2013-11-11 16:59 ` [PATCH/RESEND v2 0/2] SATA disk resume time optimization Todd E Brandt
2013-11-11 17:08 ` Phillip Susi
2013-12-17 12:15 ` Tejun Heo
2013-12-17 14:24 ` Phillip Susi
2013-11-27 16:18 ` Phillip Susi
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=20140118012420.GA11405@linux.intel.com \
--to=todd.e.brandt@linux.intel.com \
--cc=aaron.lu@intel.com \
--cc=linux-scsi@vger.kernel.org \
--cc=psusi@ubuntu.com \
--cc=stern@rowland.harvard.edu \
--cc=tj@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).