From: "Enrico Weigelt, metux IT consult" <lkml@metux.net>
To: Kefeng Wang <wangkefeng.wang@huawei.com>,
Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Vlad Yasevich <vyasevich@gmail.com>,
Neil Horman <nhorman@tuxdriver.com>,
Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>,
netdev@vger.kernel.org, linux-sctp@vger.kernel.org
Subject: Re: [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL)
Date: Thu, 6 Jun 2019 22:41:32 +0200 [thread overview]
Message-ID: <37cbb3d8-bec8-4dd7-ba1f-31a2919316ca@metux.net> (raw)
In-Reply-To: <721a48ce-c09a-a35e-86ae-eac5eec26668@huawei.com>
On 06.06.19 03:39, Kefeng Wang wrote:
Hi folks,
> There is no different in assembly output (only check the x86/arm64), and
> the Enrico Weigelt have finished a cocci script to do this cleanup.
I haven't compared the assembly output, just logically deduced from the
macro. If I understand it correctly, the likely()/unlikely() macros
just add a hint to the compiler, which branch it should optimize harder.
No idea what the compiler's actually doing, but I believe its things
like optimized shortcut evaluation and avoiding jumps to likely
branches.
>> I'm not sure in the end that the change is worth it, so would like you
>> to prove it is, unless davem overrides me. :-)
Depends on what you count as worthy ;-)
This patch just makes a source a bit more compact / easier to read.
But shouldn't have any actual consequence on the generated binary.
--mtx
--
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
next prev parent reply other threads:[~2019-06-06 20:42 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-05 14:24 [PATCH] fs: gfs2: Use IS_ERR_OR_NULL Kefeng Wang
2019-06-05 14:24 ` [PATCH] fs: cifs: Drop unlikely before IS_ERR(_OR_NULL) Kefeng Wang
2019-06-05 14:24 ` [PATCH net-next] net: " Kefeng Wang
2019-06-05 16:13 ` Jesse Brandeburg
2019-06-06 1:39 ` Kefeng Wang
2019-06-06 20:41 ` Enrico Weigelt, metux IT consult [this message]
2019-06-05 16:40 ` Neil Horman
2019-06-05 14:24 ` [PATCH] block: " Kefeng Wang
2019-06-05 14:22 ` Jens Axboe
2019-06-05 18:24 ` Enrico Weigelt, metux IT consult
2019-06-05 18:32 ` Joe Perches
2019-06-05 20:55 ` Enrico Weigelt, metux IT consult
2019-06-05 14:24 ` [PATCH] Input: alps: " Kefeng Wang
2019-06-05 14:42 ` Pali Rohár
2019-06-06 1:08 ` Kefeng Wang
2019-06-06 2:28 ` Joe Perches
2019-06-12 0:59 ` Dmitry Torokhov
2019-06-12 7:14 ` Pali Rohár
2019-06-12 8:35 ` Joe Perches
2019-06-11 16:23 ` [PATCH] fs: gfs2: Use IS_ERR_OR_NULL Andreas Gruenbacher
2019-06-12 1:07 ` Kefeng Wang
2019-06-12 1:17 ` [PATCH v2] " Kefeng Wang
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=37cbb3d8-bec8-4dd7-ba1f-31a2919316ca@metux.net \
--to=lkml@metux.net \
--cc=davem@davemloft.net \
--cc=jesse.brandeburg@intel.com \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sctp@vger.kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
--cc=vyasevich@gmail.com \
--cc=wangkefeng.wang@huawei.com \
--cc=yoshfuji@linux-ipv6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).