[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1238015372.2132.381.camel@calx>
Date: Wed, 25 Mar 2009 16:09:32 -0500
From: Matt Mackall <mpm@...enic.com>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Steven Rostedt <rostedt@...dmis.org>,
Pekka Enberg <penberg@...helsinki.fi>,
Hua Zhong <hzhong@...il.com>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...e.hu>,
Andrew Morton <akpm@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Roland McGrath <roland@...hat.com>,
Nick Piggin <nickpiggin@...oo.com.au>,
Steven Rostedt <srostedt@...hat.com>,
Christoph Lameter <cl@...ux-foundation.org>,
Al Viro <viro@...iv.linux.org.uk>
Subject: Re: [PATCH 2/5] mm: remove unlikly NULL from kfree
On Wed, 2009-03-25 at 13:26 -0700, Jeremy Fitzhardinge wrote:
> Steven Rostedt wrote:
> > Thanks for this info!
> >
> > Although gcc plays a role too. That is, if we have
> >
> > if (x)
> > do something small;
> >
> > do something large;
> >
> >
> > this can be broken into:
> >
> > cmp x
> > beq 1f
> > do something small
> > 1:
> > do something large
> >
> > Which plays nice with the cache. But, by adding a unlikely(x), gcc will
> > probably choose to do:
> >
> > cmp x
> > bne 2f
> >
> > 1:
> > do something large
> >
> > ret;
> >
> > 2:
> > do something small
> > b 1b
> >
> > which hurts in a number of ways.
> >
>
> I think that's probably the dominant effect on x86 systems, because
> Intel doesn't recommend using the branch hint prefixes as far as I can
> tell (their consumption of icache space outweighs any benefit of priming
> the predictor).
Yeah, I was actually thinking 'hint' in the gcc sense of adding
unlikely() or not, which results in, say, choosing one code layout vs
the other based on the CPU's cold-cache bias.
--
http://selenic.com : development and support for Mercurial and Linux
--
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