Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Nov 2006 11:36:52 -0800
From:      Chuck Swiger <cswiger@mac.com>
To:        Kevin Oberman <oberman@es.net>
Cc:        FreeBSD Stable <freebsd-stable@FreeBSD.ORG>
Subject:   Re: Problems unmounting/fssyncking extern UFS filesystem
Message-ID:  <B3594EAF-0C9F-4FB6-9076-522406A05761@mac.com>
In-Reply-To: <20061127164119.E63DB45054@ptavv.es.net>
References:  <20061127164119.E63DB45054@ptavv.es.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Nov 27, 2006, at 8:41 AM, Kevin Oberman wrote:
>> As far as I know, that's not different from calling "sync"
>> just once.  It might make more sense to put a little sleep
>> between the sync calls, though.
>
> The traditional mantra was
> sync
> sync
> sync
> and not sync;sync;sync. The reason was timing. By entering the sync
> command three times as fast as anyone could type, the sync could
> reliably complete.

Agreed.  Although I've heard rumors that some systems treated 3 syncs  
as some sort of special case, but I've never seen anything in code to  
support the notion.

> That mantra is about 25 years old, so its validity on modern  
> hardware is
> questionable, but the need for a delay is very real. I would suggest
> something like: sync && sleep 5

The other choice would be to make sync [or the sync(2) system call,  
more precisely] blocking, so that it does not return until the buffer  
cache has been flushed and all dirty pages in VM have been written to  
disk.

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?B3594EAF-0C9F-4FB6-9076-522406A05761>