Commit cae9bf11 authored by Colin Cross's avatar Colin Cross Committed by Greg Kroah-Hartman

android: lowmemorykiller: Fix arguments to lowmem_shrink

The arguments to shrink functions have changed, update
lowmem_shrink to match.
Signed-off-by: default avatarColin Cross <ccross@android.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 71b2c82b
...@@ -79,7 +79,7 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data) ...@@ -79,7 +79,7 @@ task_notify_func(struct notifier_block *self, unsigned long val, void *data)
return NOTIFY_OK; return NOTIFY_OK;
} }
static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask) static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
{ {
struct task_struct *p; struct task_struct *p;
struct task_struct *selected = NULL; struct task_struct *selected = NULL;
...@@ -117,17 +117,17 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask) ...@@ -117,17 +117,17 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
break; break;
} }
} }
if (nr_to_scan > 0) if (sc->nr_to_scan > 0)
lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n", lowmem_print(3, "lowmem_shrink %lu, %x, ofree %d %d, ma %d\n",
nr_to_scan, gfp_mask, other_free, other_file, sc->nr_to_scan, sc->gfp_mask, other_free, other_file,
min_adj); min_adj);
rem = global_page_state(NR_ACTIVE_ANON) + rem = global_page_state(NR_ACTIVE_ANON) +
global_page_state(NR_ACTIVE_FILE) + global_page_state(NR_ACTIVE_FILE) +
global_page_state(NR_INACTIVE_ANON) + global_page_state(NR_INACTIVE_ANON) +
global_page_state(NR_INACTIVE_FILE); global_page_state(NR_INACTIVE_FILE);
if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) { if (sc->nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
lowmem_print(5, "lowmem_shrink %d, %x, return %d\n", lowmem_print(5, "lowmem_shrink %lu, %x, return %d\n",
nr_to_scan, gfp_mask, rem); sc->nr_to_scan, sc->gfp_mask, rem);
return rem; return rem;
} }
selected_oom_adj = min_adj; selected_oom_adj = min_adj;
...@@ -183,8 +183,8 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask) ...@@ -183,8 +183,8 @@ static int lowmem_shrink(struct shrinker *s, int nr_to_scan, gfp_t gfp_mask)
force_sig(SIGKILL, selected); force_sig(SIGKILL, selected);
rem -= selected_tasksize; rem -= selected_tasksize;
} }
lowmem_print(4, "lowmem_shrink %d, %x, return %d\n", lowmem_print(4, "lowmem_shrink %lu, %x, return %d\n",
nr_to_scan, gfp_mask, rem); sc->nr_to_scan, sc->gfp_mask, rem);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
return rem; return rem;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment