mm: activate !PageLRU pages on mark_page_accessed if page is on local pagevec
[platform/adaptation/renesas_rcar/renesas_kernel.git] / mm / memcontrol.c
index 1947218..4748966 100644 (file)
@@ -1448,11 +1448,12 @@ static bool mem_cgroup_same_or_subtree(const struct mem_cgroup *root_memcg,
        return ret;
 }
 
-int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg)
+bool task_in_mem_cgroup(struct task_struct *task,
+                       const struct mem_cgroup *memcg)
 {
-       int ret;
        struct mem_cgroup *curr = NULL;
        struct task_struct *p;
+       bool ret;
 
        p = find_lock_task_mm(task);
        if (p) {
@@ -1464,14 +1465,14 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *memcg)
                 * killer still needs to detect if they have already been oom
                 * killed to prevent needlessly killing additional tasks.
                 */
-               task_lock(task);
+               rcu_read_lock();
                curr = mem_cgroup_from_task(task);
                if (curr)
                        css_get(&curr->css);
-               task_unlock(task);
+               rcu_read_unlock();
        }
        if (!curr)
-               return 0;
+               return false;
        /*
         * We should check use_hierarchy of "memcg" not "curr". Because checking
         * use_hierarchy of "curr" here make this function true if hierarchy is