Re: Linux 2.6.29

From: Kyle Moffett
Date: Wed Mar 25 2009 - 22:54:20 EST


On Wed, Mar 25, 2009 at 10:47 PM, Matthew Garrett <mjg59@xxxxxxxxxxxxx> wrote:
> On Wed, Mar 25, 2009 at 10:44:44PM -0400, Kyle Moffett wrote:
>
>> Â ÂPerhaps we ought to add a couple extra open flags, O_BARRIER_BEFORE and
>> Â ÂO_BARRIER_AFTER, and rename3(), etc functions that take flags arguments?
>> Â ÂOr maybe a new set of syscalls like barrier(file1, file2) and
>> Â Âfbarrier(fd1, fd2), which cause all pending changes (perhaps limit to this
>> Â Âprocess?) to the file at fd1 to occur before any successive changes (again
>> Â Âlimited to this process?) to the file at fd2.
>
> That's an option, but what would benefit? If rename is expected to
> preserve ordering (which I think it has to, in order to avoid breaking
> existing code) then are there any other interesting use cases?

The use cases would be programs like GIT (or any other kind of
database) where you want to ensure that your new pulled packfile has
fully hit disk before the ref update does. If that ordering
constraint is applied, then we don't really care when we crash,
because either we have a partial packfile update (and we have to pull
again) or we have the whole thing. The rename() barrier would ensure
that we either have the old ref or the new ref, but it would not check
to ensure that the whole packfile is on disk yet.

I would imagine that databases like MySQL could also use such support
to help speed up their database transaction support, instead of having
to run a bunch of threads which fsync() and buffer data internally.

Cheers,
Kyle Moffett
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/