[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4iBjN6h_o+---mt9b5nXr-mC_famL_Od9PCDZByz959MQ@mail.gmail.com>
Date: Tue, 31 Mar 2015 08:30:57 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Boaz Harrosh <boaz@...xistor.com>
Cc: Christoph Hellwig <hch@....de>, Jens Axboe <axboe@...nel.dk>,
linux-nvdimm <linux-nvdimm@...1.01.org>, X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [Linux-nvdimm] [PATCH 4/6] SQUSHME: pmem: Micro cleaning
On Tue, Mar 31, 2015 at 8:24 AM, Boaz Harrosh <boaz@...xistor.com> wrote:
> On 03/31/2015 06:17 PM, Dan Williams wrote:
>> On Tue, Mar 31, 2015 at 6:27 AM, Boaz Harrosh <boaz@...xistor.com> 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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists