linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch] fix hugetlb page allocation leak
@ 2007-07-24  0:11 Ken Chen
  2007-07-24  0:20 ` Andrew Morton
  0 siblings, 1 reply; 7+ messages in thread
From: Ken Chen @ 2007-07-24  0:11 UTC (permalink / raw)
  To: Randy Dunlap, Andrew Morton; +Cc: linux-mm

dequeue_huge_page() has a serious memory leak upon hugetlb page
allocation.  The for loop continues on allocating hugetlb pages out of
all allowable zone, where this function is supposedly only dequeue one
and only one pages.

Fixed it by breaking out of the for loop once a hugetlb page is found.


Signed-off-by: Ken Chen <kenchen@google.com>

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index f127940..d7ca59d 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -84,6 +84,7 @@ static struct page *dequeue_huge_page(st
 			list_del(&page->lru);
 			free_huge_pages--;
 			free_huge_pages_node[nid]--;
+			break;
 		}
 	}
 	return page;

--
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	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-24 17:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-24  0:11 [patch] fix hugetlb page allocation leak Ken Chen
2007-07-24  0:20 ` Andrew Morton
2007-07-24  2:48   ` Randy Dunlap
2007-07-24 17:13     ` Mel Gorman
2007-07-24 15:44   ` Nish Aravamudan
2007-07-24 16:51     ` Andrew Morton
2007-07-24 16:57       ` Nish Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox