linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] zswap: init under_reclaim
@ 2013-06-13 19:19 Seth Jennings
  0 siblings, 0 replies; only message in thread
From: Seth Jennings @ 2013-06-13 19:19 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Seth Jennings, Bob Liu, linux-mm, linux-kernel

Bob Liu reported a memory leak in zswap.  This was due to the
under_reclaim field in the zbud header not being initialized
to 0, which resulted in zbud_free() not freeing the page
under the false assumption that the page was undergoing
zbud reclaim.

This patch properly initializes the under_reclaim field.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Reported-by: Bob Liu <bob.liu@oracle.com>
---
 mm/zbud.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/zbud.c b/mm/zbud.c
index d63ae6e..9bb4710 100644
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -138,6 +138,7 @@ static struct zbud_header *init_zbud_page(struct page *page)
 	zhdr->last_chunks = 0;
 	INIT_LIST_HEAD(&zhdr->buddy);
 	INIT_LIST_HEAD(&zhdr->lru);
+	zhdr->under_reclaim = 0;
 	return zhdr;
 }
 
-- 
1.7.9.5

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-13 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-13 19:19 [PATCH] zswap: init under_reclaim Seth Jennings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).