Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-02-01 Thread Ming Lei
On Fri, Feb 1, 2013 at 4:33 PM, Yasuaki Ishimatsu wrote: > At least, you should use release_partitions() instead of kfree() here. Good catch, thank you for pointing it out, and I will post v1 later with the update. Thanks, -- Ming Lei -- To unsubscribe from this list: send the line

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-02-01 Thread Yasuaki Ishimatsu
2013/02/01 12:07, Ming Lei wrote: > 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

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-02-01 Thread Yasuaki Ishimatsu
2013/02/01 12:07, Ming Lei wrote: 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

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-02-01 Thread Ming Lei
On Fri, Feb 1, 2013 at 4:33 PM, Yasuaki Ishimatsu isimatu.yasu...@jp.fujitsu.com wrote: At least, you should use release_partitions() instead of kfree() here. Good catch, thank you for pointing it out, and I will post v1 later with the update. Thanks, -- Ming Lei -- To unsubscribe from this

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Ming Lei
On Fri, Feb 1, 2013 at 11:20 AM, Joe Perches wrote: >> @@ -15,13 +15,15 @@ struct parsed_partitions { >> int flags; >> bool has_info; >> struct partition_meta_info info; >> - } parts[DISK_MAX_PARTS]; >> + } *parts; > > This is relatively unusual

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Joe Perches
On Fri, 2013-02-01 at 11:07 +0800, Ming Lei wrote: > Currently, sizeof(struct parsed_partitions) may be 64KB in 32bit arch, > so it is easy to trigger page allocation failure by check_partition, [] > This patch does below optimizations on the allocation of struct > parsed_partitions to try to

[PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Ming Lei
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

[PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Ming Lei
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

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Joe Perches
On Fri, 2013-02-01 at 11:07 +0800, Ming Lei wrote: Currently, sizeof(struct parsed_partitions) may be 64KB in 32bit arch, so it is easy to trigger page allocation failure by check_partition, [] This patch does below optimizations on the allocation of struct parsed_partitions to try to address

Re: [PATCH] block: partition: optimize memory allocation in check_partition

2013-01-31 Thread Ming Lei
On Fri, Feb 1, 2013 at 11:20 AM, Joe Perches j...@perches.com wrote: @@ -15,13 +15,15 @@ struct parsed_partitions { int flags; bool has_info; struct partition_meta_info info; - } parts[DISK_MAX_PARTS]; + } *parts; This is relatively unusual