aboutsummaryrefslogtreecommitdiffstats
path: root/mm/vmscan.c
diff options
context:
space:
mode:
authorMiaohe Lin <linmiaohe@huawei.com>2022-05-12 20:23:00 -0700
committerAndrew Morton <akpm@linux-foundation.org>2022-05-13 07:20:14 -0700
commit9aafcffc18785fcdd9295640eb2ed927960b31a1 (patch)
tree5a87bec9652afd6878cc8c9f8ce37fd1f49d0613 /mm/vmscan.c
parent1fe47c0beb2df2739b07b8e051425b6400abce5b (diff)
downloadlinux-9aafcffc18785fcdd9295640eb2ed927960b31a1.tar.gz
mm/vmscan: take all base pages of THP into account when race with speculative reference
If the page has buffers, shrink_page_list will try to free the buffer mappings associated with the page and try to free the page as well. In the rare race with speculative reference, the page will be freed shortly by speculative reference. But nr_reclaimed is not incremented correctly when we come across the THP. We need to account all the base pages in this case. Link: https://lkml.kernel.org/r/20220425111232.23182-5-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Huang, Ying <ying.huang@intel.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Cc: Oscar Salvador <osalvador@suse.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r--mm/vmscan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 68d4004e039733..61688f4a9d1e58 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1884,7 +1884,7 @@ retry:
* increment nr_reclaimed here (and
* leave it off the LRU).
*/
- nr_reclaimed++;
+ nr_reclaimed += nr_pages;
continue;
}
}