linux/Documentation/sysctl/fs.txt
<<
>>
Prefs
   1Documentation for /proc/sys/fs/*        kernel version 2.2.10
   2        (c) 1998, 1999,  Rik van Riel <riel@nl.linux.org>
   3        (c) 2009,        Shen Feng<shen@cn.fujitsu.com>
   4
   5For general info and legal blurb, please look in README.
   6
   7==============================================================
   8
   9This file contains documentation for the sysctl files in
  10/proc/sys/fs/ and is valid for Linux kernel version 2.2.
  11
  12The files in this directory can be used to tune and monitor
  13miscellaneous and general things in the operation of the Linux
  14kernel. Since some of the files _can_ be used to screw up your
  15system, it is advisable to read both documentation and source
  16before actually making adjustments.
  17
  181. /proc/sys/fs
  19----------------------------------------------------------
  20
  21Currently, these files are in /proc/sys/fs:
  22- aio-max-nr
  23- aio-nr
  24- dentry-state
  25- dquot-max
  26- dquot-nr
  27- file-max
  28- file-nr
  29- inode-max
  30- inode-nr
  31- inode-state
  32- nr_open
  33- overflowuid
  34- overflowgid
  35- protected_hardlinks
  36- protected_symlinks
  37- suid_dumpable
  38- super-max
  39- super-nr
  40
  41==============================================================
  42
  43aio-nr & aio-max-nr:
  44
  45aio-nr is the running total of the number of events specified on the
  46io_setup system call for all currently active aio contexts.  If aio-nr
  47reaches aio-max-nr then io_setup will fail with EAGAIN.  Note that
  48raising aio-max-nr does not result in the pre-allocation or re-sizing
  49of any kernel data structures.
  50
  51==============================================================
  52
  53dentry-state:
  54
  55From linux/fs/dentry.c:
  56--------------------------------------------------------------
  57struct {
  58        int nr_dentry;
  59        int nr_unused;
  60        int age_limit;         /* age in seconds */
  61        int want_pages;        /* pages requested by system */
  62        int dummy[2];
  63} dentry_stat = {0, 0, 45, 0,};
  64-------------------------------------------------------------- 
  65
  66Dentries are dynamically allocated and deallocated, and
  67nr_dentry seems to be 0 all the time. Hence it's safe to
  68assume that only nr_unused, age_limit and want_pages are
  69used. Nr_unused seems to be exactly what its name says.
  70Age_limit is the age in seconds after which dcache entries
  71can be reclaimed when memory is short and want_pages is
  72nonzero when shrink_dcache_pages() has been called and the
  73dcache isn't pruned yet.
  74
  75==============================================================
  76
  77dquot-max & dquot-nr:
  78
  79The file dquot-max shows the maximum number of cached disk
  80quota entries.
  81
  82The file dquot-nr shows the number of allocated disk quota
  83entries and the number of free disk quota entries.
  84
  85If the number of free cached disk quotas is very low and
  86you have some awesome number of simultaneous system users,
  87you might want to raise the limit.
  88
  89==============================================================
  90
  91file-max & file-nr:
  92
  93The value in file-max denotes the maximum number of file-
  94handles that the Linux kernel will allocate. When you get lots
  95of error messages about running out of file handles, you might
  96want to increase this limit.
  97
  98Historically,the kernel was able to allocate file handles
  99dynamically, but not to free them again. The three values in
 100file-nr denote the number of allocated file handles, the number
 101of allocated but unused file handles, and the maximum number of
 102file handles. Linux 2.6 always reports 0 as the number of free
 103file handles -- this is not an error, it just means that the
 104number of allocated file handles exactly matches the number of
 105used file handles.
 106
 107Attempts to allocate more file descriptors than file-max are
 108reported with printk, look for "VFS: file-max limit <number>
 109reached".
 110==============================================================
 111
 112nr_open:
 113
 114This denotes the maximum number of file-handles a process can
 115allocate. Default value is 1024*1024 (1048576) which should be
 116enough for most machines. Actual limit depends on RLIMIT_NOFILE
 117resource limit.
 118
 119==============================================================
 120
 121inode-max, inode-nr & inode-state:
 122
 123As with file handles, the kernel allocates the inode structures
 124dynamically, but can't free them yet.
 125
 126The value in inode-max denotes the maximum number of inode
 127handlers. This value should be 3-4 times larger than the value
 128in file-max, since stdin, stdout and network sockets also
 129need an inode struct to handle them. When you regularly run
 130out of inodes, you need to increase this value.
 131
 132The file inode-nr contains the first two items from
 133inode-state, so we'll skip to that file...
 134
 135Inode-state contains three actual numbers and four dummies.
 136The actual numbers are, in order of appearance, nr_inodes,
 137nr_free_inodes and preshrink.
 138
 139Nr_inodes stands for the number of inodes the system hane" name="L124"> 124dynamically, but 40" id="L1"L92">  92
1  41<1a>====x 2.6 cates the inomRLIees refulocd ne. Henhref="Documentation/sysctl/fs.txt#L128" id="L132" class="line" name="L42">1  42<1a>
1  43<1a>aio-Nee_inodes and rehrin specnumber of free caches and (?)
  134
1  45<14>system, itd to  alloed ye inode strulis the, iadallocated f1  46<1a>io_shfilnhref="Documentation/sysctl/fs.txt#L128" id="L137" class="line" name="L47">1  47<14>
1  48<1a>rais==========================================================
1  49<1a>of ahref="Documentation/sysctl/fs.txt#L120" id="L50" 1class="line" name="L50">1  50<1a>
1  51<15>
1  52<1a>
1  53<1a>dentUIDd presGIDd dyna32 bitsen you LIeehe numsmbs arem, itsyot moun anhref="Documentation/sysctl/fs.txt#L14" iid="L14" cclass="line" name="L54">1  54<1a>
1  55<1a>Fromllocbs xo ie shoube actubeout writthrinok quonhref="Documentation/sysctl/fs.txt#L128" id="L56" 1class="line" name="L56">1  56<15>
1  57<1a>struTumsmbtl/fs.socatew neednokcthege value
1  58<1a>    actudlt valuhe 65534nhref="Documentation/sysctl/fs.txt#L128" id="L49" 1class="line" name="L59">1  59<15>of ahref="Documentation/sysctl/fs.txt#L120" id="L60" 1class="line" name="L60">1  60<16>==============================================================
1  61<16>
1  62<1a>    ected_hardlinks
1  63<16>
1  64<1a>----A long-ds foout s="lisimulecurit shosin
1  65<1a>
   56<1a>Dentctory caand like /tmpe threcomm nhod="poeventxploitn or ref
 valuflawhref="Documentation/sysctl/fs.txt#L38" 16d="L57" 1class="line" name="L67">1  67<1a>nr_di allocrolispriv arge boundaaand  shrifoatewaio-m givhrilinks
1  68<1a>assurootcess can
foatewproclinks
1  69<1a>usedr rem, itsy filof isepartby sparti/syssd
 valustops unauilorizy ss,
1  70<1a>Age_
1  71<1a>can age idminis rtbit je-ss
1  72<17>
1  73<1a>dcac you p wal ct;VFS:0t;VFS:,clinks
1  74<1a>
1  75<1a>==== you p wal ct;VFS:1t;VFS: links
1  76<1a>
   67<17>
1  78<178This denoected_hor renobasanthe
1  79<17>of ahref="Documentation/sysctl/fs.txt#L120" id="L80" 1class="line" name="L80">1  80<18>==============================================================
1  81<1a>
1  82<18>    ected_hardinks
1  83<18>
1  84<18>----A long-ds foout s="lisimulecurit shosin
1  85<18>
1  86<18>Dentctory caand like /tmpe threcomm nhod="poeventxploitn or ref
 valuflawhref="Documentation/sysctl/fs.txt#L38" 1id="L87" 1class="line" name="L87">1  87<18>nr_di allocrolispriv arge boundaaand  shrifoatewaio-m givhriinks
1  88<18>assurootcess can
foatewprocinks
1  89<1a>====incompletrulis tef
hundro  aventxampleprocrolisnumbyearsease looksca href="Documentation/sysctl/fs.txt#L122" id="L90" 1class="line" name="L90">1  90<1a>
http://cve.mitre>/cgi-bin/cvekey.cgi?keyword=/tmp
1  91<19>
1  92<1a>
1  93<19>
1  94<1a>hand you p wal ct;VFS:1t;VFS: inks
1  95<1a>of eructickyeworld-writ
1  96<1a>wantfoatewarches t je-s shrinumbctory can owrarches teecnumbinks
1  97<1a>
1  98<198This denoected_hor renobasanthe
1  99<19>of ahref="Documentation/sysctl/fs.txt#L120"2id="L100"2class="line" name="L100"2 100<20>==============================================================

file_dumpable

This denoe
2 105<2a>usedhe onumrwthe ected_har/s thby syinaaande threm and pa href="Documentation/sysctl/fs.txt#L108"2id="L106"2class="line" name="L106"2 106<2a>
Atte0 - (dlt val) - tradi/sys, -behavieur. Anycess can
h shoubeencthegedhref="Documentation/sysctl/fs.txt#L114"2id="L28" cclass="line" name="L108"2 108<20>        int priv arge levels e-sis executruhehat alloan ebe ablear href="Documentation/sysctl/fs.txt#L17" 2id="L109"2class="line" name="L109"2 109<2a>reac1 - (dlbug) - the ess cannd ableicactu shripolii        int owra systLinucntly ars,
< netwooulecurit shoearaliNr_uTis nothref="Documentation/sysctl/fs.txt#L72" 2id="L21" cllass="line" name="L21">  101<21>        int wanendy sthe pm, itddlbuggtotasituahsysslheha. Ptranrsis uncheckar href="Documentation/sysctl/fs.txt#L17" 2id="L112"2class="line" name="L112"2 112<21>        int Tis notthe,ecurethe nd watewprlarly rts,
        (c) ents">This2 - (_dum to
) - tnycyinaay
h shounorm allow be 3an ebe ablearnottablearhref="Documentation/sysctl/fs.txt#L17" 2i5="L104"2class="line" name="L115"2 115<2a>allo    (c) tnywaut can&hehatie filct;VFS:coct_patthrnt;VFS: el allotl/fs.short wal href="Documentation/sysctl/fs.txt#L17" 2id="L106"2class="line" name="L116"2 116<2a>enou    (c) einumrra pipndles, tr enea fualloquald on tpath5 (Fumentpolies tlthref="Documentation/sysctl/fs.txt#L72" 2id="L107"2class="line" name="L117"2 117<2a>reso    int ons limit.
6-2451.) Tis n mde hoeararopri        int  shriidminis rtbit  dynaapts tototal cdlbug ess        int environatiod the einumrr someaecoctuableipipndles, tr  fileknewphref="Documentation/sysctl/fs.txt#L25" iid="L20" cclass="line" name="L20">  120<22>        int hat e tb priv arged coctuableth filec in ohe pfied ocbctory canhref="Documentation/sysctl/fs.txt#L25" iid="L21" cclass="line" name="L21">  121<22>        int dltiny sthe ces tout soctuablet.aio-necoctuableiharannsy filof href="Documentation/sysctl/fs.txt#L25" iid="L22" cllass="line" name="L22">  112<22>        int a pipndles, tr enefualloquald o tpathd tsages abt alloxactmitthdhref="Documentation/sysctl/fs.txt#L25" iid="L103"2class="line" name="L23">  123<223        int hattl/log war out t runnlimitackallocecocory rt wotot href="Documentation/sysctl/fs.txt#L17" 2id="L24" cclass="line" name="L24">  124<22>
  125<22>==============================================================
  126<22>
  127<2a>handr-max
  128<22>
  129<22>The filsebers are,entsrol maximum number of inodr-nr
blocksd
out thue maximum number of inodmoun anbs arem, itsykernel allhref="Documentation/sysctl/fs.txt#L67" 2id="L21" cclass="line" name="L131"2 131<23>can be r som. Youy nr_unto increase thisr-max
The moun e file desem, itsykehe valucntly are in inodr-max
inodwatewprneedno href="Documentation/sysctl/fs.txt#L17" 2id="L134"2class="line" name="L134"2 134<2a>
==============================================================

nr_fnr & aio-max-nr:

Nr_inr &s the numbcntly arem, it-widmber of allocsynchronsystichref="Documentation/sysctl/fs.txt#L67" 2id="L1"L92">  92
2  41<2a>====nr &be rgrowdno href="Documentation/sysctl/fs.txt#L17" 2id="L132"2class="line" name="L42">2  42<2a>
2  43<2a>aio-==========================================================
2 134<2a>
2  45<24>
2  46<2a>io_s2roc/sys/fs
2  47<24>
2  48<24>
2  49<2a>of amentation/sys the numbs in thisc/sys/fs
2  50<2a>
2  51<25>
2  52<2a>
2  53<2a>dent3roc/sys/fs
2  54<25>--------------------------------------------------------------href="Documentation/sysctl/fs.txt#L53" 2id="L45" 2class="line" name="L55">2  55<25>
2  56<25>The actut;VFS:mtedn t;VFS: e desem, it essviand inumbee canaay
el allofeas
2  57<2a>struse tbor rllocers,
< spanrs libraay
 file implem">2  58<2a>    API (at an a systLinu MSG tagthe pre- POSIXs1003.1-20>1sion 2.2.the fileSm, ithref="Documentation/sysctl/fs.txt#L53" 2id="L49" 2class="line" name="L59">2  59<25>of aIn arfanrecified oon or .)href="Documentation/sysctl/fs.txt#L53" 2id="L60" 2class="line" name="L60">2  60<26>
2  61<26>
2  62<2a>    urce limsd to tystLinu inodem, it href="Documentation/sysctl/fs.txt#L17" 2id="L63" 2class="line" name="L63">2  63<26>
2  64<2a>----c/sys/fs
2  65<2a>
   56<26>
2  67<2a>nr_dc/sys/fs
2  68<2a>assumum number of inodmges abslrdeautedn ie.
2  69<2a>usedall cnonumrr(s,
<)it depeh shouhort wardemqn:
2  70<2a>Age_autedn imuachbe lcan
ll equaln io_smsg_2  71<27>
2  72<27>
2  73<2a>dcacmum numbdmges abtsizere in i(s the e low dmges abttedn ;s safeattributrut wadur2  74<2a>
2  75<27>
2  76<2a>
   67<2a>dquotlt valuer of inodmges abslrdeautedn ie.
2  78<278ThisNULL.aio-s texcto imsg_2  79<27>of ahref="Documentation/sysctl/fs.txt#L120"2id="L80" 2class="line" name="L80">2  80<28>====c/sys/fs
2  81<28>can age dlt valumges abtsizere in iie attrspar"L2tf inodmqn:
2  82<28>    excto imsgsize_2  83<28>
2  84<28>----4roc/sys/fs
2  85<28>
2  86<28>
2  87<287This denoctory can ains threconfigurtbor rlphsysslthe numbepoll(7) in arfanr href="Documentation/sysctl/fs.txt#L17" 2id="L78" 2class="line" name="L88">2  88<2a>
2  89<2a>====2  90<2a>
2  91<29>
2  92<2a>
2  93<29>
2  94<29>This denoconfigurtbor rlphsys t we maximum number of inodt;VFS:wes test;VFS:  filepa href="Documentation/sysctl/fs.txt#L108"2id="L95" 2class="line" name="L95">2  95<29>allocatewy sthe ed&qrs,
< href="Documentation/sysctl/fs.txt#L110"2id="L86" 2class="line" name="L96">2  96<2a>wantEahout;VFS:wes tt;.
2  97<2a>
2  98<29>    actucntly ardlt value is 1the r2  99<29>of atew ry is ,octviandlthe numbt;VFS:wes tt;.








actuorigis, -LXR softwdynaystLinuref="Docuhttp://ce limthege.netc/syjry s/lxr">LXR commu oty
lxr@l


lxr.l
Rm pilleL