[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1304357805.30823.18.camel@nimitz>
Date: Mon, 02 May 2011 10:36:45 -0700
From: Dave Hansen <dave@...ux.vnet.ibm.com>
To: Eric Paris <eparis@...hat.com>
Cc: linux-kernel@...r.kernel.org, Jesse Gross <jesse@...ira.com>,
David Rientjes <rientjes@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] flex_array: avoid divisions when accessing elements
On Mon, 2011-05-02 at 13:26 -0400, Eric Paris wrote:
> On most architectures division is an expensive operation and accessing an
> element currently requires four of them. This performance penalty
> effectively precludes flex arrays from being used on any kind of fast
> path. However, two of these divisions can be handled at creation time and
> the others can be replaced by a reciprocal divide, completely avoiding
> real divisions on access.
>
> Signed-off-by: Jesse Gross <jesse@...ira.com>
> Cc: David Rientjes <rientjes@...gle.com>
> Cc: Eric Paris <eparis@...hat.com>
> Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
> [rebase on top of changes to support 0 len elements: eparis]
> [initialize part_nr when array fits entirely in base: eparis]
> Signed-off-by: Eric Paris <eparis@...hat.com>
This seems sane to me, especially in the element access case.
Acked-by: Dave Hansen <dave@...ux.vnet.ibm.com>
-- Dave
--
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