Bug 497197 - stale definition of file-nr in proc(5) man page
Summary: stale definition of file-nr in proc(5) man page
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: man-pages
Version: 5.3
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Ivana Varekova
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 857962
TreeView+ depends on / blocked
 
Reported: 2009-04-22 18:37 UTC by Jeff Bastian
Modified: 2018-10-20 03:59 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 857962 (view as bug list)
Environment:
Last Closed: 2009-11-11 09:13:40 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch for proc(5) man page (1.30 KB, patch)
2009-04-22 18:40 UTC, Jeff Bastian
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:1574 0 normal SHIPPED_LIVE man-pages bug fix update 2009-11-11 09:13:32 UTC

Description Jeff Bastian 2009-04-22 18:37:03 UTC
Description of problem:
The definition of /proc/sys/fs/file-nr in the proc(5) man page was valid for the Linux 2.4.x kernel, but it is stale for 2.6.  An updated definition can be found in /usr/share/doc/kernel-doc-2.6.18/Documentation/filesystems/proc.txt

It currently reads:
       /proc/sys/fs/file-nr
              This (read-only)  file  gives  the  number  of  files  presently
              opened.  It contains three numbers: The number of allocated file
              handles, the number of free file handles and the maximum  number
              of file handles.  The kernel allocates file handles dynamically,
              but it doesn’t free them again.   If  the  number  of  allocated
              files is close to the

              maximum,  you  should consider increasing the maximum.  When the
              number of free file handles is large, you’ve encountered a  peak
              in  your  usage  of  file handles and you probably don’t need to
              increase the maximum.

Copying from filesystems/proc.txt, it should read something like:
       /proc/sys/fs/file-nr
              Historically, the three values in file-nr denoted the number  of
              allocated  file handles, the number of allocated but unused file
              handles, and the maximum  number  of  file  handles.  Linux  2.6
              always  reports  0 as the number of free file handles -- this is
              not an error, it just means that the number  of  allocated  file
              handles exactly matches the number of used file handles.

Version-Release number of selected component (if applicable):
man-pages-2.39-12.el5

Additional info:
The description in /usr/share/doc/kernel-doc-2.6.18/Documentation/sysctl/fs.txt is also stale.

Comment 1 Jeff Bastian 2009-04-22 18:40:29 UTC
Created attachment 340786 [details]
patch for proc(5) man page

Comment 2 Jeff Bastian 2009-04-22 18:51:50 UTC
See bug 497200 for the sysctl/fs.txt definition.

Comment 10 errata-xmlrpc 2009-11-11 09:13:40 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1574.html

Comment 12 Michael Kerrisk 2013-02-10 23:06:18 UTC
The problem with the Red Hat patch is that it loses (quite a lot of) information. I've applied the patch below to upstream:

diff --git a/man5/proc.5 b/man5/proc.5
index 30818d2..93be9eb 100644
--- a/man5/proc.5
+++ b/man5/proc.5
@@ -2270,16 +2270,21 @@ can override the
 limit.
 .TP
 .I /proc/sys/fs/file-nr
-This (read-only) file gives the number of files presently opened.
-It contains three numbers: the number of allocated file handles;
+This (read-only) file contains three numbers:
+the number of allocated file handles
+(i.e., the number of files presently opened);
 the number of free file handles; and the maximum number of file handles.
-The kernel allocates file handles dynamically, but it
-doesn't free them again.
-If the number of allocated files is close to the
+If the number of allocated file handles is close to the
 maximum, you should consider increasing the maximum.
-When the number of free file handles is
-large, you've encountered a peak in your usage of file
-handles and you probably don't need to increase the maximum.
+Before Linux 2.6,
+the kernel allocated file handles dynamically,
+but it didn't free them again.
+Instead the free file handles were kept in a list for reallocation;
+the "free file handles" value indicates the size of that list.
+A large number of free file handles indicates that there was
+a past peak in the usage of open file handles.
+Since Linux 2.6, the kernel does deallocate freed file handles,
+and the "free file handles" value is always zero.
 .TP
 .I /proc/sys/fs/inode-max
 This file contains the maximum number of in-memory inodes.


Note You need to log in before you can comment on or make changes to this bug.