]> git.baikalelectronics.ru Git - kernel.git/commit
vfs: avoid large kmalloc()s for the fdtable
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 27 Apr 2011 22:26:41 +0000 (15:26 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Apr 2011 18:28:20 +0000 (11:28 -0700)
commit149a40180cc104f220d38b09465bb0f25723c97c
tree4d199a330cfe8710de0deb4e805a798c2982501c
parented22b07dbfe414862647bd008401f89e81f60bf3
vfs: avoid large kmalloc()s for the fdtable

Azurit reports large increases in system time after 2.6.36 when running
Apache.  It was bisected down to c3b11abedbc7329dca1 ("vfs: use kmalloc()
to allocate fdmem if possible").

That patch caused the vfs to use kmalloc() for very large allocations and
this is causing excessive work (and presumably excessive reclaim) within
the page allocator.

Fix it by falling back to vmalloc() earlier - when the allocation attempt
would have been considered "costly" by reclaim.

Reported-by: azurIt <azurit@pobox.sk>
Tested-by: azurIt <azurit@pobox.sk>
Acked-by: Changli Gao <xiaosuo@gmail.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Mel Gorman <mel@csn.ul.ie>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/file.c