Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp797089imm; Fri, 31 Aug 2018 13:36:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbVIbKy6KMyNmXhtrJZrjARNRKzDKJs5VeElpbGk2Ts8IRdc6m0A29C+c7JGomnzgMobWZV X-Received: by 2002:a63:d74f:: with SMTP id w15-v6mr15985383pgi.306.1535747790841; Fri, 31 Aug 2018 13:36:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535747790; cv=none; d=google.com; s=arc-20160816; b=cd90dVtkCOOdfxhaYNmuy6fEBl9aoFQ3Kv4+8t/wVRPeYOBb/xbZcElmbMolXYrpaz Mx1EWVSq9RIbK6jLDeuJeT5cVoVsWQCC3Jy/1sbBRTKBUwDj+nnbXx8OSsPsU4oYbW95 TB7C5bI/QmomB9etZpiAgK5OlQDZeaD5RJj6xBgSo+0c14b1jHeU+40MVFSPB29gOF0F RqrZKtTHMVYe4syTe6zuCHuqW1A8SLRwUAyCW6vuqahcAig8H6Ft+BaUc8THF03PnxXB LwJ8GOUNEFTZTzjkSeQClEP+Kj6TA1rvMh2uCWvYj9IT6RdhYtrIs1xFoOHJZnXvfDIl OPSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=I0/fCvUyhd3rSmsOjctetkXT+qUy3U1bl2VDeQzPk0w=; b=d0Fy9NuHLwHdOeyksU0lKujEXv/0I4VjhGv/3ZF3Yp1fvcX013vfHXONDZ+xrOKvtJ N9SSkfUxy4fpYlCV/7ilie/WMWa8LsxIsTs4iGckt0n22GILf3x+9l1h6XCL7PS0PFsJ 8Pf5Zo5a2I8wW/Kr4Rey4sUm8aZXyNW8AT3K6l1WJFPq52XEurXj2hM1B1jfUs5werD7 P2FUYwyM1O9VIiRNQaH24Ipex6fcuBHdufteqQiOR75Nmip7P1sXOpB3yKU2s1P3HcT4 A4r+agdBNVqbsD/P1o/dRGpYmvBcBWlGW/kj0r65n/bWf41XgCdEXetn7NKx86A28UTM 7NyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gokIJCdd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc5-v6si10397270plb.278.2018.08.31.13.36.15; Fri, 31 Aug 2018 13:36:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gokIJCdd; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727526AbeIAAoV (ORCPT + 99 others); Fri, 31 Aug 2018 20:44:21 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:42474 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727245AbeIAAoU (ORCPT ); Fri, 31 Aug 2018 20:44:20 -0400 Received: by mail-lj1-f195.google.com with SMTP id f1-v6so11075162ljc.9 for ; Fri, 31 Aug 2018 13:35:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=I0/fCvUyhd3rSmsOjctetkXT+qUy3U1bl2VDeQzPk0w=; b=gokIJCddIwRY535NZhtrAPSeFsbbsCWCnHX8ZjQKek0bhkkW36H4vK/Q3juSU5oocD MYdEgfOv9boDuMiCUzdkwiQ975/p8E1QEu7IDP1KtGLu7vVDzjlNC+ZH48SDT3/fNoVC y4BPnzCsl/IPdUdMC2tCSSpSMws2LklOqLpxMAnjKIX+JTfPp2+jFdUkvBcSgmn3uzk2 +YQr7l/fC8HMrOSMnUxyCZcAl7dJc0OQ4zFNlJzWgz0CkmDY+u5LxdZOSDlb5OiYBGfR 6Y8rj7Bnf/E4zJYA4PUJUKEMBX4F3mCvlv6yhaDVf00lS71rV7XjGiok4o3AMlKX0mkT 70QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=I0/fCvUyhd3rSmsOjctetkXT+qUy3U1bl2VDeQzPk0w=; b=azFRWJjKAKsP/NLQTaweHNvo3sfebuUItc84tjIogVMA29kuEyOVMZ+Kud5AzoKiIt KryIBreAj9Y7uJFkfvu/kqNfILw/NMM4Uwe/rnFcZiG1yeiMppmopCNeu1vfKBSYlfMI AtPb/zap4He7ex5SJ1kw2SeYLltFe7eJ4hSxdv4vxsoccXDbR+W5IgEcffktX1n3nYm+ RvzFOZ9CMMk8F4zBY8M2xC82idPPWVlJtlzF0mdAD/82Kb/P3GMRcnxjfjyLGtOJ8FNZ 8qdrBS1azebdWxolTXrUYeG8mpDEZPtCnIo4rgIP+dGONbn/JhVbNyCZ0Xp+DPXZ/Qi6 8CEw== X-Gm-Message-State: APzg51DGQBTmo7BUP5UnzMaAIQm5+D6DDIDBVqReRvh58PgAsFSXRBUj DvCerkYRZMO7IguTx6Lls2I= X-Received: by 2002:a2e:658a:: with SMTP id e10-v6mr10253204ljf.99.1535747710254; Fri, 31 Aug 2018 13:35:10 -0700 (PDT) Received: from [192.168.10.160] (91-159-62-202.elisa-laajakaista.fi. [91.159.62.202]) by smtp.gmail.com with ESMTPSA id b80-v6sm2071070lfe.83.2018.08.31.13.35.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 13:35:09 -0700 (PDT) Subject: Re: [PATCH 00/23] Make use of unlikely() more consistently. To: Arnd Bergmann Cc: Linux Kernel Mailing List , igor.stoppa@huawei.com, Aaro Koskinen , Alasdair Kergon , Al Viro , Andrew Jeffery , Archit Taneja , asolokha@kb.kras.ru, bvanassche@acm.org, Benjamin Herrenschmidt , chien.tin.tung@intel.com, chunkeey@googlemail.com, Christoph Lameter , David Airlie , David Daney , Dennis Zhou , dima@arista.com, Doug Ledford , "Latif, Faisal" , gregkh , Daode Huang , Inaky Perez-Gonzalez , "James E.J. Bottomley" , James Hogan , Jason Gunthorpe , ejt@redhat.com, Kalle Valo , Kees Cook , Larry Finger , Linus Walleij , Madalin-Cristian Bucur , "Martin K. Petersen" , Michael Ellerman , "Michael S. Tsirkin" , michal.kazior@tieto.com, Mike Snitzer , Paul Burton , Paul Mackerras , "Rafael J. Wysocki" , Ralf Baechle , Rob Clark , rolandd@cisco.com, Salil Mehta , Shuah Khan , srivatsa.bhat@linux.vnet.ibm.com, sviau@codeaurora.org, Tejun Heo , yisen.zhuang@huawei.com, zijun_hu@htc.com References: <20180830223429.30051-1-igor.stoppa@huawei.com> From: Igor Stoppa Message-ID: <46369585-4d67-5235-d57d-a5162cc85e56@gmail.com> Date: Fri, 31 Aug 2018 23:35:08 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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