[SRU][Trusty][PATCH 2/2] mm/balloon_compaction: fix deflation when compaction is disabled

Gavin Guo gavin.guo at canonical.com
Mon May 16 06:43:12 UTC 2016


From: Konstantin Khlebnikov <k.khlebnikov at samsung.com>

BugLink: http://bugs.launchpad.net/bugs/1572562

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: d6d86c0a7f8d ("mm/balloon_compaction: redesign ballooned pages management").
Signed-off-by: Konstantin Khlebnikov <k.khlebnikov at samsung.com>
Reported-by: Matt Mullins <mmullins at mmlx.us>
Cc: <stable at vger.kernel.org>	[3.17]
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
(cherry picked from commit 4d88e6f7d5ffc84e6094a47925870f4a130555c2)
Signed-off-by: Gavin Guo <gavin.guo at canonical.com>
---
 mm/balloon_compaction.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/balloon_compaction.c b/mm/balloon_compaction.c
index fcdbe0cec955..65f9c733bc2d 100644
--- a/mm/balloon_compaction.c
+++ b/mm/balloon_compaction.c
@@ -94,11 +94,13 @@ struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info)
 		 * to be released by the balloon driver.
 		 */
 		if (trylock_page(page)) {
+#ifdef CONFIG_BALLOON_COMPACTION
 			if (!PagePrivate(page)) {
 				/* raced with isolation */
 				unlock_page(page);
 				continue;
 			}
+#endif
 			spin_lock_irqsave(&b_dev_info->pages_lock, flags);
 			balloon_page_delete(page);
 			spin_unlock_irqrestore(&b_dev_info->pages_lock, flags);
-- 
2.0.0





More information about the kernel-team mailing list