mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Igor Stoppa <igor.stoppa@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	igor.stoppa@huawei.com, Aaro Koskinen <aaro.koskinen@iki.fi>,
	Alasdair Kergon <agk@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Andrew Jeffery <andrew@aj.id.au>,
	Archit Taneja <architt@codeaurora.org>,
	asolokha@kb.kras.ru, bvanassche@acm.org,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	chien.tin.tung@intel.com, chunkeey@googlemail.com,
	Christoph Lameter <cl@linux.com>, David Airlie <airlied@linux.ie>,
	David Daney <ddaney@caviumnetworks.com>,
	Dennis Zhou <dennisszhou@gmail.com>,
	dima@arista.com, Doug Ledford <dledford@redhat.com>,
	"Latif, Faisal" <faisal.latif@intel.com>,
	gregkh <gregkh@linuxfoundation.org>,
	Daode Huang <huangdaode@hisilicon.com>,
	Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>,
	"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
	James Hogan <jhogan@kernel.org>, Jason Gunthorpe <jgg@ziepe.ca>,
	ejt@redhat.com, Kalle Valo <kvalo@codeaurora.org>,
	Kees Cook <keescook@chromium.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Linus Walleij <linus.walleij@linaro.org>,
	Madalin-Cristian Bucur <madalin.bucur@nxp.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	michal.kazior@tieto.com, Mike Snitzer <snitzer@redhat.com>,
	Paul Burton <paul.burton@mips.com>,
	Paul Mackerras <paulus@samba.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Ralf Baechle <ralf@linux-mips.org>,
	Rob Clark <robdclark@gmail.com>,
	rolandd@cisco.com, Salil Mehta <salil.mehta@huawei.com>,
	Shuah Khan <shuah@kernel.org>,
	srivatsa.bhat@linux.vnet.ibm.com, sviau@codeaurora.org,
	Tejun Heo <tj@kernel.org>,
	yisen.zhuang@huawei.com, zijun_hu@htc.com
Subject: Re: [PATCH 00/23] Make use of unlikely() more consistently.
Date: Fri, 31 Aug 2018 23:35:08 +0300	[thread overview]
Message-ID: <46369585-4d67-5235-d57d-a5162cc85e56@gmail.com> (raw)
In-Reply-To: <CAK8P3a2JasKXtXYoV7KsSZt4TwkffsBjrf=LK1HZJx0KFKCcow@mail.gmail.com>

On 31/08/18 17:09, Arnd Bergmann wrote:

[...]

>> #define assert(condition)
>> ...
>>          if (unlikely(!(condition)))
>>                  error_action()
>> ...
> 
> There is a potential that this introduces false-postive -Wmaybe-uninitialized
> warnings when CONFIG_PROFILE_ANNOTATED_BRANCHES is
> set, since that turns unlikely() into a complex operation that in turn
> confuses the compiler so it no longer keeps track of which variables
> are initialized or not.
> 
> It's possible that none of your patches do that, but one needs to be aware
> of the problem, and possibly revert some of your patches if it does cause
> warning regressions in drivers that don't actually benefit from the
> micro-optimization.

I see.
But if such case might arise, it might be possible, instead of reverting 
these patches, to locally - and conditionally - turn unlikely() into an 
identity macro.

For example:

#ifdef CONFIG_PROFILE_ANNOTATOED_BRANCHES
#define unlikely(x) (x)
#endif

Without giving up the hint for the case of normal compilation.

--
igor

      reply	other threads:[~2018-08-31 20:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20180830223429.30051-1-igor.stoppa@huawei.com>
2018-08-30 22:34 ` [PATCH 01/23] infiniband: nes: add unlikely() to assert() Igor Stoppa
2018-08-31 14:06   ` Doug Ledford
2018-08-30 22:34 ` [PATCH 02/23] ethernet: hnae: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 03/23] asm-generic: bug: add unlikely() to BUG_ON() Igor Stoppa
2018-08-30 22:34 ` [PATCH 04/23] mips: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 05/23] selftest: vm: " Igor Stoppa
2018-08-30 22:57   ` Dmitry Safonov
2018-08-30 23:04     ` Dmitry Safonov
2018-08-31 21:25       ` Igor Stoppa
2018-08-30 22:34 ` [PATCH 06/23] virtio: add unlikely() to WARN_ON_ONCE() Igor Stoppa
2018-08-30 22:34 ` [PATCH 07/23] seccomp: remove unnecessary unlikely() Igor Stoppa
2018-09-02 21:26   ` Kees Cook
2018-08-30 22:34 ` [PATCH 08/23] drm: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 09/23] cpufreq: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 10/23] wireless: " Igor Stoppa
2018-08-31  9:52   ` Kalle Valo
2018-08-31 13:44     ` Igor Stoppa
2018-08-30 22:34 ` [PATCH 11/23] " Igor Stoppa
2018-08-30 22:34 ` [PATCH 12/23] " Igor Stoppa
2018-08-30 22:34 ` [PATCH 13/23] freescale: ethernet: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 14/23] wimax: i2400m: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 15/23] lvm: device mapper: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 16/23] " Igor Stoppa
2018-08-30 22:34 ` [PATCH 17/23] usb: octeon-hcd: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 18/23] infiniband: scsi: " Igor Stoppa
2018-08-30 22:53   ` Bart Van Assche
2018-08-30 22:34 ` [PATCH 19/23] pinctrl: " Igor Stoppa
2018-08-31  9:29   ` Linus Walleij
2018-08-30 22:34 ` [PATCH 20/23] mm: percpu: " Igor Stoppa
2018-08-31  1:58   ` Dennis Zhou
2018-08-30 22:34 ` [PATCH 21/23] filesystems: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 22/23] powerpc: " Igor Stoppa
2018-08-30 22:34 ` [PATCH 23/23] scsi: " Igor Stoppa
2018-08-31 14:09 ` [PATCH 00/23] Make use of unlikely() more consistently Arnd Bergmann
2018-08-31 20:35   ` Igor Stoppa [this message]

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=46369585-4d67-5235-d57d-a5162cc85e56@gmail.com \
    --to=igor.stoppa@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=aaro.koskinen@iki.fi \
    --cc=agk@redhat.com \
    --cc=airlied@linux.ie \
    --cc=andrew@aj.id.au \
    --cc=architt@codeaurora.org \
    --cc=arnd@arndb.de \
    --cc=asolokha@kb.kras.ru \
    --cc=benh@kernel.crashing.org \
    --cc=bvanassche@acm.org \
    --cc=chien.tin.tung@intel.com \
    --cc=chunkeey@googlemail.com \
    --cc=cl@linux.com \
    --cc=ddaney@caviumnetworks.com \
    --cc=dennisszhou@gmail.com \
    --cc=dima@arista.com \
    --cc=dledford@redhat.com \
    --cc=ejt@redhat.com \
    --cc=faisal.latif@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=huangdaode@hisilicon.com \
    --cc=igor.stoppa@huawei.com \
    --cc=inaky.perez-gonzalez@intel.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jgg@ziepe.ca \
    --cc=jhogan@kernel.org \
    --cc=keescook@chromium.org \
    --cc=kvalo@codeaurora.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@nxp.com \
    --cc=martin.petersen@oracle.com \
    --cc=michal.kazior@tieto.com \
    --cc=mpe@ellerman.id.au \
    --cc=mst@redhat.com \
    --cc=paul.burton@mips.com \
    --cc=paulus@samba.org \
    --cc=ralf@linux-mips.org \
    --cc=rjw@rjwysocki.net \
    --cc=robdclark@gmail.com \
    --cc=rolandd@cisco.com \
    --cc=salil.mehta@huawei.com \
    --cc=shuah@kernel.org \
    --cc=snitzer@redhat.com \
    --cc=srivatsa.bhat@linux.vnet.ibm.com \
    --cc=sviau@codeaurora.org \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yisen.zhuang@huawei.com \
    --cc=zijun_hu@htc.com \
    /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

all inboxes | Powered by JetHome®