Commit d7143e31 authored by zhongjiang's avatar zhongjiang Committed by Linus Torvalds

mm: correct the comment when reclaimed pages exceed the scanned pages

Commit e1587a49 ("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.comSigned-off-by: default avatarzhongjiang <zhongjiang@huawei.com>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 64c2b203
...@@ -115,9 +115,9 @@ static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned, ...@@ -115,9 +115,9 @@ static enum vmpressure_levels vmpressure_calc_level(unsigned long scanned,
unsigned long pressure = 0; unsigned long pressure = 0;
/* /*
* reclaimed can be greater than scanned in cases * reclaimed can be greater than scanned for things such as reclaimed
* like THP, where the scanned is 1 and reclaimed * slab pages. shrink_node() just adds reclaimed pages without a
* could be 512 * related increment to scanned pages.
*/ */
if (reclaimed >= scanned) if (reclaimed >= scanned)
goto out; goto out;
......
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