Commit bd486285 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Linus Torvalds
Browse files

mem-hwpoison: fix page refcount around isolate_lru_page()

Drop first page reference only after calling isolate_lru_page() to keep
page stable reference while isolating.
Signed-off-by: default avatarKonstantin Khlebnikov <>
Cc: Andi Kleen <>
Cc: KAMEZAWA Hiroyuki <>
Cc: KOSAKI Motohiro <>
Cc: Mel Gorman <>
Cc: Lee Schermerhorn <>
Cc: Rik van Riel <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 700c2a46
......@@ -1440,16 +1440,12 @@ int soft_offline_page(struct page *page, int flags)
ret = invalidate_inode_page(page);
* Drop count because page migration doesn't like raised
* counts. The page could get re-allocated, but if it becomes
* LRU the isolation will just fail.
* RED-PEN would be better to keep it isolated here, but we
* would need to fix isolation locking first.
if (ret == 1) {
ret = 0;
pr_info("soft_offline: %#lx: invalidated\n", pfn);
goto done;
......@@ -1461,6 +1457,11 @@ int soft_offline_page(struct page *page, int flags)
* handles a large number of cases for us.
ret = isolate_lru_page(page);
* Drop page reference which is came from get_any_page()
* successful isolate_lru_page() already took another one.
if (!ret) {
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