linux/block/partitions
Ming Lei ac2e5327a5 block/partitions: optimize memory allocation in check_partition()
Currently, sizeof(struct parsed_partitions) may be 64KB in 32bit arch, so
it is easy to trigger page allocation failure by check_partition,
especially in hotplug block device situation(such as, USB mass storage,
MMC card, ...), and Felipe Balbi has observed the failure.

This patch does below optimizations on the allocation of struct
parsed_partitions to try to address the issue:

- make parsed_partitions.parts as pointer so that the pointed memory can
  fit in 32KB buffer, then approximate 32KB memory can be saved

- vmalloc the buffer pointed by parsed_partitions.parts because 32KB is
  still a bit big for kmalloc

- given that many devices have the partition count limit, so only
  allocate disk_max_parts() partitions instead of 256 partitions always

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Reported-by: Felipe Balbi <balbi@ti.com>
Cc: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-02-27 19:10:21 -08:00
..
acorn.c
acorn.h
amiga.c
amiga.h
atari.c
atari.h
check.c block/partitions: optimize memory allocation in check_partition() 2013-02-27 19:10:21 -08:00
check.h block/partitions: optimize memory allocation in check_partition() 2013-02-27 19:10:21 -08:00
efi.c block/partitions/efi.c: ensure that the GPT header is at least the size of the structure. 2013-02-27 19:10:21 -08:00
efi.h
ibm.c s390/partitions: make partition detection independent from DASD ioctls 2012-09-26 15:45:05 +02:00
ibm.h
karma.c
karma.h
Kconfig partitions: enable EFI/GPT support by default 2012-12-06 14:34:58 +01:00
ldm.c
ldm.h
mac.c block/partitions/mac.c: obey the state->limit constraint 2013-02-27 19:10:21 -08:00
mac.h
Makefile
msdos.c block/partition/msdos: detect AIX formatted disks even without 55aa 2013-02-27 19:10:21 -08:00
msdos.h
osf.c
osf.h
sgi.c
sgi.h
sun.c
sun.h
sysv68.c
sysv68.h
ultrix.c
ultrix.h