All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thellstrom@vmware.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: drm/vmwgfx: Fix compat shader namespace
Date: Fri, 11 Jul 2014 00:14:25 +0200	[thread overview]
Message-ID: <53BF1041.5000103@vmware.com> (raw)
In-Reply-To: <20140710093318.GJ23001@mwanda>


On 2014-07-10 11:33, Dan Carpenter wrote:
> 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.

You may be right, but most people citicising branch prediction hints 
tend to stare blindly at probabilities and forget about fastpath 
optimization where you don't care at all about the execution speed of 
the slowpath and therefore hint the compiler to take the fastpath branch 
regardless of probabilities. My guess is it would be pretty hard to do 
that incorrectly.

I agree, however that readability may be more important than the 
fastpath execution speed gained from this. But in my case not so much 
that I spontaneously feel like removing all branch prediction hints from 
the vmwgfx driver.

>
> 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.

Could you point me to a document or some sort of reference?

Thanks,
Thomas

  reply	other threads:[~2014-07-10 22:14 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
2014-07-10 22:14     ` Thomas Hellström [this message]
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=53BF1041.5000103@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=dan.carpenter@oracle.com \
    --cc=dri-devel@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.