lkml.org 
[lkml]   [2021]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5/5] mm/vmscan: fix misleading comment in isolate_lru_pages()
Date
We couldn't know whether the page is being freed elsewhere until we failed
to increase the page count.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
mm/vmscan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index a74760c48bd8..6e26b3c93242 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1891,7 +1891,6 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
*/
scan += nr_pages;
if (!__isolate_lru_page_prepare(page, mode)) {
- /* It is being freed elsewhere */
list_move(&page->lru, src);
continue;
}
@@ -1901,6 +1900,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan,
* page release code relies on it.
*/
if (unlikely(!get_page_unless_zero(page))) {
+ /* It is being freed elsewhere. */
list_move(&page->lru, src);
continue;
}
--
2.23.0
\
 
 \ /
  Last update: 2021-07-10 12:05    [W:0.155 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site