lkml.org 
[lkml]   [2011]   [May]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [rfc] Ignore Fsync Calls in Laptop_Mode
> Problem: laptop_mode wants to keep applications from waking the hard
> disks but fsync calls can "sneak through". (IMHO this is a bug.)

Its a standards requirement and thing many apps rely on. Also you can do
it perfectly well in user space for all apps. Thats why you can
preconfigure preloads and it's why you have glic library source code!

> Proposed solution: Pretend the fsync was executed and successful.
> Insert two lines into the fsync and fdatasync calls in fs/sync.c:
> if (unlikely(laptop_mode))
> return 0;

Whoops you've just risked corrupting any app which relies on fsync for
ordering if there is a crash.

> "This is not necessary with SSDs"
> I'm not sure, but I think that SSDs will also keep an active SATA
> connection if you write to them all the time. They also have standby

On SSD the impact is miniscule as far as I can tell. A graph would tell
you more.

The "right" way to do this is more complicated by far. An fsync is an
ordering guarantee so you need to implement that ordering guarantee even
if you don't force writes to physical media. That at least cuts down most
failures (but not all - eg commits with a network component such as email
receives)

Anyway you can do it in userspace trivially if you want.


\
 
 \ /
  Last update: 2011-05-19 15:45    [W:0.177 / U:1.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site