From 7ad66bbef447c94959c5e1111c4a603cbf46bb0a Mon Sep 17 00:00:00 2001 From: Viktor Rosendahl Date: Thu, 11 Sep 2008 19:20:35 +0300 Subject: [PATCH] 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 Signed-off-by: Tony Lindgren --- Reading git-format-patch failed