From 68151379419236151cf8eb10c342d366ebd9d1bb Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Wed, 3 Oct 2007 20:42:46 -0700 Subject: [PATCH] vcompound: Virtual compound page freeing in interrupt context If we are in an interrupt context then simply defer the free via a workqueue. Removing a virtual mappping *must* be done with interrupts enabled since tlb_xx functions are called that rely on interrupts for processor to processor communications. Signed-off-by: Christoph Lameter --- mm/page_alloc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) Index: linux-2.6.25-rc3-mm1/mm/page_alloc.c =================================================================== --- linux-2.6.25-rc3-mm1.orig/mm/page_alloc.c 2008-03-04 16:50:32.298527600 -0800 +++ linux-2.6.25-rc3-mm1/mm/page_alloc.c 2008-03-04 16:52:10.430578251 -0800 @@ -339,10 +339,20 @@ static void __free_vcompound(void *addr) kfree(pages); } +static void vcompound_free_work(struct work_struct *w) +{ + __free_vcompound((void *)w); +} static void free_vcompound(void *addr) { - __free_vcompound(addr); + struct work_struct *w = addr; + + if (irqs_disabled() || in_interrupt()) { + INIT_WORK(w, vcompound_free_work); + schedule_work(w); + } else + __free_vcompound(w); } static void free_compound_page(struct page *page)