[PATCH] mm: reposition zbud page in lru list if not freed in zbud_free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reposition zbud page in the lru list of the pool if the zbud page
is not freed in zbud_free.

Signed-off-by: Wang Sheng-Hui <shhuiw@xxxxxxxxx>
---
 mm/zbud.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/zbud.c b/mm/zbud.c
index f26e7fc..b1d7777 100644
--- a/mm/zbud.c
+++ b/mm/zbud.c
@@ -432,15 +432,16 @@ void zbud_free(struct zbud_pool *pool, unsigned long handle)
 	/* Remove from existing buddy list */
 	list_del(&zhdr->buddy);
 
+	list_del(&zhdr->lru);
 	if (zhdr->first_chunks == 0 && zhdr->last_chunks == 0) {
 		/* zbud page is empty, free */
-		list_del(&zhdr->lru);
 		free_zbud_page(zhdr);
 		pool->pages_nr--;
 	} else {
 		/* Add to unbuddied list */
 		freechunks = num_free_chunks(zhdr);
 		list_add(&zhdr->buddy, &pool->unbuddied[freechunks]);
+		list_add(&zhdr->lru, &pool->lru);
 	}
 
 	spin_unlock(&pool->lock);
-- 
1.8.3.2

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]