pgtables: fix GFP_KERNEL allocation with preempt disabled
PATCH 1/1 pgtables: fix GFP_KERNEL allocation with preempt disabled
Hi Andrew,
This is a fix to the pgtable_quicklist code. There is a GFP_KERNEL allocation in pgtable_quicklist_alloc(), which spews the usual warnings if the kernel is under heavy VM pressure and the reclaim code is invoked.
This patch is against 2.6.12-rc2-mm2
include/asm-ia64/pgalloc.h +1 -1
@@ -50,7 +50,7 @@ static inline void *pgtable_quicklist_al ret[0 ] =0 ; --pgtable_quicklist_size; }else { - ret = (unsigned long *)__get_free_page (GFP_KERNEL | __GFP_ZERO); + ret = (unsigned long *)__get_free_page (GFP_ATOMIC | __GFP_ZERO); }preempt_enable ();
Quoted 6 lines · On Tue, 19 Apr 2005 13:04:13 -0400 Martin Hicks <[email protected]> wrote:
This is a fix to the
pgtable_quicklistcode. There is aGFP_KERNELallocation inpgtable_quicklist_alloc(), which spews the usual warnings if the kernel is under heavy VM pressure and the reclaim code is invoked.This patch is against 2.6.12-rc2-mm2
I think you should really drop the preempt disable during this allocation instead, that's what we do in the sparc64 quicklist code.
It's very simple, change the code to:
preempt_enable();
} else {
preempt_enable();
ret = (unsigned long *) ...;
}
/* preempt_enable() no longer here */Quoted 4 lines · David S. Miller
I think you should really drop the preempt disable during this allocation instead, that's what we do in the sparc64 quicklist code.
Okay, here's an updated patch.
Hi Andrew,
This is a fix to the pgtable_quicklist code. There is a GFP_KERNEL allocation in pgtable_quicklist_alloc(), which spews the usual warnings if the kernel is under heavy VM pressure and the reclaim code is invoked. re-enable preempt before we allocate the new page.
This patch is against 2.6.12-rc2-mm2
pgalloc.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
include/asm-ia64/pgalloc.h +2 -2
@@ -49,12 +49,12 @@ static inline void *pgtable_quicklist_al pgtable_quicklist = (unsigned long *)(*ret); ret[0 ] =0 ; --pgtable_quicklist_size; +preempt_enable (); }else { +preempt_enable (); ret = (unsigned long *)__get_free_page (GFP_KERNEL | __GFP_ZERO); } -preempt_enable (); -return ret; }
Quoted 1 line · On Tue, 19 Apr 2005 14:47:58 -0400 Martin Hicks <[email protected]> wrote:
Okay, here's an updated patch.
Looks great.