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

From: Minchan Kim
Date: Sun Jan 02 2011 - 22:46:59 EST


On Mon, Jan 3, 2011 at 8:48 AM, Theodore Ts'o <tytso@xxxxxxx> wrote:
>
> Given the patches being busily submitted by trivial patch submitters to
> make use kmem_cache_zalloc(), et. al, I believe we should remove the
> unlikely() tests around the (gfp_flags & __GFP_ZERO) tests, such as:
>
> -       if (unlikely((flags & __GFP_ZERO) && objp))
> +       if ((flags & __GFP_ZERO) && objp)
>                memset(objp, 0, obj_size(cachep));
>
> Agreed?  If so, I'll send a patch...

I support it.

Recently Steven tried to gather the information.
http://thread.gmane.org/gmane.linux.kernel/1072767
Maybe he might have a number for that.


>
>                                                - Ted
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
> Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
>



--
Kind regards,
Minchan Kim
--
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/