RE: safe file systems

Chel van Gennip (linux@vangennip.nl)
Wed, 24 Sep 1997 23:25:49 +0100 (WETDST)


Larry McVoy <lm@linux.cobaltmicro.com> wrote:

>Do you think it would be possible to build a safe, slow file system?
>By safe, I mean that I could hit reset in the middle of 50 parallel
>un-tars and reboot the system and the file system comes up clean (no fsck,
>but data loss)?
>
>Has anyone thought about this very much? If so, is there a mailing list or
>archive that I can browse?

There has been some discussion on journaling filesystems, but nothing is
available yet.
Pointers on the subject are in:
http://sunsite.unc.edu/pub/Linux/ALPHA/linux-ha/High-Availability-HOWTO.html

For the time being the filesystem can be tuned by changing buffermanagement
parameters.
Parameters are in /usr/src/linux/fs/buffer.c :
union bdflush_param{
struct {
int /* Percentage of buffer cache dirty to
activate bdflush */
int ndirty; /* Maximum number of dirty blocks to write out per
wake-cycle */
int nrefill; /* Number of clean buffers to try to obtain
each time we call refill */
int nref_dirt; /* Dirty buffer threshold for activating bdflush
when trying to refill buffers. */
int clu_nfract; /* Percentage of buffer cache to scan to
search for free clusters */
int age_buffer; /* Time for normal buffer to age before
we flush it */
int age_super; /* Time for superblock to age before we
flush it */
int lav_const; /* Constant used for load average (time
constant */
int lav_ratio; /* Used to determine how low a lav for a
particular size can go before we start to
trim back the buffers */
} b_un;
unsigned int data[N_PARAM];
} bdf_prm = {{60, 500, 64, 256, 15, 30*HZ, 5*HZ, 1884, 2}};
/* These are the min and max parameter values that we will allow to be assigned */
int bdflush_min[N_PARAM] = { 0, 10, 5, 25, 0, 100, 100, 1, 1};
int bdflush_max[N_PARAM] = {100,5000, 2000, 2000,100, 60000, 60000, 2047, 5};

Online tuning is possible by echoing to /proc/sys/vm/bdflush, eg.
echo "60 500 64 256 15 1500 250 1884 2" > /proc/sys/vm/bdflush

Reducing age_super, age_buffer and nfract improve safety, but can decrease performance
dramaticly.

Chel