]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mm: correct the comment when reclaimed pages exceed the scanned pages
authorzhongjiang <zhongjiang@huawei.com>
Fri, 16 Jun 2017 21:02:40 +0000 (14:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 16 Jun 2017 21:37:05 +0000 (06:37 +0900)
Commit 1569f55e4395 ("mm: vmpressure: fix sending wrong events on
underflow") declared that reclaimed pages exceed the scanned pages due
to the thp reclaim.

That is incorrect because THP will be spilt to normal page and loop
again, which will result in the scanned pages increment.

[akpm@linux-foundation.org: tweak comment text]
Link: http://lkml.kernel.org/r/1496824266-25235-1-git-send-email-zhongjiang@huawei.com
Signed-off-by: zhongjiang <zhongjiang@huawei.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmpressure.c

index 6063581f705c48b97a78a087d8c67127af9c8d68..ce0618bfa8d0643d0e65263ad65a9e7a7a4c92ed 100644 (file)
@@ -115,9 +115,9 @@ static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned,
        unsigned long pressure = 0;
 
        /*
-        * reclaimed can be greater than scanned in cases
-        * like THP, where the scanned is 1 and reclaimed
-        * could be 512
+        * reclaimed can be greater than scanned for things such as reclaimed
+        * slab pages. shrink_node() just adds reclaimed pages without a
+        * related increment to scanned pages.
         */
        if (reclaimed >= scanned)
                goto out;