Developer's Daily Unix by Example
  main | java | perl | unix | dev directory | web log
 
 
Main
Unix
Man Pages
   

bdflush

NAME
SYNOPSIS
DESCRIPTION
COMMAND?LINE OPTIONS
AUTHOR
BUGS

NAME

bdflush ? kernel daemon to flush dirty buffers back to disk.

SYNOPSIS

bdflush [opt]

DESCRIPTION

bdflush is used to start the kernel daemon to flush dirty buffers back to disk. The actual dirty work is in a kernel function, and bdflush actually forks a new process which then calls the kernel function that will never return.

bdflush actually forks a second daemon as well, and this one acts like a more traditional update process, except that buffers are not considered ready to be written until they have aged a bit. The clock starts when the buffer is brelsed with the dirty bit set, and the buffer will not be written back until an interval passes. The interval is different for data buffers and for metadata buffers (like directories, bitmaps, indirect blocks, etc), and the current settings are displayed by bdflush when you run it with arguments on the command line. The defaults are 30 seconds for data buffers and 5 seconds for metadata buffers.

The two daemons are normally started in /etc/rc with one command:

/sbin/update

Note that you need to have both daemons running because each one serves a different purpose. Note also that this command should be run before any major I/O is performed. In particular, update should be called before any filesystems are fsck’ed or mounted read-write.

When bdflush is called by a user without superuser priveledges, it calls flush() and sync() and then exits. Mustn’t have 20 update daemons running at a time...

COMMAND?LINE OPTIONS

-d

Display kernel parameters. Using this option prevents the daemon from starting.

-h

Print the usage message (help).

-s

If bdflush defaults to the old update behavior, call sync this often. ( In seconds ) Default:30.

-f

Call flush this often. ( In seconds ) Default:5.

-0

Max fraction of LRU list to examine for dirty blocks.

-1

Max number of dirty blocks to write each time bdflush activated

-2

Num of clean buffers to be loaded onto free list by refill_freelist

-3

Dirty block threshold for activating bdflush in refill_freelist

-4

Percentage of cache to scan for free clusters

-5

Time for data buffers to age before flushing

-6

Time for non-data (dir, bitmap, etc) buffers to age before flushing

-7

Time buffer cache load average constant

-8

LAV ratio (used to determine threshold for buffer fratricide)

AUTHOR

bdflush was written as a quick hack by Eric Youngdale <ericy@gnu.ai.mit.edu>. The main goal was to improve kernel performance by making the flushing of dirty buffers more intelligent, and add support for buffer clustering. Feel free to improve it. Various other hacks by Phil Bostley <bostley@cs.colorado.edu> and Daniel Quinlan <quinlan@yggdrasil.com>.

BUGS

If there are, they are most likely in the kernel code.


copyright 1998-2007, devdaily.com, all rights reserved.
devdaily.com, an alvin j. alexander production.