]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: speed up request_firmware(), v3
authorDavid Woodhouse <dwmw2@infradead.org>
Fri, 10 Apr 2009 05:04:07 +0000 (22:04 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 15 May 2009 11:51:29 +0000 (12:51 +0100)
commita072ec61aa1aa734e34f5ff9002f3330c81474a6
tree5a2c61945ea2fad720e7a18b061dd31303a28523
parent334dcf3687580e3aab1ff315da763471db5f3932
firmware: speed up request_firmware(), v3

Rather than calling vmalloc() repeatedly to grow the firmware image as
we receive data from userspace, just allocate and fill individual pages.
Then vmap() the whole lot in one go when we're done.

A quick test with a 337KiB iwlagn firmware shows the time taken for
request_firmware() going from ~32ms to ~5ms after I apply this patch.

[v2: define PAGE_KERNEL_RO as PAGE_KERNEL where necessary, use min_t()]
[v3: kunmap() takes the struct page *, not the virtual address]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Tested-by: Sachin Sant <sachinp@in.ibm.com>
drivers/base/firmware_class.c