diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-10 13:30:45 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-10 13:30:45 -0700 |
commit | 8a1629c771b1a60bc6d73394d869fe69b13200dc (patch) | |
tree | 12f68138d95b70d450ab418fdfb300ebdcd2f003 /fs/file.c | |
parent | 04aebcbb1b6dccadc8862b2765265f65a946db57 (diff) | |
parent | 693d92a1bbc9e42681c42ed190bd42b636ca876f (diff) |
Merge branch 2.6.39-rc7 into usb-linus
This was needed to resolve a conflict in:
drivers/usb/host/isp1760-hcd.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/file.c')
-rw-r--r-- | fs/file.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/fs/file.c b/fs/file.c index 0be344755c0..4c6992d8f3b 100644 --- a/fs/file.c +++ b/fs/file.c @@ -9,6 +9,7 @@ #include <linux/module.h> #include <linux/fs.h> #include <linux/mm.h> +#include <linux/mmzone.h> #include <linux/time.h> #include <linux/sched.h> #include <linux/slab.h> @@ -39,14 +40,17 @@ int sysctl_nr_open_max = 1024 * 1024; /* raised later */ */ static DEFINE_PER_CPU(struct fdtable_defer, fdtable_defer_list); -static inline void *alloc_fdmem(unsigned int size) +static void *alloc_fdmem(unsigned int size) { - void *data; - - data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN); - if (data != NULL) - return data; - + /* + * Very large allocations can stress page reclaim, so fall back to + * vmalloc() if the allocation size will be considered "large" by the VM. + */ + if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) { + void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN); + if (data != NULL) + return data; + } return vmalloc(size); } |