Re: Memory filesystems

From: Andreas Dilger (adilger@turbolabs.com)
Date: Sun May 28 2000 - 13:07:39 EST


Warren Young writes:
> The logic goes, because Linux's buffer cache is so aggressive, temporaries
> spend their entire lives in memory anyway.
>
> Well, something occurred to me just now: wouldn't journalling wreck this
> pretty picture? With journalling, all disk writes have to go
> immediately to the disk instead of waiting in memory until the kernel
> gets bored and flushes buffers to disk.
>
> I suppose you could write a JFS that still was lazy about flushing
> buffers, but it then you only gain disk coherency from the JFS. Such a
> JFS could obey the "-o sync" mount option and use lazy buffer flushing
> only when the option isn't given.

Actually ext3/jfs does exactly what you suggest - it uses lazy commits
of the journal to disk, but honors the O_SYNC flag and does an immediate
flush to disk in this case. In the normal case, ext3 does not guarantee
that no data is lost at the time of a crash, but only that the filesystem
metadata is consistent (i.e. no need for e2fsck).

The actual performance hit isn't so bad, since rather than writing
data all over the disk (like a normal filesystem often does), it is
a big sequential write to the journal. The movement of the data from
the journal to its correct place on disk is handled in an asynchronous
manner, since if it is interrupted, it can be re-done at recovery time
without any worries.

Moving the data twice does mean that data gets copied twice, and on a
very busy filesystem this would be a performance impact. Stephen has
said that in a future release it will be possible to journal to a separate
device (maybe a solid-state disk), which will eliminate the extra activity
in the original filesystem (although there will still be twice as many
write operations).

> Just some thoughts,

Good ones, but as with most things in Linux, it's already been done...

Cheers, Andreas

-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:19 EST