public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Cc: unlisted-recipients:;;linux-fsdevel@vger.kernel.org (no
	To-header on input),
	linux-kernel@vger.kernel.org,
	linux-f2fs-devel@lists.sourceforge.net,
	Chao Yu <chao2.yu@samsung.com>
Subject: Re: [PATCH] f2fs: add unlikely() macro for compiler more aggressively
Date: Fri, 06 Dec 2013 10:24:31 -0800	[thread overview]
Message-ID: <87siu5vnvk.fsf@tassilo.jf.intel.com> (raw)
In-Reply-To: <1386310509-5864-1-git-send-email-jaegeuk.kim@samsung.com> (Jaegeuk Kim's message of "Fri, 06 Dec 2013 15:15:09 +0900")

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

  parent reply	other threads:[~2013-12-06 18:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-06  6:15 [PATCH] f2fs: add unlikely() macro for compiler more aggressively Jaegeuk Kim
2013-12-06  8:34 ` Chao Yu
2013-12-06 18:24 ` Andi Kleen [this message]
2013-12-10  8:03   ` [PATCH v2] " Jaegeuk Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87siu5vnvk.fsf@tassilo.jf.intel.com \
    --to=andi@firstfloor.org \
    --cc=jaegeuk.kim@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox