lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 18 Aug 2009 14:30:25 -0700
From:	Dave Hansen <dave@...ux.vnet.ibm.com>
To:	Dan Williams <dan.j.williams@...el.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC][PATCH] flex_array: conditionally optimize out divides

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

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ