From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Subject: Re: drm/vmwgfx: Fix compat shader namespace Date: Thu, 10 Jul 2014 12:33:18 +0300 Message-ID: <20140710093318.GJ23001@mwanda> References: <20140709124807.GA7707@mwanda> <53BDB4C1.7090309@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by gabe.freedesktop.org (Postfix) with ESMTP id 953A06E1E6 for ; Thu, 10 Jul 2014 02:33:26 -0700 (PDT) Content-Disposition: inline In-Reply-To: <53BDB4C1.7090309@vmware.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Thomas =?iso-8859-1?Q?Hellstr=F6m?= Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Wed, Jul 09, 2014 at 11:31:45PM +0200, Thomas Hellstr=F6m 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