linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] vmalloc_32 should use GFP_KERNEL
@ 2007-07-18  6:25 Benjamin Herrenschmidt
  2007-07-18  6:33 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-18  6:25 UTC (permalink / raw)
  To: Linux Kernel list; +Cc: linux-mm, Dave Airlie, Andrew Morton

I've noticed lots of failures of vmalloc_32 on machines where it
shouldn't have failed unless it was doing an atomic operation.

Looking closely, I noticed that:

#if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
#define GFP_VMALLOC32 GFP_DMA32
#elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
#define GFP_VMALLOC32 GFP_DMA
#else
#define GFP_VMALLOC32 GFP_KERNEL
#endif

Which seems to be incorrect, it should always -or- in the DMA flags
on top of GFP_KERNEL, thus this patch.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---

This fixes frequent errors launchin X with the nouveau DRM for example.

Index: linux-work/mm/vmalloc.c
===================================================================
--- linux-work.orig/mm/vmalloc.c	2007-07-18 16:22:00.000000000 +1000
+++ linux-work/mm/vmalloc.c	2007-07-18 16:22:11.000000000 +1000
@@ -578,9 +578,9 @@ void *vmalloc_exec(unsigned long size)
 }
 
 #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
-#define GFP_VMALLOC32 GFP_DMA32
+#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
 #elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
-#define GFP_VMALLOC32 GFP_DMA
+#define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL
 #else
 #define GFP_VMALLOC32 GFP_KERNEL
 #endif


--
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:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmalloc_32 should use GFP_KERNEL
  2007-07-18  6:25 [PATCH] vmalloc_32 should use GFP_KERNEL Benjamin Herrenschmidt
@ 2007-07-18  6:33 ` Andrew Morton
  2007-07-18  6:49   ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2007-07-18  6:33 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Linux Kernel list, linux-mm, Dave Airlie, Andi Kleen

On Wed, 18 Jul 2007 16:25:34 +1000 Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> I've noticed lots of failures of vmalloc_32 on machines where it
> shouldn't have failed unless it was doing an atomic operation.
> 
> Looking closely, I noticed that:
> 
> #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
> #define GFP_VMALLOC32 GFP_DMA32
> #elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
> #define GFP_VMALLOC32 GFP_DMA
> #else
> #define GFP_VMALLOC32 GFP_KERNEL
> #endif
> 
> Which seems to be incorrect, it should always -or- in the DMA flags
> on top of GFP_KERNEL, thus this patch.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
> 
> This fixes frequent errors launchin X with the nouveau DRM for example.
> 
> Index: linux-work/mm/vmalloc.c
> ===================================================================
> --- linux-work.orig/mm/vmalloc.c	2007-07-18 16:22:00.000000000 +1000
> +++ linux-work/mm/vmalloc.c	2007-07-18 16:22:11.000000000 +1000
> @@ -578,9 +578,9 @@ void *vmalloc_exec(unsigned long size)
>  }
>  
>  #if defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA32)
> -#define GFP_VMALLOC32 GFP_DMA32
> +#define GFP_VMALLOC32 GFP_DMA32 | GFP_KERNEL
>  #elif defined(CONFIG_64BIT) && defined(CONFIG_ZONE_DMA)
> -#define GFP_VMALLOC32 GFP_DMA
> +#define GFP_VMALLOC32 GFP_DMA | GFP_KERNEL
>  #else
>  #define GFP_VMALLOC32 GFP_KERNEL
>  #endif
> 

whoops, yes.

Are those errors serious and common enough for 2.6.22.x?  

--
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:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmalloc_32 should use GFP_KERNEL
  2007-07-18  6:33 ` Andrew Morton
@ 2007-07-18  6:49   ` Benjamin Herrenschmidt
  2007-07-18 10:54     ` Alan Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Herrenschmidt @ 2007-07-18  6:49 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Linux Kernel list, linux-mm, Dave Airlie, Andi Kleen

On Tue, 2007-07-17 at 23:33 -0700, Andrew Morton wrote:
> whoops, yes.
> 
> Are those errors serious and common enough for 2.6.22.x?  

No idea, so far, the nouveau DRM isn't something I would recommend to
people to use in stable environments but heh... I don't know who else
uses vmalloc_32.

Cheers,
Ben.

--
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:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] vmalloc_32 should use GFP_KERNEL
  2007-07-18  6:49   ` Benjamin Herrenschmidt
@ 2007-07-18 10:54     ` Alan Cox
  0 siblings, 0 replies; 4+ messages in thread
From: Alan Cox @ 2007-07-18 10:54 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: Andrew Morton, Linux Kernel list, linux-mm, Dave Airlie, Andi Kleen

On Wed, 18 Jul 2007 16:49:14 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:

> On Tue, 2007-07-17 at 23:33 -0700, Andrew Morton wrote:
> > whoops, yes.
> > 
> > Are those errors serious and common enough for 2.6.22.x?  
> 
> No idea, so far, the nouveau DRM isn't something I would recommend to
> people to use in stable environments but heh... I don't know who else
> uses vmalloc_32.

Mostly older video capture.

Alan

--
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:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2007-07-18 10:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18  6:25 [PATCH] vmalloc_32 should use GFP_KERNEL Benjamin Herrenschmidt
2007-07-18  6:33 ` Andrew Morton
2007-07-18  6:49   ` Benjamin Herrenschmidt
2007-07-18 10:54     ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox