[pacman-dev] [PATCH] libalpm: sync changes to disc when appropriate

Dan McGee dpmcgee at gmail.com
Sat Mar 14 01:24:37 EDT 2009

On Fri, Mar 13, 2009 at 9:55 PM, Allan McRae <allan at archlinux.org> wrote:
> Dan McGee wrote:
>> We don't make calls to fsync() or fdatasync() when we are attempting to do
>> something transactionally, such as writing out one of our DB entries. Add
>> a
>> call to fdatasync() when we write DB entries, and also ensure we sync our
>> log changes to disc whenever we close it.
>> Another important thing to ensure is that we commit removals of DB
>> entries.
>> The method isn't necessarily pretty, but it works in _alpm_db_remove().
> This looks good to me.
> Just wonding how much overhead the fsyncing adds? Have you noticed any speed
> decrease when running with this patch? Not that there is much choice here...

Little if any, actually, as we are syncing only our DB files and not
all of the files we lay down on disk. For the most part pacman is
already I/O bound, so this doesn't add any noticeable hiccups.


More information about the pacman-dev mailing list