From: Jesse Gross <jesse@nicira.com>
To: Dave Hansen <dave@linux.vnet.ibm.com>
Cc: Eric Paris <eparis@redhat.com>,
linux-kernel@vger.kernel.org,
David Rientjes <rientjes@google.com>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] flex_array: avoid divisions when accessing elements
Date: Mon, 2 May 2011 13:23:38 -0700 [thread overview]
Message-ID: <BANLkTimG5fuf9eEzVqsTB_TSy2B1kn5h6g@mail.gmail.com> (raw)
In-Reply-To: <1304357805.30823.18.camel@nimitz>
On Mon, May 2, 2011 at 10:36 AM, Dave Hansen <dave@linux.vnet.ibm.com> wrote:
> 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@nicira.com>
>> Cc: David Rientjes <rientjes@google.com>
>> Cc: Eric Paris <eparis@redhat.com>
>> Signed-off-by: Andrew Morton <akpm@linux-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@redhat.com>
>
> This seems sane to me, especially in the element access case.
>
> Acked-by: Dave Hansen <dave@linux.vnet.ibm.com>
Thanks Eric!
next prev parent reply other threads:[~2011-05-02 20:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 17:26 Eric Paris
2011-05-02 17:36 ` Dave Hansen
2011-05-02 20:23 ` Jesse Gross [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-04-26 20:41 [PATCH] flex_array: Avoid " Jesse Gross
2011-04-27 16:13 ` Dave Hansen
2011-04-29 1:48 ` Jesse Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTimG5fuf9eEzVqsTB_TSy2B1kn5h6g@mail.gmail.com \
--to=jesse@nicira.com \
--cc=akpm@linux-foundation.org \
--cc=dave@linux.vnet.ibm.com \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rientjes@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®