Skip to contentSkip to conversation

zswap: init under_reclaim

PATCH New Seth Jennings 1 participant 1 message Jun 13, 2013 Memory management

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 zswap: init under_reclaim

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.

---
 mm/zbud.c |    1 +
 1 file changed, 1 insertion(+)
mm/zbud.c +1 -0
index d63ae6e..9bb4710 100644
@@ -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;
 }
 
Signature · 7 lines
1.7.9.5

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