diff options
author | Baolin Wang <baolin.wang@linux.alibaba.com> | 2023-02-15 11:39:35 +0100 |
---|---|---|
committer | Andrew Morton <akpm@linux-foundation.org> | 2023-02-20 21:46:17 +0100 |
commit | f7f9c00dfafffd7a5a1a5685e2d874c64913e2ed (patch) | |
tree | c0a13cfa7a2606526ddce994d1ed3a1bf9d7989c /mm/khugepaged.c | |
parent | mm: change to return bool for folio_isolate_lru() (diff) | |
download | linux-f7f9c00dfafffd7a5a1a5685e2d874c64913e2ed.tar.xz linux-f7f9c00dfafffd7a5a1a5685e2d874c64913e2ed.zip |
mm: change to return bool for isolate_lru_page()
The isolate_lru_page() can only return 0 or -EBUSY, and most users did not
care about the negative error of isolate_lru_page(), except one user in
add_page_for_migration(). So we can convert the isolate_lru_page() to
return a boolean value, which can help to make the code more clear when
checking the return value of isolate_lru_page().
Also convert all users' logic of checking the isolation state.
No functional changes intended.
Link: https://lkml.kernel.org/r/3074c1ab628d9dbf139b33f248a8bc253a3f95f0.1676424378.git.baolin.wang@linux.alibaba.com
Signed-off-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: SeongJae Park <sj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/khugepaged.c')
-rw-r--r-- | mm/khugepaged.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 15eebab0fbb5..987281ead49e 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -636,7 +636,7 @@ static int __collapse_huge_page_isolate(struct vm_area_struct *vma, * Isolate the page to avoid collapsing an hugepage * currently in use by the VM. */ - if (isolate_lru_page(page)) { + if (!isolate_lru_page(page)) { unlock_page(page); result = SCAN_DEL_PAGE_LRU; goto out; |