[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1217621068.3454.501.camel@pmac.infradead.org>
Date: Fri, 01 Aug 2008 21:04:28 +0100
From: David Woodhouse <dwmw2@...radead.org>
To: Jaswinder Singh <jaswinder@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] firmware: avoiding multiple replication for same
firmware file
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@...el.com Intel Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists