netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kefeng Wang <wangkefeng.wang@huawei.com>
To: 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>,
	"Enrico Weigelt, metux IT consult" <lkml@metux.net>
Subject: Re: [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL)
Date: Thu, 6 Jun 2019 09:39:52 +0800	[thread overview]
Message-ID: <721a48ce-c09a-a35e-86ae-eac5eec26668@huawei.com> (raw)
In-Reply-To: <20190605091319.000054e9@intel.com>


On 2019/6/6 0:13, Jesse Brandeburg wrote:
> On Wed, 5 Jun 2019 22:24:26 +0800 Kefeng wrote:
>> IS_ERR(_OR_NULL) already contain an 'unlikely' compiler flag,
>> so no need to do that again from its callers. Drop it.
>>
> <snip>
>
>>  	segs = __skb_gso_segment(skb, features, false);
>> -	if (unlikely(IS_ERR_OR_NULL(segs))) {
>> +	if (IS_ERR_OR_NULL(segs)) {
>>  		int segs_nr = skb_shinfo(skb)->gso_segs;
>>  
> The change itself seems reasonable, but did you check to see if the
> paths changed are faster/slower with your fix?  Did you look at any
> assembly output to see if the compiler actually generated different
> code?  Is there a set of similar changes somewhere else in the kernel
> we can refer to?

+Enrico Weigelt

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'm not sure in the end that the change is worth it, so would like you
> to prove it is, unless davem overrides me. :-)
>
>
> .
>


  reply	other threads:[~2019-06-06  1:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190605142428.84784-1-wangkefeng.wang@huawei.com>
2019-06-05 14:24 ` [PATCH net-next] net: Drop unlikely before IS_ERR(_OR_NULL) Kefeng Wang
2019-06-05 16:13   ` Jesse Brandeburg
2019-06-06  1:39     ` Kefeng Wang [this message]
2019-06-06 20:41       ` Enrico Weigelt, metux IT consult
2019-06-05 16:40   ` Neil Horman

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=721a48ce-c09a-a35e-86ae-eac5eec26668@huawei.com \
    --to=wangkefeng.wang@huawei.com \
    --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=lkml@metux.net \
    --cc=marcelo.leitner@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.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).