]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/staging/android/lowmemorykiller.c
mm, vmscan: move LRU lists to node
[mirror_ubuntu-bionic-kernel.git] / drivers / staging / android / lowmemorykiller.c
index 2509e5df7244a16d6b926d6e5d6a881f9f5bb792..93dbcc38eb0fd820db9363ae50f1cb0ff749db36 100644 (file)
@@ -72,10 +72,10 @@ static unsigned long lowmem_deathpending_timeout;
 static unsigned long lowmem_count(struct shrinker *s,
                                  struct shrink_control *sc)
 {
-       return global_page_state(NR_ACTIVE_ANON) +
-               global_page_state(NR_ACTIVE_FILE) +
-               global_page_state(NR_INACTIVE_ANON) +
-               global_page_state(NR_INACTIVE_FILE);
+       return global_node_page_state(NR_ACTIVE_ANON) +
+               global_node_page_state(NR_ACTIVE_FILE) +
+               global_node_page_state(NR_INACTIVE_ANON) +
+               global_node_page_state(NR_INACTIVE_FILE);
 }
 
 static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
@@ -131,7 +131,7 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
                if (!p)
                        continue;
 
-               if (test_tsk_thread_flag(p, TIF_MEMDIE) &&
+               if (task_lmk_waiting(p) &&
                    time_before_eq(jiffies, lowmem_deathpending_timeout)) {
                        task_unlock(p);
                        rcu_read_unlock();
@@ -162,13 +162,8 @@ static unsigned long lowmem_scan(struct shrinker *s, struct shrink_control *sc)
        if (selected) {
                task_lock(selected);
                send_sig(SIGKILL, selected, 0);
-               /*
-                * FIXME: lowmemorykiller shouldn't abuse global OOM killer
-                * infrastructure. There is no real reason why the selected
-                * task should have access to the memory reserves.
-                */
                if (selected->mm)
-                       mark_oom_victim(selected);
+                       task_set_lmk_waiting(selected);
                task_unlock(selected);
                lowmem_print(1, "Killing '%s' (%d), adj %hd,\n"
                                 "   to free %ldkB on behalf of '%s' (%d) because\n"