public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Rientjes <rientjes@google.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Dave Chinner <david@fromorbit.com>,
	Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch 2/2] mm: add dirty_background_bytes and dirty_bytes sysctls
Date: Mon, 24 Nov 2008 20:15:32 +0100	[thread overview]
Message-ID: <1227554132.4259.535.camel@twins> (raw)
In-Reply-To: <alpine.DEB.2.00.0811230228530.11384@chino.kir.corp.google.com>

On Sun, 2008-11-23 at 10:55 -0800, David Rientjes wrote:
> 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.
> 
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Dave Chinner <david@fromorbit.com>
> Cc: Christoph Lameter <cl@linux-foundation.org>
> Signed-off-by: David Rientjes <rientjes@google.com>

I don't really like the dual interface, but I guess given the
restrictions this is the best one can do... So

Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>


  reply	other threads:[~2008-11-24 19:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-23 18:55 [patch 1/2] mm: change dirty limit type specifiers to unsigned long David Rientjes
2008-11-23 18:55 ` [patch 2/2] mm: add dirty_background_bytes and dirty_bytes sysctls David Rientjes
2008-11-24 19:15   ` Peter Zijlstra [this message]
2008-11-24 23:38   ` Andrew Morton
2008-11-25  0:52     ` Randy Dunlap
2008-11-25  1:05       ` David Rientjes
2008-11-25  1:00     ` David Rientjes
2009-02-01  1:22   ` [PATCH] mm: Fix dirty_bytes/dirty_background_bytes sysctls on 64bit arches Sven Wegener
2009-02-01  9:19     ` Peter Zijlstra
2009-02-01 10:22       ` Sven Wegener
2009-02-02  0:26     ` David Rientjes
2008-11-24 19:16 ` [patch 1/2] mm: change dirty limit type specifiers to unsigned long Peter Zijlstra
2008-11-24 19:49   ` David Rientjes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1227554132.4259.535.camel@twins \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox