From: Dave Hansen <dave@linux.vnet.ibm.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org
Subject: Re: [RFC][PATCH] flex_array: conditionally optimize out divides
Date: Tue, 18 Aug 2009 14:30:25 -0700 [thread overview]
Message-ID: <1250631025.7335.996.camel@nimitz> (raw)
In-Reply-To: <e9c3a7c20908181102q6db970bav737cf26939f84c4c@mail.gmail.com>
On Tue, 2009-08-18 at 11:02 -0700, Dan Williams wrote:
> > + return flex_array_get_precalc(fa, part_nr, index_inside);
> > +}
> > +
> > +static inline int flex_array_put_es(struct flex_array *fa, int element_nr,
> > + int element_size, void *src, gfp_t flags)
> > +{
> > + int part_nr = __fa_element_to_part_nr(element_size, element_nr);
> > + int index_inside = __fa_index_inside_part(element_size, element_nr);
> > +
> > + if (element_nr >= fa->total_nr_elements)
> > + return -ENOSPC;
>
> ...and this one look like good candidates for unlikely() as these
> additional branches may be a concern for the fast path.
Personally, I think those macros are grossly overused. I'm loathe to
use them unless there's actual profiling data showing that they make an
appreciable performance improvement or that the generated code is
unquestionably better.
-- Dave
prev parent reply other threads:[~2009-08-18 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-17 20:43 [RFC][PATCH] flex_array: conditionally optimize out divides Dave Hansen
2009-08-18 18:02 ` Dan Williams
2009-08-18 21:30 ` Dave Hansen [this message]
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=1250631025.7335.996.camel@nimitz \
--to=dave@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
/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