vmpressure: do not check for pending work to prevent from new work
authorMichal Hocko <mhocko@suse.cz>
Wed, 31 Jul 2013 20:53:50 +0000 (13:53 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 31 Jul 2013 21:41:04 +0000 (14:41 -0700)
because it is racy and it doesn't give us much anyway as schedule_work
handles this case already.

Signed-off-by: Michal Hocko <mhocko@suse.cz>
Reported-by: Tejun Heo <tj@kernel.org>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Li Zefan <lizefan@huawei.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmpressure.c

index f4ee6a190a4dee86ce8d008ad2a9d166adf992ec..192f9731931da75b24b9a5f9b28203de9a0e2f85 100644 (file)
@@ -246,7 +246,7 @@ void vmpressure(gfp_t gfp, struct mem_cgroup *memcg,
        scanned = vmpr->scanned;
        spin_unlock(&vmpr->sr_lock);
 
-       if (scanned < vmpressure_win || work_pending(&vmpr->work))
+       if (scanned < vmpressure_win)
                return;
        schedule_work(&vmpr->work);
 }