linux/include
Grant Erickson 33b53716bc mtd: create function to perform large allocations
Introduce a common function to handle large, contiguous kmalloc buffer
allocations by exponentially backing off on the size of the requested
kernel transfer buffer until it succeeds or until the requested
transfer buffer size falls below the page size.

This helps ensure the operation can succeed under low-memory, highly-
fragmented situations albeit somewhat more slowly.

Artem: so this patch solves the problem that the kernel tries to kmalloc too
large buffers, which (a) may fail and does fail - people complain about this,
and (b) slows down the system in case of high memory fragmentation, because
the kernel starts dropping caches, writing back, swapping, etc. But we do not
really have to allocate a lot of memory to do the I/O, we may do this even with
as little as one min. I/O unit (NAND page) of RAM. So the idea of this patch is
that if the user asks to read or write a lot, we try to kmalloc a lot, with GFP
flags which make the kernel _not_ drop caches, etc. If we can allocate it - good,
if not - we try to allocate twice as less, and so on, until we reach the min.
I/O unit size, which is our last resort allocation and use the normal
GFP_KERNEL flag.

Artem: re-write the allocation function so that it makes sure the allocated
buffer is aligned to the min. I/O size of the flash.

Signed-off-by: Grant Erickson <marathon96@gmail.com>
Tested-by: Ben Gardiner <bengardiner@nanometrics.ca>
Tested-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2011-05-25 01:59:43 +01:00
..
acpi Fix common misspellings 2011-03-31 11:26:23 -03:00
asm-generic Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
crypto crypto: padlock - Move padlock.h into include/crypto 2011-01-07 14:52:00 +11:00
drm drm: Take lock around probes for drm_fb_helper_hotplug_event 2011-05-16 12:01:43 +10:00
keys libceph: Create a new key type "ceph". 2011-03-29 12:11:24 -07:00
linux mtd: create function to perform large allocations 2011-05-25 01:59:43 +01:00
math-emu
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-04-27 15:17:52 -07:00
mtd
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2011-05-13 15:20:51 -07:00
pcmcia pcmcia: re-enable Zoomed Video support 2011-02-20 12:47:34 +01:00
rdma RDMA: Update workqueue usage 2011-01-16 21:16:31 -08:00
rxrpc Fix common misspellings 2011-03-31 11:26:23 -03:00
scsi scsi: remove performance regression due to async queue run 2011-05-17 11:04:44 +02:00
sound Merge branch 'for-linus2' of git://git.profusion.mobi/users/lucas/linux-2.6 2011-04-07 11:14:49 -07:00
staging [media] Altera FPGA firmware download module 2011-03-21 20:32:16 -03:00
target Fix common misspellings 2011-03-31 11:26:23 -03:00
trace mm: tracing: add missing GFP flags to tracing 2011-05-11 18:50:45 -07:00
video Fix common misspellings 2011-03-31 11:26:23 -03:00
xen Fix common misspellings 2011-03-31 11:26:23 -03:00
Kbuild