[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: ktempfile
From:       Lubos Lunak <l.lunak () suse ! cz>
Date:       2007-10-17 16:52:55
Message-ID: 200710171852.55513.l.lunak () suse ! cz
[Download RAW message or body]

On Wednesday 17 of October 2007, Thiago Macieira wrote:
> Em Wednesday 17 October 2007 16:58:07 Jos Poortvliet escreveu:
> > > > Of course. But not for visiting a webpage, right?
> > >
> > > History is modified.
> >
> > So, do you think that has to sync (twice), or not?
>
> I think it has to tell the kernel to save to disk whenever a config file is
> changed.
>
> It's too bad that the kernel syncs the entire disk cache whenever we have
> to sync one file. So, for people who understand this: would fsync(2) or
> fsyncdata(2) help?

 Note that I'm not one of those people, but I vaguely remember hearing about 
the effects of disk syncing during KDE startup (I think it was one of Coolo's 
analysing of KDE/openSUSE startup, but I'm not sure). IIRC the cost of one 
sync was pretty big. With a journaling filesystem, i.e. pretty much for 
everybody today, each sync, even "just for one file", leads to writting also 
the journal, which means you have to sync everything anyway. Also, from 'man 
fsync' : "The call blocks until the device reports that the transfer has 
completed."

 I'll try to find out more from people who should know to confirm this.

 So, in short, syncs are pretty expensive and IMHO we should avoid them unless 
really really necessary.

 And, from other mail:
> It's either that or live with all those emails about "my config got
> corrupted when the power went out".

 Thinking of this, how should this actually happen, in practice? Config files 
are written first to a temporary file and this file gets renamed to the 
original name, atomically replacing the old file. How exactly should it 
happen that the original file gets destroyed but the new file doesn't manage 
to replace it properly?

 As I said, I'm not an expert, so I'm not entirely sure the sync really is not 
needed for some obscure reason, but needing it doesn't quite make sense. 
Again, I think I'll need to check here.

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak@suse.cz , l.lunak@kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic