From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC] Should we create a raw input interface for IR's ? - Was: Re: [PATCH 1/3 v2] lirc core device driver infrastructure Date: Sat, 28 Nov 2009 11:43:18 +0100 Message-ID: <200911281143.18418.arnd@arndb.de> References: <4B0A765F.7010204@redhat.com> <20091128025437.GN6936@core.coreip.homeip.net> <4B10F0BC.60008@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4B10F0BC.60008@redhat.com> Sender: linux-media-owner@vger.kernel.org To: Mauro Carvalho Chehab Cc: Dmitry Torokhov , Krzysztof Halasa , Stefan Richter , Jarod Wilson , linux-kernel@vger.kernel.org, Mario Limonciello , linux-input@vger.kernel.org, linux-media@vger.kernel.org, Janne Grunau , Christoph Bartelmus List-Id: linux-input@vger.kernel.org On Saturday 28 November 2009, Mauro Carvalho Chehab wrote: > After deleting 49 keys, you'll need to add the 55 new keys. > If we do dynamic table resize for each operation, we'll do 104 > sequences of kmalloc/kfree for replacing one table. Given that kmalloc only does power-of-two allocations, you can limit the resize operations to when you go beyond the current allocation limit. You can also choose a reasonable minimum table size (e.g. 32 or 64 entries) and avoid resizes for many of the common cases entirely. Arnd <><