From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754781AbbCaPnq (ORCPT ); Tue, 31 Mar 2015 11:43:46 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:36145 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752849AbbCaPno (ORCPT ); Tue, 31 Mar 2015 11:43:44 -0400 Message-ID: <551AC0AC.6080205@plexistor.com> Date: Tue, 31 Mar 2015 18:43:40 +0300 From: Boaz Harrosh User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Dan Williams CC: Christoph Hellwig , Jens Axboe , linux-nvdimm , X86 ML , "linux-kernel@vger.kernel.org" , linux-fsdevel Subject: Re: [Linux-nvdimm] [PATCH 4/6] SQUSHME: pmem: Micro cleaning References: <1427358764-6126-1-git-send-email-hch@lst.de> <55143A8B.2060304@plexistor.com> <20150331092526.GA25958@lst.de> <551A9EB3.8000605@plexistor.com> <551AA0AD.4000604@plexistor.com> <551ABC26.3000008@plexistor.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/31/2015 06:30 PM, Dan Williams wrote: > On Tue, Mar 31, 2015 at 8:24 AM, Boaz Harrosh wrote: >> On 03/31/2015 06:17 PM, Dan Williams wrote: >>> On Tue, Mar 31, 2015 at 6:27 AM, Boaz Harrosh wrote: >>>> >>>> Some error checks had unlikely some did not. Put unlikely >>>> on all error handling paths. >>>> (I like unlikely for error paths specially for readability) >>> >>> "unlikely()" is not a readability hint, it's specifically for branches >>> that profiling shows adding it makes a difference. Just delete them >>> all until profiling show they make a difference. They certainly don't >>> make a difference in the slow paths. >>> >> >> Why? > > Because the compiler and cpu already does a decent job, and if you get > the frequency wrong it can hurt performance [1]. > > It's pre-mature optimization to sprinkle them around, especially in slow paths. > > [1]: https://lwn.net/Articles/420019/ > Sigh! It looks like a holy war. Again all that was said at above thread was about statistical prediction yes-or-no. And I agree with all the use cases. But not here. This is not an optimization this is the *error path*. What I'm saying is: "No compiler nor CPU, even if 99% of the time this branch is taken I still consider it cold. Because it is the error case and I do not care for it" And no I did not get it wrong. All these places are "error paths" that I do not care for. If any of these places are dependent on some input or code variable then yes let the smarts do it. But never in the "error path". That said. the patch is up for grabs. I like it ... Thanks Boaz