Merge branch 'ics_HWA' of github.com:securecrt/android_kernel_htcleo-2.6.32-ics into ics_HWA

This commit is contained in:
SecureCRT 2012-08-23 02:50:19 +08:00
commit f3818c8864
2 changed files with 27 additions and 4 deletions

View File

@ -41,6 +41,11 @@
#include <linux/slab.h>
#include <linux/sysfs.h>
#ifdef CONFIG_SWAP
#include <linux/fs.h>
#include <linux/swap.h>
#endif
static uint32_t lowmem_debug_level = 2;
static int lowmem_adj[6] = {
0,
@ -64,6 +69,10 @@ static struct task_struct *lowmem_deathpending;
static unsigned long lowmem_deathpending_timeout;
static struct kobject *lowmem_kobj;
#ifdef CONFIG_SWAP
static int fudgeswap = 512;
#endif
#define lowmem_print(level, x...) \
do { \
if (lowmem_debug_level >= (level)) \
@ -122,7 +131,19 @@ static inline void get_free_ram(int *other_free, int *other_file)
*other_free = global_page_state(NR_FREE_PAGES);
*other_file = global_page_state(NR_FILE_PAGES) -
global_page_state(NR_SHMEM);
#ifdef CONFIG_SWAP
if(fudgeswap != 0){
struct sysinfo si;
si_swapinfo(&si);
if(si.freeswap > 0){
if(fudgeswap > si.freeswap)
other_file += si.freeswap;
else
other_file += fudgeswap;
}
}
#endif
if (offlining) {
/* Discount all free space in the section being offlined */
for_each_zone(zone) {
@ -347,6 +368,9 @@ module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
module_param_named(notify_trigger, lowmem_minfree_notif_trigger, uint,
S_IRUGO | S_IWUSR);
#ifdef CONFIG_SWAP
module_param_named(fudgeswap, fudgeswap, int, S_IRUGO | S_IWUSR);
#endif
module_init(lowmem_init);
module_exit(lowmem_exit);

7
mm/vmalloc.c Normal file → Executable file
View File

@ -1470,6 +1470,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
{
struct page **pages;
unsigned int nr_pages, array_size, i;
gfp_t nested_gfp = (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO;
nr_pages = (area->size - PAGE_SIZE) >> PAGE_SHIFT;
array_size = (nr_pages * sizeof(struct page *));
@ -1477,13 +1478,11 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
area->nr_pages = nr_pages;
/* Please note that the recursion is strictly bounded. */
if (array_size > PAGE_SIZE) {
pages = __vmalloc_node(array_size, 1, gfp_mask | __GFP_ZERO,
pages = __vmalloc_node(array_size, 1, nested_gfp|__GFP_HIGHMEM,
PAGE_KERNEL, node, caller);
area->flags |= VM_VPAGES;
} else {
pages = kmalloc_node(array_size,
(gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO,
node);
pages = kmalloc_node(array_size, nested_gfp, node);
}
area->pages = pages;
area->caller = caller;