Messages in this thread | | | Subject | Re: [PATCH] firmware: avoiding multiple replication for same firmware file | From | David Woodhouse <> | Date | Fri, 01 Aug 2008 21:04:28 +0100 |
| |
On Fri, 2008-08-01 at 11:30 +0530, Jaswinder Singh wrote: > Now when request_firmware will be called it will check whether firmware > is already allocated or not. If already allocated then it provide handle > of old firmware handle and increase count of firmware. > > release_firmware will decrease count of firmware, if count is one only then > firmware will be release.
I like this. It means that when you have multiple similar devices, you only need one copy of the firmware in memory for _all_ of them. Because we've now made fw->data constant, we know it's safe to share them now.
I wonder if we should change the implementation of 'built-in firmware' to use your new implementation -- just set the use count on the built-in firmware to 1 when we start up, and then it should never go away.
Unless we're _really_ clever with linker tricks it would mean we'd have an init function which takes the built-in stuff and builds it into the linked list, but I think that might be worth the runtime simplification.
-- David Woodhouse Open Source Technology Centre David.Woodhouse@intel.com Intel Corporation
| |