[About this patch] This is a patch code to provide accurate means of estimating the amount of current available memory in the system. [Software information regarding this patch] This patch incorporates the following software: (1) the software which is developed independently by or for Panasonic Mobile Communications Co., Ltd. and (2) the software which is licensed under the GNU GENERAL PUBLIC LICENCE. The license is available in accordance with GNU GENERAL PUBLICLICENSE. Please refer to the following terms and conditions. http://www.gnu.org/licenses/gpl.txt [Code Summary] This code estimates the amount of available memory by "simulating" the shrinking procedure of various caches (page cache, slab caches). It inspects caches to see actual available memory but never frees any pages. [KNOWN BUGS] * Estimation for dentry cache and inode cache is fast but not accurate enough for lower overhead. * Race condition between shrink_cache can make a estimation result with some amount of error. e.g. If shrink_cache runs in between after acocunting shrinkable page cache and before accounting free pages, the result can be over estimated. Shrink_cache may move pages from page cache to free list. Thus, the estimation procedure may double-counts the same pages in both places. [Base version of this patch] This patch file is generated with the MontaVista Linux CEE 3.1 (which is based on 2.4.20). It seems easy to apply to various 2.4 kernel because the patch is very small and straightforward. ############################################################################## # Copyright(C) 2005-2006 Panasonic Mobile Communications Co., Ltd. # # This program is free software; you can redistribute it and/or Modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. ############################################################################## [EOF]