From: Phillip Susi <psusi@ubuntu.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Aaron Lu <aaron.lu@intel.com>,
Sujit Reddy Thumma <sthumma@codeaurora.org>,
todd.e.brandt@linux.intel.com, tj@kernel.org,
JBottomley@parallels.com, linux-ide@vger.kernel.org,
linux-scsi@vger.kernel.org,
Linux-pm mailing list <linux-pm@vger.kernel.org>,
"Rafael J. Wysocki" <rjw@rjwysocki.net>
Subject: Re: REQ_PM vs REQ_TYPE_PM_RESUME
Date: Tue, 07 Jan 2014 18:47:57 -0500 [thread overview]
Message-ID: <52CC922D.9070208@ubuntu.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1401071352080.1296-100000@iolanthe.rowland.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 01/07/2014 02:18 PM, Alan Stern wrote:
> I don't know how you manually spin down your disk, but one
> reasonable way to do it is to set the autosuspend timeout to 0. If
> you use this approach and apply my patch, the disk should remain
> spun down when the system resumes.
The traditional method before the recently added block pm feature was
with hdparm -y.
> Right. If you hadn't put the whole system to sleep, the disk
> would have gone into runtime suspend 2 minutes later (assuming you
> didn't use it in the meantime). Whereas since you did put the
> whole system to sleep, the disk will go into runtime suspend 5
> minutes after the system wakes up -- not 2 minutes later. I.e.,
> the timer has been reset from 2 minutes back to 5.
What resets the timer? It should only be reset when IO is done. And
yes, it is exactly that wakeup and turn around and suspend again that
I'm trying to avoid; it puts unnecessary wear and tear on the disk.
> How is the kernel supposed to know that you finished using the
> disk before suspending the system? After all, by setting the
> autosuspend timeout to 5 minutes, you have already told the kernel
> to keep the disk spun up if it has been used any time in the last 5
> minutes, and you used it only 3 minutes ago. As far as the kernel
> can tell, you still want the disk to be spun up and ready for use.
> That remains true at the time of the system resume.
That's the whole point: it doesn't know. What it does know is that
the disk is spun down on resume, and it has no reason to believe that
you will need it again soon. This is especially true given that your
typical single ATA disk system will spin up the drive on its own
anyhow, so on systems with multiple scsi or ATA disks that explicitly
have been set to power up in standby, it is at least an even bet that
you won't be touching them all soon.
> You're forgetting that the same sd driver manages other types of
> devices than disk drives. Card readers and USB flash drives have
> no heads to retract and no spinning platters. They don't need
> START STOP commands (in fact, some of them probably would crash if
> they received such a command).
They are irrelevant since they ignore the command anyhow.
> Irrelevant, unless you are also claiming that all ATA disks always
> get powered on whenever the system resumes, something which is not
> at all evident to me. Particularly if the disk was in runtime
> suspend before the system went to sleep.
I'm saying that most do. It doesn't require 100% to be relevant.
There will also be plenty of disks at least for some time that are
still using the internal standby timer rather than runtime pm.
> Now I'm really getting confused. Here, you are saying that ATA
> disks will always spin up, all by themselves, whenever the system
> resumes, and there's nothing the kernel can do to prevent it. But
> earlier you wrote:
No, I'm saying some ( most in fact ) do, and some do not. Both cases
need to be handled. Runtime pm must not indicate the disk is
suspended when it spins up on its own after power on, which ATA disks
do by default. Oddly, the SCSI standard says that SCSI disks can be
configured behave this way as well rather than requiring an explicit
start command, though it doesn't say how and I've not heard of a way
to do this. I suppose this also applies to the USB flash drives and
SD card readers you mentioned that are managed by sd.
> Isn't this a contradiction? Or are you making a distinction
> between ATA and non-ATA disks?
What? I have some disk drives that I rarely access. I simply don't
want them starting up and spinning back down every time I resume. In
my case they are ATA with PuiS enabled, but it applies to SCSI the
same way.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iQEcBAEBCgAGBQJSzJItAAoJEI5FoCIzSKrwhCQIAIclA7u+FJ1PSZRYWcvFQg0B
n/WIupSCAXfiSo4uVZpC9m4W8TR9CawEorIPZGE+G/Hv+zRz3YKqA3OOuOQc1S5i
5IK019yY4EsOHsUK8RlBsgKu1bW0SdFsa73COzqT65bxNqUb5PUK5ed/Z1Kg7cTn
QM7jCMYz0wE7cqAQQ8eV56Y1Nolb6T3WmqKqoGl+qJj+IvebCuJ9vsYXf7MhSd9b
yb2Iq/ThR81vm68c6+KOFQkOkL3zPZ6QWCh5Xj4mRkvXtsd7htNKpxTkM7OC6azF
Z0I5xreArN9SQ8GLHtzB2Lrs+SzlMSvIE1HKQdieBcy//LImk8DajbddupJy7Bk=
=dYPC
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2014-01-07 23:48 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1384030893.git.psusi@ubuntu.com>
[not found] ` <1387236657-4852-1-git-send-email-psusi@ubuntu.com>
[not found] ` <52CA1191.8060804@ubuntu.com>
[not found] ` <52CA5CF4.2080708@codeaurora.org>
[not found] ` <52CA744F.2080609@intel.com>
[not found] ` <52CAC067.20601@ubuntu.com>
2014-01-07 7:49 ` REQ_PM vs REQ_TYPE_PM_RESUME 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 [this message]
2014-01-08 17:46 ` Alan Stern
2014-01-08 18:31 ` Alan Stern
2014-01-08 20:44 ` Allow runtime suspend during system resume Alan Stern
2014-01-08 21:17 ` Phillip Susi
2014-01-08 21:34 ` Alan Stern
2014-01-09 10:14 ` Ulf Hansson
2014-01-09 15:41 ` Alan Stern
2014-01-08 22:55 ` Rafael J. Wysocki
2014-01-08 23:24 ` Alan Stern
2014-01-09 0:05 ` Rafael J. Wysocki
2014-01-09 15:32 ` Alan Stern
2014-01-09 15:50 ` Phillip Susi
2014-01-09 16:08 ` Alan Stern
2014-01-09 16:30 ` Phillip Susi
2014-01-09 17:04 ` Alan Stern
2014-01-10 1:25 ` Rafael J. Wysocki
2014-01-10 1:55 ` Phillip Susi
2014-01-10 13:35 ` Rafael J. Wysocki
2014-01-10 14:46 ` Phillip Susi
2014-01-10 15:25 ` Alan Stern
2014-01-10 23:02 ` Rafael J. Wysocki
2014-01-11 2:08 ` Phillip Susi
2014-01-11 22:50 ` Alan Stern
2014-01-12 1:50 ` Phillip Susi
2014-01-11 22:34 ` Alan Stern
2014-01-08 20:20 ` REQ_PM vs REQ_TYPE_PM_RESUME 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
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=52CC922D.9070208@ubuntu.com \
--to=psusi@ubuntu.com \
--cc=JBottomley@parallels.com \
--cc=aaron.lu@intel.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--cc=stern@rowland.harvard.edu \
--cc=sthumma@codeaurora.org \
--cc=tj@kernel.org \
--cc=todd.e.brandt@linux.intel.com \
/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).