All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled
@ 2005-04-19 17:04 Martin Hicks
  2005-04-19 18:30 ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Hicks @ 2005-04-19 17:04 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, holt


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

Signed-off-by:  Martin Hicks <mort@sgi.com>


Index: linux-2.6.12-rc2.wk/include/asm-ia64/pgalloc.h
===================================================================
--- linux-2.6.12-rc2.wk.orig/include/asm-ia64/pgalloc.h	2005-04-19 09:01:06.000000000 -0700
+++ linux-2.6.12-rc2.wk/include/asm-ia64/pgalloc.h	2005-04-19 09:53:39.000000000 -0700
@@ -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();

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled
  2005-04-19 17:04 [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled Martin Hicks
@ 2005-04-19 18:30 ` David S. Miller
  2005-04-19 18:47   ` Martin Hicks
  0 siblings, 1 reply; 4+ messages in thread
From: David S. Miller @ 2005-04-19 18:30 UTC (permalink / raw)
  To: Martin Hicks; +Cc: akpm, linux-kernel, holt

On Tue, 19 Apr 2005 13:04:13 -0400
Martin Hicks <mort@sgi.com> wrote:

> 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

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 */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled
  2005-04-19 18:30 ` David S. Miller
@ 2005-04-19 18:47   ` Martin Hicks
  2005-04-19 18:52     ` David S. Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Hicks @ 2005-04-19 18:47 UTC (permalink / raw)
  To: David S. Miller; +Cc: Andrew Morton, holt, linux-kernel


On Tue, Apr 19, 2005 at 11:30:44AM -0700, David S. Miller wrote:
> 
> 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

Signed-off-by:  Martin Hicks <mort@sgi.com>


 pgalloc.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6.12-rc2.wk/include/asm-ia64/pgalloc.h
===================================================================
--- linux-2.6.12-rc2.wk.orig/include/asm-ia64/pgalloc.h	2005-04-19 10:13:16.000000000 -0700
+++ linux-2.6.12-rc2.wk/include/asm-ia64/pgalloc.h	2005-04-19 11:40:09.000000000 -0700
@@ -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;
 }
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled
  2005-04-19 18:47   ` Martin Hicks
@ 2005-04-19 18:52     ` David S. Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David S. Miller @ 2005-04-19 18:52 UTC (permalink / raw)
  To: Martin Hicks; +Cc: akpm, holt, linux-kernel

On Tue, 19 Apr 2005 14:47:58 -0400
Martin Hicks <mort@wildopensource.com> wrote:

> Okay, here's an updated patch.

Looks great.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-04-19 18:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-19 17:04 [PATCH] pgtables: fix GFP_KERNEL allocation with preempt disabled Martin Hicks
2005-04-19 18:30 ` David S. Miller
2005-04-19 18:47   ` Martin Hicks
2005-04-19 18:52     ` David S. Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.