lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 24 Nov 2008 20:15:32 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Dave Chinner <david@...morbit.com>,
	Christoph Lameter <cl@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 2/2] mm: add dirty_background_bytes and dirty_bytes
 sysctls

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@...radead.org>
> Cc: Dave Chinner <david@...morbit.com>
> Cc: Christoph Lameter <cl@...ux-foundation.org>
> Signed-off-by: David Rientjes <rientjes@...gle.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@...llo.nl>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ