On Sat, Apr 03, 2004 at 03:36:15PM +0200, bart@xxxxxxxxx wrote:
>
>
> The XFS sync daemon is responsible for periodically syncing an XFS filesystem.
> The problem: in laptop mode, this can kick in at any time and spin up the
> disk,
> even when there is no other reason to do so.
>
> This patch wakes up the XFS sync daemon whenever an XFS syncfs takes place
> (e.g.,
> at sys_sync()) so that it does its job and then sleeps for as long as it can.
> It
> does so only when laptop mode is active. Laptop mode calls sys_sync() to
> perform a writeback just before the disk is spun down, so the XFS sync daemon
> will
> be woken up just before the disk is spun down as well, and after that it will
> leave
> the disk alone for a full lm_sync_interval.
>
> The patch also exports symbol laptop_mode, so that XFS can still be compiled
> as a
> module.
The idea behind this changes looks good, but I really dislike the way you
implemented it. What about something like the following inside
linvfs_sync_super instead of the current code?
if (unlikely(laptop_mode))
VFS_SYNC(vfsp, SYNCD_FLAGS, NULL, error);
this doesn't restart the sync sleep interval, but if it's large enough that
shouldn't matter, should it?
|