page based page release handler
Subsystems (4)
RFC 1/1 page based page release handler
Hi,
Attached one is a sample implementation of page-based release handler.
I wrote this with intention of enhancing memory-hotplug. This is only a RFC and I wants some comments.
When a page is isolated, it is out of the kernel memory management.
Here ,*isolated page* means
(a)a page is allocated and never freed intentionally (b)a page is set PG_reserved and out of control.
(c)a page is allocated and has no release routine.
This is enough now, and it just leaks from the kernel.
When the kernel wants to remove/move an above page, I think, the kernel has 3 ways.
(1) try to call all subsystem's release handler, one by one (the kernel doesn't know its owner)
(2) call the release handler attached to the page.
(3) give up ;(
This patch is the base of (2) and registers page release handler into pfn indexed radix-tree. Radix trees are separated into zones. I think (1) can be more complicated than (2).
If someone has an idea, plz reply.
Regards,
-- Kame
--
<<Introduction>>
In some subsystem, a page is sometimes isolated from the kernel.
*isolated* means
1. pages are allocated and never freed
2. pages are set PG_reserved and removed from the kernel's page allocator.
3. subsystem has no page release routine which can be called by the kernel's memory management system.
Now, the kernel's page allocator has no concerns for isolated pages and they are just leaked. This works enough.
Considering memory-hotplug, leaked pages cannot be removed at hot-remove. To remove all these pages, memory hot-remove has to call
all subsystem's memory release handler, which are not implemented now.
In this patch, new interface page_set_hold()/page_release() are implemented.
- page_set_hold() registers a page release handler for the page.
- page_release() calls per-page page release hander.
---
linux-2.6.12-rc6-kamezawa/include/linux/mm.h | 42 ++++++++++++ linux-2.6.12-rc6-kamezawa/include/linux/mmzone.h | 5 + linux-2.6.12-rc6-kamezawa/mm/page_alloc.c | 79 +++++++++++++++++++++++ 3 files changed, 126 insertions(+)
include/linux/mmzone.h renamed from include/linux/mmzone.h~page_hold +5 -0
@@ -13,6 +13,7 @@#include <linux/numa.h> #include <linux/init.h> #include <asm/atomic.h> +#include <linux/radix-tree.h> /* Free memory management - zoned buddy allocator. */ #ifndef CONFIG_FORCE_MAX_ZONEORDER
@@ -206,6 +207,10 @@ struct zone {unsigned long spanned_pages;/* total size, including holes */ unsigned long present_pages;/* amount of memory (excluding holes) */ +/* used for page_set_hold(). */ +rwlock_t page_holder_lock; +struct radix_tree_root page_holder; +/* * rarely used fields: */
include/linux/mm.h renamed from include/linux/mm.h~page_hold +42 -0
48 lines not on this page · raw message
mm/page_alloc.c renamed from mm/page_alloc.c~page_hold +79 -0
88 lines not on this page · raw message
_
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Lhms-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lhms-devel
--
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>