Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp4699130ybf; Wed, 4 Mar 2020 08:58:18 -0800 (PST) X-Google-Smtp-Source: ADFU+vvCgzK1yRsZY8oi1lrSRX04JByFYZr9mejPBwOyx4pJxxuRmgxt4VCRPa3W7ZibXq0lePo0 X-Received: by 2002:a05:6830:15c6:: with SMTP id j6mr2945011otr.348.1583341098074; Wed, 04 Mar 2020 08:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583341098; cv=none; d=google.com; s=arc-20160816; b=xk0kTHJ3V8A+mp9x4iStSvUMibap5MO05B8qTFiCu258SmEaMmYXtoizwtja9CVfj1 slgJ4z3JENZvvr0EQuWEKxb5XSkdUcIpx70NVoYFKxOZsbPkr6iwPuuSMZD8lP3dpCWu hfv+vCwGix2xdgxvdLd0OmF9Jf6D000TAcv9mYbrWwcmySy8XHyEX7NOMpgLCCfKroN5 DXUMojQ0JFAQFESRo7aT8Gi1bt7t9A1A9Q0xehBC2Js/Z8RRgZfDE+VZ3u3qZxhVxcss D7AIZBlk+XlQB/nfnSlbXWqcXV8qtP8tod9yi7sj6sZsqTVK96odUjKzu2YuW9uiQv0L 4/jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Yur0Lyv+QJRNaR7D40FqUvoblidYiD7uzVtpeJGfpoE=; b=DcG96irFMfWppqpSEYRx1fnkoJAWMuicOthhwA/wod1pfLzo5BWLiBHixaSvOm/gNS 7U9ElaVbEbzmeh+5hAjB9XVX5DmYtsnyBuE/2cVcIXzeSROlXwLzvMLRisv/KI/wnh3l 9CWg7fMZ15w7Z7ZGOOoA3x58WyXuP86ANSSTSTXURho1PXgBltBIRN9EFaIAc6dU07hL QGi43+X9qmbb8PbuExBkz7oimzd0S9gaE72Pu7k3DzgjyXMOxhKCk4Zc2R+0bauX5/i4 vCPyPEOUgp7e4OQqz9lnB4geEaImsRDVhfdZHO8obLi2h8EhjaKj7Zs3YiUksrdG9Q6c EhpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=h8fJVp2S; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q131si1390861oig.203.2020.03.04.08.58.05; Wed, 04 Mar 2020 08:58:18 -0800 (PST) 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=@google.com header.s=20161025 header.b=h8fJVp2S; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729686AbgCDQ5P (ORCPT + 99 others); Wed, 4 Mar 2020 11:57:15 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:35198 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726561AbgCDQ5P (ORCPT ); Wed, 4 Mar 2020 11:57:15 -0500 Received: by mail-ot1-f68.google.com with SMTP id v10so2722565otp.2 for ; Wed, 04 Mar 2020 08:57:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Yur0Lyv+QJRNaR7D40FqUvoblidYiD7uzVtpeJGfpoE=; b=h8fJVp2SaF3A56yqOVd/mE3UUipG62giQzolZLRD+kOBXhfj5bja+6QKAMbrpZ9jW9 cqLLDf11AYJqoChCP0MuTxzgXO3Ry+jbByGXkDv8CiuoAtn+X+agsiN0Eg0mM8ye/l5F pTBWyDI1m2CMuZLebNdA4R/oLl/BEcoUY+i9DwAfYMoQuEGSoa3iF0wgx/ICu5L2lTZl O85wMz4GqBg3OPZTxcNieibjBOHurx1sIrdiXlrN7nZ0BJZkBFbaQuVJJz+dYZVvacsc fXMcvSeklaI2PDY7z/T424kx6VSNEt7whxYviMYSnFyxGI7NroEjgMmfew9zbE80u7Zt R0Xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Yur0Lyv+QJRNaR7D40FqUvoblidYiD7uzVtpeJGfpoE=; b=qO4zmRtZ/GIUE4kG3C6bBsTMGjJ6D0mYKCbS9/WfiwL8eq9XQdc7xYkAcmbllIq/NJ rmwlJCbmH8Wy1cSPSblheBDbtzL4PILmYg+aa+kWbK0ZRBbxSafsO5vTdRNVQ5ryKdN2 xOJkhQaOMd2p8GQScozGsClIbEtFrYfH3IOqJva4ztw2PrTiGjS+x1GS+KyzZx57akjx Gl/icFrCKCXr+VvscLhKPnpar3fX2BJBAUw+5zxgsQaBgGaumcpujaK1kFeD1ryuJsZb tEZEjNnbO/bbkllv4bu1IDJ1p5npds7qUfX4fHSl5v45vdHIzZ58AjvtmuwxjPRkFm67 v7Jg== X-Gm-Message-State: ANhLgQ0lwsDTh9GYSl88h4MrNJNqeL00Gqs1JfGPCBWknQ9fAkDd+rHm oBtml1ARaAdun8KQ4SoLJ5ik3zf6dmlwxNNZtOlkhA== X-Received: by 2002:a9d:68ce:: with SMTP id i14mr3218726oto.233.1583341034238; Wed, 04 Mar 2020 08:57:14 -0800 (PST) MIME-Version: 1.0 References: <20200304162541.46663-1-elver@google.com> <20200304162541.46663-2-elver@google.com> <1583340277.7365.153.camel@lca.pw> In-Reply-To: <1583340277.7365.153.camel@lca.pw> From: Marco Elver Date: Wed, 4 Mar 2020 17:57:03 +0100 Message-ID: Subject: Re: [PATCH 2/3] kcsan: Update Documentation/dev-tools/kcsan.rst To: Qian Cai Cc: "Paul E. McKenney" , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , kasan-dev , LKML , Jonathan Corbet , "open list:DOCUMENTATION" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 Mar 2020 at 17:44, Qian Cai wrote: > > On Wed, 2020-03-04 at 17:25 +0100, 'Marco Elver' via kasan-dev wrote: > > Selective analysis > > ~~~~~~~~~~~~~~~~~~ > > @@ -111,8 +107,8 @@ the below options are available: > > > > * Disabling data race detection for entire functions can be accomplished by > > using the function attribute ``__no_kcsan`` (or ``__no_kcsan_or_inline`` for > > - ``__always_inline`` functions). To dynamically control for which functions > > - data races are reported, see the `debugfs`_ blacklist/whitelist feature. > > + ``__always_inline`` functions). To dynamically limit for which functions to > > + generate reports, see the `DebugFS interface`_ blacklist/whitelist feature. > > As mentioned in [1], do it worth mentioning "using __no_kcsan_or_inline for > inline functions as well when CONFIG_OPTIMIZE_INLINING=y" ? > > [1] https://lore.kernel.org/lkml/E9162CDC-BBC5-4D69-87FB-C93AB8B3D581@lca.pw/ Strictly speaking it shouldn't be necessary. Only __always_inline is incompatible with __no_kcsan. AFAIK what you noticed is a bug with some versions of GCC. I think with GCC >=9 and Clang there is no problem. The bigger problem is turning a bunch of 'inline' functions into '__always_inline' accidentally, that's why the text only mentions '__no_kcsan_or_inline' for '__always_inline'. For extremely small functions, that's probably ok, but it's not general advice we should give for that reason. I will try to write something about this here, but sadly there is no clear rule for this until the misbehaving compilers are no longer supported. Thanks, -- Marco