Re: [rfc] Ignore Fsync Calls in Laptop_Mode
From: D. Jansen
Date: Mon May 30 2011 - 17:24:48 EST
On Mon, May 30, 2011 at 10:53 PM, <david@xxxxxxx> wrote:
> On Mon, 30 May 2011, D. Jansen wrote:
>
>> On Mon, May 30, 2011 at 8:45 PM, Â<david@xxxxxxx> wrote:
>>>
>>>
>>> the problem is that most users don't know what their system is running,
>>> or
>>> what effect disaling fsync would have. those that do can probably use
>>> LD_PRELOAD to override fsync calls.
>>
>> As we found out, they can't. But if we export barrier, I hope a
>> library could wrap fsyncs into barriers. Is that the case?
>
> a library can wrap fsync into anything.
>
>>>
>>> it doesn't take running a mail server, even a mail client will have the
>>> same
>>> risk. If you use POP for mail (a very common option) then you download
>>> messages and tell the server to delete them. if you do not really save
>>> them
>>> (one fsync after they are all saved), then you can loose everything that
>>> you
>>> downloaded.
>>
>> Yes, I know. It's the same argument again and again. I understand not
>> everybody wants this. But some do. Some prefer working 10-20% longer
>> on battery (certainty) instead of possibly losing 5 % data
>> (possibility) or losing all your data (possibility if you use laptop
>> mode and the hard disk wakes up again and again and eventually wears
>> out).
>
> those are some powerful numbers you are throwing around, can you back them
> up?
Yes. My netbook uses 4.8 W with hard disk off. 0.5 W more with hard
disk on. A lot of the time, the display is off and the power
consumption drops to about 3.5 W. I don't know how I got to 20 % atm.
I can only do this if fsync is disabled. I tried before, but it would
go on for every write. It died, very prematurely.
>
> do you really have so many fsync's going on that the disk spins up so much
> that you would gain 10-20% battery life?
Yes. Every autosave in LibreOffice triggers one. And I want autosave,
but I want them in memory, not on disk.
>
> and what makes you think the extra spin-ups from fsyncs will cause your hard
> drive to fail significantly earlier? (if you have a hard drive with a
> limited number of spin-up cycles, you probably don't want to use laptop mode
> at all)
Experience, see above. Also, this is well described behavior. All hard
disks are only designed to last a certain number of head loads and
unloads. Spinning up and down even less.
>
> why do you think it's a possibility of loosing only 5% of data?
Well, it really depends on the way your configure laptop mode. But in
my case the laptop mode window is 20 minutes, the run time then is
about 10-12 hrs. I can actually lose less than 5 % of the data created
during the battery run time. It's a certain 1-1.5 hours (10-15 %) more
work or a possible 20 mins (3.3 % actually) loss of work. I think it's
a good deal.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/