dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: "Thomas Hellström" <thellstrom@vmware.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: drm/vmwgfx: Fix compat shader namespace
Date: Thu, 10 Jul 2014 12:33:18 +0300	[thread overview]
Message-ID: <20140710093318.GJ23001@mwanda> (raw)
In-Reply-To: <53BDB4C1.7090309@vmware.com>

On Wed, Jul 09, 2014 at 11:31:45PM +0200, Thomas Hellström wrote:
> >Speaking of verbose, all the likely/unlikely annotations should be
> >removed.
> 
> Is this your personal opinion or has there been some kind of kernel
> developer agreement not to add this annotation and remove it from
> the kernel tree? If not, I prefer to keep it.

It obviously makes the code less readable.  It makes a small speedup if
the code is called 10000 times with the and the expected value is true
every time.  If more than 1 out of 10000 values is unexpected then it is
a slow down.

There are two rules of thumb for likely/unlikely:

	1) Don't use it in the drivers/ directory.
	2) Or don't use it without benchmarking it.

These are general rules, not mine.

In the olden days we used to use it more often but then people did
benchmarking and likely/unlikely annotations didn't make a single
measurable difference on normal benchmarks at all.  Maybe on a micro
benchmark.  Also perhaps in those days people hadn't done branch
profiling so we were getting a lot of unexpected conditions and the slow
downs were canceling the speed ups.

regards,
dan carpenter

  reply	other threads:[~2014-07-10  9:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-09 12:48 drm/vmwgfx: Fix compat shader namespace Dan Carpenter
2014-07-09 21:31 ` Thomas Hellström
2014-07-10  9:33   ` Dan Carpenter [this message]
2014-07-10 22:14     ` Thomas Hellström
2014-07-11  8:43       ` Dan Carpenter

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=20140710093318.GJ23001@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thellstrom@vmware.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