Commit 1f649733 authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Jiri Slaby

mm/balloon_compaction: fix deflation when compaction is disabled

commit 4d88e6f7 upstream.

If CONFIG_BALLOON_COMPACTION=n balloon_page_insert() does not link pages
with balloon and doesn't set PagePrivate flag, as a result
balloon_page_dequeue() cannot get any pages because it thinks that all
of them are isolated.  Without balloon compaction nobody can isolate
ballooned pages.  It's safe to remove this check.

Fixes: d6d86c0a ("mm/balloon_compaction: redesign ballooned pages management").
Signed-off-by: default avatarKonstantin Khlebnikov <k.khlebnikov@samsung.com>
Reported-by: default avatarMatt Mullins <mmullins@mmlx.us>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Gavin Guo <gavin.guo@canonical.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 33904d89
...@@ -93,11 +93,13 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info) ...@@ -93,11 +93,13 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info)
* to be released by the balloon driver. * to be released by the balloon driver.
*/ */
if (trylock_page(page)) { if (trylock_page(page)) {
#ifdef CONFIG_BALLOON_COMPACTION
if (!PagePrivate(page)) { if (!PagePrivate(page)) {
/* raced with isolation */ /* raced with isolation */
unlock_page(page); unlock_page(page);
continue; continue;
} }
#endif
spin_lock_irqsave(&b_dev_info->pages_lock, flags); spin_lock_irqsave(&b_dev_info->pages_lock, flags);
balloon_page_delete(page); balloon_page_delete(page);
spin_unlock_irqrestore(&b_dev_info->pages_lock, flags); spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
......
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