Re: Should we be using unlikely() around tests of GFP_ZERO?

From: Steven Rostedt
Date: Mon Jan 03 2011 - 09:26:42 EST


On Mon, 2011-01-03 at 16:10 +0200, Pekka Enberg wrote:

> > correct incorrect % Function File Line
> > ------- --------- - -------- ---- ----
> > 6890998 2784830 28 slab_alloc slub.c 1719
> >
> > That's incorrect 28% of the time.
>
> Thanks! AFAICT, that number is high enough to justify removing the
> unlikely() annotations, no?

Personally, I think anything that is incorrect more that 5% of the time
should not have any annotation.

My rule is to use the annotation when a branch goes one way 95% or more.
With the exception of times when we want a particular path to be the
faster path, because we know its in a more critical position (as there
are cases in the scheduler and the tracing infrastructure itself).

But here, I think removing it is the right decision.

-- Steve


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/