Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
For bugs related to Red Hat Enterprise Linux 5 product line. The current stable release is 5.10. For Red Hat Enterprise Linux 6 and above, please visit Red Hat JIRA https://issues.redhat.com/secure/CreateIssue!default.jspa?pid=12332745 to report new issues.

Bug 635782

Summary: Add dirty_background_bytes and dirty_bytes sysctls to RHEL 5
Product: Red Hat Enterprise Linux 5 Reporter: Harshula Jayasuriya <harshula>
Component: kernelAssignee: Larry Woodman <lwoodman>
Status: CLOSED ERRATA QA Contact: Zhouping Liu <zliu>
Severity: high Docs Contact:
Priority: medium    
Version: 5.5CC: borgan, czhang, lwoodman, nobody+295318, qcai, riel, zliu
Target Milestone: rc   
Target Release: 5.6   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-13 21:20:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Harshula Jayasuriya 2010-09-20 17:19:17 UTC
Description of problem:

With the increasing number of systems with 50 or more GiBs of RAM, dirty_ratio with a lower bound of 5% is not that helpful. For example, the affects of Bug 469848 (nfs_getattr() hangs during heavy write workloads) could be limited if we were able to limit the number of dirty pages to a much lower level on systems with a lot of RAM.

Patches:

The commits that need to be backported from mainline:
-----------------------------------------------------------
commit 2da02997e08d3efe8174c7a47696e6f7cbe69ba9
Author: David Rientjes <rientjes>
Date:   Tue Jan 6 14:39:31 2009 -0800

    mm: add dirty_background_bytes and dirty_bytes sysctls
    
    This change introduces two new sysctls to /proc/sys/vm:
    dirty_background_bytes and dirty_bytes.
    
    dirty_background_bytes is the counterpart to dirty_background_ratio and
    dirty_bytes is the counterpart to dirty_ratio.
    
    With growing memory capacities of individual machines, it's no longer
    sufficient to specify dirty thresholds as a percentage of the amount of
    dirtyable memory over the entire system.
    
    dirty_background_bytes and dirty_bytes specify quantities of memory, in
    bytes, that represent the dirty limits for the entire system.  If either
    of these values is set, its value represents the amount of dirty memory
    that is needed to commence either background or direct writeback.
    
    When a `bytes' or `ratio' file is written, its counterpart becomes a
    function of the written value.  For example, if dirty_bytes is written to
    be 8096, 8K of memory is required to commence direct writeback.
    dirty_ratio is then functionally equivalent to 8K / the amount of
    dirtyable memory:
    
    	dirtyable_memory = free pages + mapped pages + file cache
    
    	dirty_background_bytes = dirty_background_ratio * dirtyable_memory
    		-or-
    	dirty_background_ratio = dirty_background_bytes / dirtyable_memory
    
    		AND
    
    	dirty_bytes = dirty_ratio * dirtyable_memory
    		-or-
    	dirty_ratio = dirty_bytes / dirtyable_memory
    
    Only one of dirty_background_bytes and dirty_background_ratio may be
    specified at a time, and only one of dirty_bytes and dirty_ratio may be
    specified.  When one sysctl is written, the other appears as 0 when read.
    
    The `bytes' files operate on a page size granularity since dirty limits
    are compared with ZVC values, which are in page units.
    
    Prior to this change, the minimum dirty_ratio was 5 as implemented by
    get_dirty_limits() although /proc/sys/vm/dirty_ratio would show any user
    written value between 0 and 100.  This restriction is maintained, but
    dirty_bytes has a lower limit of only one page.
    
    Also prior to this change, the dirty_background_ratio could not equal or
    exceed dirty_ratio.  This restriction is maintained in addition to
    restricting dirty_background_bytes.  If either background threshold equals
    or exceeds that of the dirty threshold, it is implicitly set to half the
    dirty threshold.
    
    Acked-by: Peter Zijlstra <peterz>
    Cc: Dave Chinner <david>
    Cc: Christoph Lameter <cl>
    Signed-off-by: David Rientjes <rientjes>
    Cc: Andrea Righi <righi.andrea>
    Signed-off-by: Andrew Morton <akpm>
    Signed-off-by: Linus Torvalds <torvalds>

commit fc3501d411d34823fb9be248a95a0c44f945866f
Author: Sven Wegener <sven.wegener>
Date:   Wed Feb 11 13:04:23 2009 -0800

    mm: fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches

commit 9e4a5bda89034502fb144331e71a0efdfd5fae97
Author: Andrea Righi <righi.andrea>
Date:   Thu Apr 30 15:08:57 2009 -0700

    mm: prevent divide error for small values of vm_dirty_bytes
-----------------------------------------------------------

Regards,
Harshula

Comment 2 RHEL Program Management 2010-09-24 21:49:17 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Jarod Wilson 2010-09-27 19:13:08 UTC
in kernel-2.6.18-225.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 14 Jarod Wilson 2010-11-23 17:05:16 UTC
in kernel-2.6.18-233.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 18 errata-xmlrpc 2011-01-13 21:20:36 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/RHSA-2011-0017.html