Tuning NILFS
============

Some operational parameters are changeable runtime.
The parameters can be read or set through the sysfs interface.

During mounting on a block device, NILFS exposes the parameters 
on sysfs files (i.e. attributes) in the following directory.

     /sys/block/<drive>/nilfs, or

     /sys/block/<drive>/<partition>/nilfs

If NILFS is mounted, for example, on the first partition of
secondary master IDE drive, the sysfs files are shown in

     /sys/block/hdc/hdc1/nilfs/

If NILFS is mounted through the device mapper, they are shown in

     /sys/block/dm-0/nilfs/


Currently, there exist seven files:

  File name        Format    Description
  -------------------------------------------------------------------
  sc_interval      integer   Timeout period in seconds. The daemon of
                   (*1)      NILFS (=segctord) automatically flushes
                             the cache and makes a major checkpoint
                             when this period has passed.
    
  sc_threshold     integer   Threshold number of data blocks.
                   (*1)      The segctord triggers construction of
                             segments also when the dirty blocks 
                             exceeds this threshold.

  sc_mjcp_freq     integer   Maximum frequency of major checkpoint
                   (*1)      in seconds.  Larger value lessen the 
                             frequency of inserting the major
                             checkpoints during continuous write.

  sc_max_bio       integer   Maximum number of BIO requests submitted 
                   (*1)      at a time.

  sc_ctime         integer   Epoch time (time_t value) when the last
                             segment was constructed.  In passive
                             mode, this attribute is used to set the
                             timestamp of segments to be written.

  max_sketch_size  integer   Maximum size of .sketch file in bytes.
                   (*2)

  sync             integer   A file to control construction.
                             Writing 1 to this file makes NILFS
                             construct a logical segment having a 
                             major CP.  After construction, it is set
                             to 0, or to -1 if no segment was created.
  -------------------------------------------------------------------
  *1: integer bigger than zero. 
      If zero is set, they are reset to the default value.
  *2: read-only

Each file includes only one parameter complying with the model of
sysfs.  These parameters can be changed as follows:

  # cd /sys/block/hdc/hdc1/nilfs
  # cat sc_interval
  5
  # echo 10 > sc_interval
  # cat sc_interval
  10

In this example, the timeout of segctord is changed from 5 seconds to
10 seconds.


We are also considering to support ioctl() interface for these
parameters.  In that case, these interfaces may eventually be altered
to the counterparts of ioctl().

---
tuning.txt,v 1.12 2006/07/14 11:47:59 amagai Exp
