Skip to contentSkip to conversation

vmalloc_32 should use GFP_KERNEL

PATCH In review Benjamin Herrenschmidt 3 participants 4 messages Jul 18, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vmalloc_32 should use GFP_KERNEL

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.

---

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

mm/vmalloc.c +2 -2
Index: linux-work/mm/vmalloc.c
===================================================================
@@ -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 [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>

maintainer
#1 lore raw
Quoted 28 lines · On Wed, 18 Jul 2007 16:25:34 +1000 Benjamin Herrenschmidt…

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.

---

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

Index: linux-work/mm/vmalloc.c
===================================================================

mm/vmalloc.c +0 -0
@@ -578,9 +578,9 @@ void *vmalloc_exec(unsigned long size)
 }

mm/vmalloc.c void *vmalloc_exec(unsigned long size) · line 586

Quoted 10 lines
mm/vmalloc.c +2 -2
 
 #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 [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>

#2 lore raw
Quoted 3 lines · Andrew Morton

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 [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>

#3 lore raw
Quoted 8 lines · On Wed, 18 Jul 2007 16:49:14 +1000 Benjamin Herrenschmidt…
Quoted 3 lines · Andrew Morton

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