* PageReserved increment patch
@ 2004-04-23 18:31 Bradley Christiansen
0 siblings, 0 replies; only message in thread
From: Bradley Christiansen @ 2004-04-23 18:31 UTC (permalink / raw)
To: linux-mm
Here is a short patch that addresses a problem I found where page->count
gets incremented for all pages in page_cache_get/get_page, but in
put_page it is only decremented for non reserved pages.
I noticed this problem while trying to keep track of how memory is
allocated and noticing that the zero page count variable was continually
being incremented but never decremented. This created some very large
counts on the zero page, and while this probably wont hurt anything it
just doesn't seem like its right.
This patch only fixes the problem I know of with the zero page, and
there is still a potential imbalance for any reserved page calling
page_cache_get/get_page.
Brad
--- linux-2.6.4/mm/memory.c Wed Mar 10 18:55:26 2004
+++ linux-2.6.4-brad/mm/memory.c Thu Apr 22 16:00:38 2004
@@ -1050,7 +1050,9 @@
/*
* Ok, we need to copy. Oh, well..
*/
- page_cache_get(old_page);
+ if (!PageReserved(old_page))
+ page_cache_get(old_page);
+
spin_unlock(&mm->page_table_lock);
pte_chain = pte_chain_alloc(GFP_KERNEL);
--
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:"aart@kvack.org"> aart@kvack.org </a>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-04-23 18:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 18:31 PageReserved increment patch Bradley Christiansen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox