]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commit
lowmem: get rid of the percentages
authorViktor Rosendahl <viktor.rosendahl@nokia.com>
Thu, 11 Sep 2008 16:20:35 +0000 (19:20 +0300)
committerTony Lindgren <tony@atomide.com>
Fri, 12 Sep 2008 18:11:39 +0000 (11:11 -0700)
commit7ad66bbef447c94959c5e1111c4a603cbf46bb0a
treedaa92abf9dc53cabebf6dbae2a9520ba4534ca39
parent336092c0f9feef32928f617bd70f157daea04f40
lowmem: get rid of the percentages

The purpose of this patch is to get rid of the lame percentage calculations in
lowmem.c. Currently, the limits (measured in pages) are calculated from
percentages every time somebody from userspace requests some memory. With this
patch, the limits are in pages and furthermore, they are specified as minimum
amount of "free pages", instead of as maximum amount of "used pages". "Free"
means free pages or such pages that can easily be freed by the VM system.

This patch changes the names of the lowmem sysctl limits in /proc/sys/vm:
lowmem_deny_watermark        => lowmem_deny_watermark_pages
lowmem_notify_low      => lowmem_notify_low_pages
lowmem_notify_high       => lowmem_notify_high_pages

The following read only value disappears:
lowmem_used_pages

The following read only value is introduced:
lowmem_free_pages

The old value can be calculated from userspace with the following pseudocode:

if lowmem_free_pages < lowmem_allowed_pages
   lowmem_used_pages = lowmem_allowed_pages - lowmem_free_pages
else
   lowmem_used_pages = 0;

Note that the value of lowmem_free_pages is only accurate when the system is
rather low on memory (otherwise it's a bit too pessimistic), this was true also
for the lowmem_used_pages metric.

Signed-off-by: Viktor Rosendahl <viktor.rosendahl@nokia.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
security/lowmem.c