Message ID | 20220425111232.23182-5-linmiaohe@huawei.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | A few cleanup and fixup patches for vmscan | expand |
diff --git a/mm/vmscan.c b/mm/vmscan.c index 82e6fa83c472..10ba16fdd748 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1887,7 +1887,7 @@ static unsigned int shrink_page_list(struct list_head *page_list, * increment nr_reclaimed here (and * leave it off the LRU). */ - nr_reclaimed++; + nr_reclaimed += nr_pages; continue; } }
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. Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)