Discussion:
HDDs and buffered I/O
Christopher Svanefalk
2011-11-02 08:32:18 UTC
Permalink
Dear all,

it seems one of the biggest culprits in laptop power consumption is HDD
spinup/spindown issues. On my HP Probook 4510s, the HDD is hot most of the
time, and battery does not last very long at all.

I am running Fedora 16 (Beta), and am using the 1.98 with all tunables set
to 'good'. It does help I think, but I would like to take it further..so
the question is this: does anyone know if there is a way to make the kernel
buffer I/0 operations and make them run as batch operations on a set
schedule? In other words, can I force the system to use working memory as
much as possible, and only physically access the HDD when I explicitly
allow it to?

I am aware this might not be ideal for some workflows, but I would be very
happy to experiment with it. Can it be done?

Thanks in advance!

Best,

Chris
Kevin Hunter
2011-11-03 15:02:02 UTC
Permalink
Post by Christopher Svanefalk
it seems one of the biggest culprits in laptop power consumption is
HDD spinup/spindown issues.
does anyone know if there is a way to make the kernel buffer I/0
operations and make them run as batch operations on a set schedule?
In other words, can I force the system to use working memory as much
as possible, and only physically access the HDD when I explicitly
allow it to?
Oh man would I love to have something like this, but alas, my kernel
hacking skills ... well, they're lacking. I had approximated something
like this about 2 years ago, by setting my various file system commit
parameters to 5 or 10 minutes in /etc/fstab, and by running another
daemon, the name of which I've now forgotten. It did not work very
well, because the HDD would spin down after a minute or so of
inactivity, but would fire up again about 30 seconds later, likely due
to some program or kernel process requesting an fsync(). Even in areas
of no activity, like sitting there while I worked with pen and paper on
some non-computer related problem.

I never got farther than that or I'd've written about it. I would
really appreciate the results anyone else may be able create. So, to
(not) answer your question of "Can it be done?", I don't know. I hope so.

Cheers,

Kevin
Luke Scharf
2011-11-03 16:09:38 UTC
Permalink
Why not just use an SSD? They're expensive, but they're very efficient and
very fast.

-Luke
Post by Christopher Svanefalk
Post by Christopher Svanefalk
it seems one of the biggest culprits in laptop power consumption is
HDD spinup/spindown issues.
does anyone know if there is a way to make the kernel buffer I/0
Post by Christopher Svanefalk
operations and make them run as batch operations on a set schedule?
In other words, can I force the system to use working memory as much
as possible, and only physically access the HDD when I explicitly
allow it to?
Oh man would I love to have something like this, but alas, my kernel
hacking skills ... well, they're lacking. I had approximated something
like this about 2 years ago, by setting my various file system commit
parameters to 5 or 10 minutes in /etc/fstab, and by running another daemon,
the name of which I've now forgotten. It did not work very well, because
the HDD would spin down after a minute or so of inactivity, but would fire
up again about 30 seconds later, likely due to some program or kernel
process requesting an fsync(). Even in areas of no activity, like sitting
there while I worked with pen and paper on some non-computer related
problem.
I never got farther than that or I'd've written about it. I would really
appreciate the results anyone else may be able create. So, to (not) answer
your question of "Can it be done?", I don't know. I hope so.
Cheers,
Kevin
______________________________**_________________
Discuss mailing list
http://lists.lesswatts.org/**listinfo/discuss<http://lists.lesswatts.org/listinfo/discuss>
Christopher Svanefalk
2011-11-03 16:38:12 UTC
Permalink
Kevin - "expensive" is the keyword, I'm a poor student ;)

Luke - actually, I think laptop_mode is supposed to do something like that (
http://samwel.tk/laptop_mode/), but it does not seem to be working on my
machine at the moment.
Post by Luke Scharf
Why not just use an SSD? They're expensive, but they're very efficient
and very fast.
-Luke
Post by Christopher Svanefalk
Post by Christopher Svanefalk
it seems one of the biggest culprits in laptop power consumption is
HDD spinup/spindown issues.
does anyone know if there is a way to make the kernel buffer I/0
Post by Christopher Svanefalk
operations and make them run as batch operations on a set schedule?
In other words, can I force the system to use working memory as much
as possible, and only physically access the HDD when I explicitly
allow it to?
Oh man would I love to have something like this, but alas, my kernel
hacking skills ... well, they're lacking. I had approximated something
like this about 2 years ago, by setting my various file system commit
parameters to 5 or 10 minutes in /etc/fstab, and by running another daemon,
the name of which I've now forgotten. It did not work very well, because
the HDD would spin down after a minute or so of inactivity, but would fire
up again about 30 seconds later, likely due to some program or kernel
process requesting an fsync(). Even in areas of no activity, like sitting
there while I worked with pen and paper on some non-computer related
problem.
I never got farther than that or I'd've written about it. I would really
appreciate the results anyone else may be able create. So, to (not) answer
your question of "Can it be done?", I don't know. I hope so.
Cheers,
Kevin
______________________________**_________________
Discuss mailing list
http://lists.lesswatts.org/**listinfo/discuss<http://lists.lesswatts.org/listinfo/discuss>
Ritesh Raj Sarraf
2012-01-11 13:39:55 UTC
Permalink
Post by Christopher Svanefalk
Kevin - "expensive" is the keyword, I'm a poor student ;)
Luke - actually, I think laptop_mode is supposed to do something
like that (http://samwel.tk/laptop_mode/), but it does not seem to
be working on my machine at the moment.
It should work. Try to set the LM_BATT_MAX_LOST_WORK_SECONDS= to a
large value. In my case, I set it to 600 seconds.

For ext3, LMT took care of remounting the file system. With ext4, you
don't have that many trouble.

But if there still are (buggy) apps, its unfortunate. There very less
LMT or the kernel can do. For such scenarios, you can use eatmydata.


Ritesh

- --
Given the large number of mailing lists I follow, I request you to CC me
in replies for quicker response

Kevin Hunter
2011-11-03 18:53:52 UTC
Permalink
Post by Luke Scharf
Why not just use an SSD? They're expensive, but they're very
efficient and very fast.
Bingo. Expensive. Which means that for some time until they really hit
a critical price point, there is need for code that plays nice with
spinning devices.

Kevin
Luke Scharf
2011-11-03 19:14:45 UTC
Permalink
Post by Kevin Hunter
Post by Luke Scharf
Why not just use an SSD? They're expensive, but they're very
efficient and very fast.
Bingo. Expensive. Which means that for some time until they really
hit a critical price point, there is need for code that plays nice
with spinning devices.
I agree.

But, since I'm thrilled with the blazing fast SSD that I have in my
laptop, I want to make sure that the pro-SSD argument is made correctly.

A 60GB root-disk can be had for around $120. That is quite expensive
for 60GB, but in terms of dollars, it's within the envelope of what
normal person would spend on a hard drive. If his storage needs can fit
within 60GB, though, then an SSD may be less out of reach than it first
appears.

Also, there's a big benefit to a device that can deliver data at a
couple of hundred mb/sec, while using less than 2 watts, with an idle
power consumption that's well under a watt. Despite the cost, this
seems like a way to go straight to the finish line, in terms of efficiency.

But, if he needs efficiency AND the ability to store several hundred GB
worth data AND price is a big concern, and these are all probably true
in his case, then a big laptop hard drive with the software tweaks that
we're talking about does make a LOT of sense.

-Luke

P.S. (My office-mate and I have had a protracted version of this
discussion, except that he wants a disk controller that will put the
bulk of the data on spinning disk and cache a few dozen GB on Flash or
in RAM for his desktop. The difference is that he has a large movie
collection, and I do not -- so our need for bulk-storage is quite
different, and we choose different solutions accordingly.)
Tiago Marques
2011-11-03 23:20:53 UTC
Permalink
Hi all,

That an SSD is a solution is not always correct. Some SSDs idle at a higher
power consumption than 2.5" HDDs. Performance is obviously better on drives
with good random read write.

Best regards,
Tiago
Post by Luke Scharf
Post by Kevin Hunter
Post by Luke Scharf
Why not just use an SSD? They're expensive, but they're very
efficient and very fast.
Bingo. Expensive. Which means that for some time until they really
hit a critical price point, there is need for code that plays nice
with spinning devices.
I agree.
But, since I'm thrilled with the blazing fast SSD that I have in my
laptop, I want to make sure that the pro-SSD argument is made correctly.
A 60GB root-disk can be had for around $120. That is quite expensive
for 60GB, but in terms of dollars, it's within the envelope of what
normal person would spend on a hard drive. If his storage needs can fit
within 60GB, though, then an SSD may be less out of reach than it first
appears.
Also, there's a big benefit to a device that can deliver data at a
couple of hundred mb/sec, while using less than 2 watts, with an idle
power consumption that's well under a watt. Despite the cost, this
seems like a way to go straight to the finish line, in terms of efficiency.
But, if he needs efficiency AND the ability to store several hundred GB
worth data AND price is a big concern, and these are all probably true
in his case, then a big laptop hard drive with the software tweaks that
we're talking about does make a LOT of sense.
-Luke
P.S. (My office-mate and I have had a protracted version of this
discussion, except that he wants a disk controller that will put the
bulk of the data on spinning disk and cache a few dozen GB on Flash or
in RAM for his desktop. The difference is that he has a large movie
collection, and I do not -- so our need for bulk-storage is quite
different, and we choose different solutions accordingly.)
_______________________________________________
Discuss mailing list
http://lists.lesswatts.org/listinfo/discuss
David Rees
2011-11-07 19:58:10 UTC
Permalink
Why not just use an SSD?  They're expensive, but they're very
efficient and very fast.
Bingo.  Expensive.  Which means that for some time until they really
hit a critical price point, there is need for code that plays nice
with spinning devices.
A 60GB root-disk can be had for around $120.  That is quite expensive
for 60GB, but in terms of dollars, it's within the envelope of what
normal person would spend on a hard drive.  If his storage needs can fit
within 60GB, though, then an SSD may be less out of reach than it first
appears.
There are a few SSDs significantly cheaper than that after rebates.
For example, the Vertex Plus can be had for about $1/GB after rebate
these days and are about $1.50/GB before rebate. Numerous other
drives are around $1.50/GB.

Getting harder and harder to argue about price unless you really need
a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.

-Dave
Kevin Hunter
2011-11-07 23:27:21 UTC
Permalink
Post by David Rees
A 60GB root-disk can be had for around $120. That is quite
expensive for 60GB, but in terms of dollars, it's within the
envelope of what normal person would spend on a hard drive. If his
storage needs can fit within 60GB, though, then an SSD may be less
out of reach than it first appears.
There are a few SSDs significantly cheaper than that after rebates.
For example, the Vertex Plus can be had for about $1/GB after rebate
these days and are about $1.50/GB before rebate. Numerous other
drives are around $1.50/GB.
Getting harder and harder to argue about price unless you really
need a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.
I hear your argument, but I respectfully disagree. Relative price will
for some time yet dictate the majority of installs. For embedded
solutions, low-end desktops, and laptops (e.g. the kind that often go to
students, schools, and lower income families) relative price is /the/
argument. Until SSDs are, say, 2/3 [1] or more of the market share (and
are actually /equivalent/ in price per GB), there will still be at least
1/3 of the drives with rotating media. With that large a fraction of
such a large number, there is yet need for code to effectively manage
rotating media for power consumption.

Will we ever get that code? I doubt it. We've "limped" along so far,
and I imagine that the 4+ years until the "end" of rotating media
doesn't seem so far away. Would that I had the skill to hack the
kernel, or power projects would absolutely be where I put my free time.

Kevin

[1] Yes, I pulled that number from my b***, but the overall point stands.
Christopher Svanefalk
2011-11-07 23:33:13 UTC
Permalink
@Kevin: laptop_mode does a good job at managing HD power, mainly by
handling spindowns:

http://samwel.tk/laptop_mode/

However, it has some serious issues, prominently that fsync() and similar
calls cause the HD to spin up again...and HDs that spin up tend to die
eventually.

I do believe SDDs are the way to go, but personally I think I will wait a
year or two before I make a serious investment.
Post by Kevin Hunter
A 60GB root-disk can be had for around $120. That is quite
expensive for 60GB, but in terms of dollars, it's within the
envelope of what normal person would spend on a hard drive. If his
storage needs can fit within 60GB, though, then an SSD may be less
out of reach than it first appears.
There are a few SSDs significantly cheaper than that after rebates.
For example, the Vertex Plus can be had for about $1/GB after rebate
these days and are about $1.50/GB before rebate. Numerous other
drives are around $1.50/GB.
Getting harder and harder to argue about price unless you really
need a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.
I hear your argument, but I respectfully disagree. Relative price will
for some time yet dictate the majority of installs. For embedded
solutions, low-end desktops, and laptops (e.g. the kind that often go to
students, schools, and lower income families) relative price is /the/
argument. Until SSDs are, say, 2/3 [1] or more of the market share (and
are actually /equivalent/ in price per GB), there will still be at least
1/3 of the drives with rotating media. With that large a fraction of such
a large number, there is yet need for code to effectively manage rotating
media for power consumption.
Will we ever get that code? I doubt it. We've "limped" along so far, and
I imagine that the 4+ years until the "end" of rotating media doesn't seem
so far away. Would that I had the skill to hack the kernel, or power
projects would absolutely be where I put my free time.
Kevin
[1] Yes, I pulled that number from my b***, but the overall point stands.
______________________________**_________________
Discuss mailing list
http://lists.lesswatts.org/**listinfo/discuss<http://lists.lesswatts.org/listinfo/discuss>
Kevin Hunter
2011-11-08 19:48:43 UTC
Permalink
Post by Christopher Svanefalk
@Kevin: laptop_mode does a good job at managing HD power, mainly by
http://samwel.tk/laptop_mode/
Yes, I've tried it, and had exactly the fsync() issues you've
identified. I ended up using more power for it because I was never able
to fine-tune it well-enough for any of my installs.

Thanks for the input,

Kevin
David Rees
2011-11-08 00:22:15 UTC
Permalink
Post by David Rees
A 60GB root-disk can be had for around $120. That is quite
expensive for 60GB, but in terms of dollars, it's within the
envelope of what normal person would spend on a hard drive. If his
storage needs can fit within 60GB, though, then an SSD may be less
out of reach than it first appears.
There are a few SSDs significantly cheaper than that after rebates.
For example, the Vertex Plus can be had for about $1/GB after rebate
these days and are about $1.50/GB before rebate. Numerous other
drives are around $1.50/GB.
Getting harder and harder to argue about price unless you really
need a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.
I hear your argument, but I respectfully disagree.  Relative price will for
some time yet dictate the majority of installs.  For embedded solutions,
low-end desktops, and laptops (e.g. the kind that often go to students,
schools, and lower income families) relative price is /the/ argument.
The cheapest notebook rotating drives are around $90 unless you get a
refurb or something. This gets you 250GB of storage.

For $65 you can get a 60GB SSD. (For a few bucks less you can get a 32 GB SSD).

Seems to me that SSDs are ultimately cheaper right now than rotating
disks for you application unless you need the space. Of course - the
flooding in Thailand has likely inflated these prices, but I have no
idea what a notebook drive cost before the floods.
Until
SSDs are, say, 2/3 [1] or more of the market share (and are actually
/equivalent/ in price per GB), there will still be at least 1/3 of the
drives with rotating media.  With that large a fraction of such a large
number, there is yet need for code to effectively manage rotating media for
power consumption.
SSDs will very likely _never_ reach the same price as rotating disks per GB.
Will we ever get that code?  I doubt it.  We've "limped" along so far, and I
imagine that the 4+ years until the "end" of rotating media doesn't seem so
far away.  Would that I had the skill to hack the kernel, or power projects
would absolutely be where I put my free time.
That's just another reason to use SSDs whenever you don't need the
storage space. Really, I have found that 60-80GB is more than enough
for the majority of uses - only reason to need more is if you have a
LOT of photos or are doing anything with video.

-Dave
Christopher Svanefalk
2011-11-08 08:09:22 UTC
Permalink
Realized I already brought up laptop_mode, sorry for the repetition.

I'm wondering though - how do SSDs square against standard drives when it
comes to heat? Does an SSD under normal conditions get hotter than an
ordinary drive under the same conditions?
Post by David Rees
Post by Kevin Hunter
Post by David Rees
A 60GB root-disk can be had for around $120. That is quite
expensive for 60GB, but in terms of dollars, it's within the
envelope of what normal person would spend on a hard drive. If his
storage needs can fit within 60GB, though, then an SSD may be less
out of reach than it first appears.
There are a few SSDs significantly cheaper than that after rebates.
For example, the Vertex Plus can be had for about $1/GB after rebate
these days and are about $1.50/GB before rebate. Numerous other
drives are around $1.50/GB.
Getting harder and harder to argue about price unless you really
need a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.
I hear your argument, but I respectfully disagree. Relative price will
for
Post by Kevin Hunter
some time yet dictate the majority of installs. For embedded solutions,
low-end desktops, and laptops (e.g. the kind that often go to students,
schools, and lower income families) relative price is /the/ argument.
The cheapest notebook rotating drives are around $90 unless you get a
refurb or something. This gets you 250GB of storage.
For $65 you can get a 60GB SSD. (For a few bucks less you can get a 32 GB SSD).
Seems to me that SSDs are ultimately cheaper right now than rotating
disks for you application unless you need the space. Of course - the
flooding in Thailand has likely inflated these prices, but I have no
idea what a notebook drive cost before the floods.
Post by Kevin Hunter
Until
SSDs are, say, 2/3 [1] or more of the market share (and are actually
/equivalent/ in price per GB), there will still be at least 1/3 of the
drives with rotating media. With that large a fraction of such a large
number, there is yet need for code to effectively manage rotating media
for
Post by Kevin Hunter
power consumption.
SSDs will very likely _never_ reach the same price as rotating disks per GB.
Post by Kevin Hunter
Will we ever get that code? I doubt it. We've "limped" along so far,
and I
Post by Kevin Hunter
imagine that the 4+ years until the "end" of rotating media doesn't seem
so
Post by Kevin Hunter
far away. Would that I had the skill to hack the kernel, or power
projects
Post by Kevin Hunter
would absolutely be where I put my free time.
That's just another reason to use SSDs whenever you don't need the
storage space. Really, I have found that 60-80GB is more than enough
for the majority of uses - only reason to need more is if you have a
LOT of photos or are doing anything with video.
-Dave
_______________________________________________
Discuss mailing list
http://lists.lesswatts.org/listinfo/discuss
Arjan van de Ven
2011-11-08 14:14:21 UTC
Permalink
Post by Christopher Svanefalk
Realized I already brought up laptop_mode, sorry for the
repetition.
I'm wondering though - how do SSDs square against standard drives
when it comes to heat? Does an SSD under normal conditions get
hotter than an ordinary drive under the same conditions?
the SSDs I've worked with (which are obviously kick ass ;-) ) use less
power (and get less hot) under load than disks do.
There's something about having to spin some rust at 5000+ RPM and move
a mechanical arm around that costs power like no tomorrow compared
to moving a few electrons around in nand flash....
Christopher Svanefalk
2011-11-08 14:33:25 UTC
Permalink
Brand and model for those SSDs maybe? :) I might perhaps give it an early
start after all.
Post by Arjan van de Ven
Post by Christopher Svanefalk
Realized I already brought up laptop_mode, sorry for the
repetition.
I'm wondering though - how do SSDs square against standard drives
when it comes to heat? Does an SSD under normal conditions get
hotter than an ordinary drive under the same conditions?
the SSDs I've worked with (which are obviously kick ass ;-) ) use less
power (and get less hot) under load than disks do.
There's something about having to spin some rust at 5000+ RPM and move
a mechanical arm around that costs power like no tomorrow compared
to moving a few electrons around in nand flash....
Kevin Hunter
2011-11-08 20:00:48 UTC
Permalink
Post by David Rees
Post by David Rees
Getting harder and harder to argue about price unless you really
need a lot of storage, in which case you'll use 2 drives - SSD for
OS/apps/home and big slow cheap rotating disk for media/backups, etc.
I hear your argument, but I respectfully disagree. Relative price will for
some time yet dictate the majority of installs. For embedded solutions,
low-end desktops, and laptops (e.g. the kind that often go to students,
schools, and lower income families) relative price is /the/ argument.
The cheapest notebook rotating drives are around $90 unless you get a
refurb or something. This gets you 250GB of storage.
For $65 you can get a 60GB SSD. (For a few bucks less you can get a
32GB SSD).
Again, I disagree. Think low-end computers. SSDs won't really enter
that market for another 2+ years yet, and won't have completely
saturated it for at least 4+ years.
Post by David Rees
Seems to me that SSDs are ultimately cheaper right now than rotating
disks for you application unless you need the space. Of course - the
flooding in Thailand has likely inflated these prices, but I have no
idea what a notebook drive cost before the floods.
Until SSDs are, say, 2/3 [1] or more of the market share (and are
actually /equivalent/ in price per GB), there will still be at
least 1/3 of the drives with rotating media. With that large a
fraction of such a large number, there is yet need for code to
effectively manage rotating media for power consumption.
SSDs will very likely _never_ reach the same price as rotating disks per GB.
Perhaps not, but the larger point I'm trying to make is that as long as
there is a large install base of rotating media, there is need for the
code. I'm suggesting that when the price gets (okay, "close enough" to)
equivalent is /when/ that will happen, but we aren't there yet and I
suspect we won't be there for at least 4+ years.
Post by David Rees
Will we ever get that code? I doubt it. We've "limped" along so far, and I
imagine that the 4+ years until the "end" of rotating media doesn't seem so
far away. Would that I had the skill to hack the kernel, or power projects
would absolutely be where I put my free time.
That's just another reason to use SSDs whenever you don't need the
storage space. Really, I have found that 60-80GB is more than enough
for the majority of uses - only reason to need more is if you have a
LOT of photos or are doing anything with video.
Which may be the difference in our (independently informed) opinions.
I'm talking about folks other than you, folks who /do/ have rotating
media, _and_ a need for it. I'm one of those folks, and I suspect that
if I'm not in the majority, then I'm still a large minority.

Kevin
Loading...