Re: [PATCH] f2fs: add unlikely() macro for compiler more aggressively

Andi Kleen
2013-12-06T18:24:34Z

Jaegeuk Kim <jaegeuk.kim@samsung.com> writes:
> struct page *page;
> repeat:
> page = grab_cache_page(mapping, index);
> - if (!page) {
> + if (unlikely(!page)) {

This is completely pointless, gcc already considers any test for NULL
unlikely.

In general i would advise against splattering unlikely all over your
code, the benefits are very minimal and programers often get it wrong.

-Andi

--
ak@linux.intel.com -- Speaking for myself only