From 8ef0df5326463c39000b3367f56ed9f98f2fc938 Mon Sep 17 00:00:00 2001 From: green Date: Fri, 18 Mar 2005 10:54:54 +0000 Subject: [PATCH] r=braam Fix 2.4 uml to use vmalloc instead of kmalloc for internal allocations, because kmalloc has 128k limit and e.g. readdir in glibc exceeds this. --- lustre/kernel_patches/patches/uml_malloc_fix.patch | 54 ++++++++++++++++++++++ lustre/kernel_patches/series/vanilla-2.4.24 | 1 + 2 files changed, 55 insertions(+) create mode 100644 lustre/kernel_patches/patches/uml_malloc_fix.patch diff --git a/lustre/kernel_patches/patches/uml_malloc_fix.patch b/lustre/kernel_patches/patches/uml_malloc_fix.patch new file mode 100644 index 0000000..cba2993 --- /dev/null +++ b/lustre/kernel_patches/patches/uml_malloc_fix.patch @@ -0,0 +1,54 @@ +--- uml-2.4/arch/um/kernel/process_kern.c.orig 2004-04-15 23:26:49.000000000 +0300 ++++ uml-2.4/arch/um/kernel/process_kern.c 2004-04-15 23:49:38.312250576 +0300 +@@ -16,6 +16,7 @@ + #include "linux/module.h" + #include "linux/init.h" + #include "linux/capability.h" ++#include "linux/vmalloc.h" + #include "asm/unistd.h" + #include "asm/mman.h" + #include "asm/segment.h" +@@ -279,6 +280,11 @@ void *um_kmalloc(int size) + return(kmalloc(size, GFP_KERNEL)); + } + ++void *um_vmalloc(int size) ++{ ++ return(vmalloc(size)); ++} ++ + void *um_kmalloc_atomic(int size) + { + return(kmalloc(size, GFP_ATOMIC)); +--- uml-2.4/arch/um/main.c.orig 2004-04-15 23:58:28.786606216 +0300 ++++ uml-2.4/arch/um/main.c 2004-04-15 23:53:32.706617216 +0300 +@@ -161,7 +161,7 @@ extern void *__real_malloc(int); + void *__wrap_malloc(int size) + { + if(CAN_KMALLOC()) +- return(um_kmalloc(size)); ++ return(um_vmalloc(size)); + else + return(__real_malloc(size)); + } +@@ -179,7 +179,7 @@ extern void __real_free(void *); + + void __wrap_free(void *ptr) + { +- if(CAN_KMALLOC()) kfree(ptr); ++ if(CAN_KMALLOC()) vfree(ptr); + else __real_free(ptr); + } + +--- uml-2.4/arch/um/include/user.h.orig 2004-04-15 23:41:57.000000000 +0300 ++++ uml-2.4/arch/um/include/user.h 2004-04-15 23:41:34.000000000 +0300 +@@ -12,6 +12,7 @@ extern void schedule(void); + extern void *um_kmalloc(int size); + extern void *um_kmalloc_atomic(int size); + extern void kfree(void *ptr); ++extern void vfree(void *ptr); + extern int in_aton(char *str); + extern int open_gdb_chan(void); + + + diff --git a/lustre/kernel_patches/series/vanilla-2.4.24 b/lustre/kernel_patches/series/vanilla-2.4.24 index e2b69da..a2d6649 100644 --- a/lustre/kernel_patches/series/vanilla-2.4.24 +++ b/lustre/kernel_patches/series/vanilla-2.4.24 @@ -44,3 +44,4 @@ export-show_task-2.4-vanilla.patch export-zap-page-range.patch uml-sigusr1-2.4-vanilla.patch remove-suid-2.4-rhel.patch +uml_malloc_fix.patch -- 1.8.3.1