xfs
[Top] [All Lists]

Re: [patch 2/2] From: Bart Samwel <bart@xxxxxxxxx>

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [patch 2/2] From: Bart Samwel <bart@xxxxxxxxx>
From: Bart Samwel <bart@xxxxxxxxx>
Date: Mon, 05 Apr 2004 10:26:58 +0200
Cc: linux-xfs@xxxxxxxxxxx
In-reply-to: <20040405084628.C2647@xxxxxxxxxxxxx>
References: <E1B9lJn-0001Sz-Cj@xxxxxxxxx> <20040405084628.C2647@xxxxxxxxxxxxx>
Sender: linux-xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6) Gecko/20040113

Christoph Hellwig wrote:

> 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?

It shouldn't, except that the whole point of the exercise is to restart 
the sync sleep interval, not to sync anything. ;) The problem with not 
having any synchronization between the laptop mode syncs and the 
xfssyncd is that the xfssyncd may wake up in the middle of a spun-down 
interval, and spin up the disk. Only restarting the sync sleep interval 
can solve that problem. :( Making the sync interval "large enough" would 
mean putting it at 6 hours or something, because then it wouldn't sync 
at all during any meaningful battery life of a laptop. If it's any lower 
than that, we get spurious spinups. And 6 hours may be just too long -- 
even in laptop mode, we _want_ forced syncs every now and then. For 
instance, we also increase the kupdate interval to (by default) 10 
minutes, and my gut says the xfs sync sleep interval should be the same. 
What do you think?

--Bart


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