xfs
[Top] [All Lists]

Re: [patch 2/2] From: Bart Samwel <bart@samwel.tk>

To: bart@xxxxxxxxx
Subject: Re: [patch 2/2] From: Bart Samwel <bart@samwel.tk>
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 5 Apr 2004 08:46:28 +0100
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <E1B9lJn-0001Sz-Cj@samwel.tk>; from bart@samwel.tk on Sat, Apr 03, 2004 at 03:36:15PM +0200
References: <E1B9lJn-0001Sz-Cj@samwel.tk>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5.1i
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?


<Prev in Thread] Current Thread [Next in Thread>