linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Igor Stoppa <igor.stoppa@gmail.com>
To: Paul Burton <paul.burton@mips.com>
Cc: David Daney <ddaney@caviumnetworks.com>,
	Igor Stoppa <igor.stoppa@huawei.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	James Hogan <jhogan@kernel.org>,
	linux-mips@linux-mips.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mips: bug: add unlikely() to BUG_ON()
Date: Mon, 10 Sep 2018 12:45:03 +0300	[thread overview]
Message-ID: <d702acea-0aac-abc3-c48e-21f0e44d5870@gmail.com> (raw)
In-Reply-To: <20180907220208.nqucxycxsxmyxt4m@pburton-laptop>

Hi Paul,

On 08/09/18 01:02, Paul Burton wrote:

> I'm not sure this will actually do anything.
> 
> __BUG_ON() doesn't use the value of its condition argument for regular
> control flow unless it's compile-time constant anyway, in which case
> unlikely() should be redundant because the compiler knows the value
> already.
> 
> If the condition isn't compile-time constant then we just emit a tne
> (trap-if-not-equal) instruction using inline asm. That will generate an
> exception if the value is non-zero at runtime. I don't see how adding
> unlikely() is going to help the compiler do anything differently with
> that.

Thank you for the explanation. Please discard this patch.

--
igor

      reply	other threads:[~2018-09-10  9:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-07 18:03 [PATCH] mips: bug: add unlikely() to BUG_ON() Igor Stoppa
2018-09-07 22:02 ` Paul Burton
2018-09-10  9:45   ` Igor Stoppa [this message]

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=d702acea-0aac-abc3-c48e-21f0e44d5870@gmail.com \
    --to=igor.stoppa@gmail.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=igor.stoppa@huawei.com \
    --cc=jhogan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@mips.com \
    --cc=ralf@linux-mips.org \
    /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;
as well as URLs for NNTP newsgroup(s).