[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CANpmjNMXFyhA23WrTTAjzGcjvtXz-1y5DQi6a0xgSxzg_7bGEg@mail.gmail.com>
Date: Thu, 5 Mar 2020 15:24:39 +0100
From: Marco Elver <elver@...gle.com>
To: Qian Cai <cai@....pw>
Cc: "Paul E. McKenney" <paulmck@...nel.org>,
Andrey Konovalov <andreyknvl@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
kasan-dev <kasan-dev@...glegroups.com>,
LKML <linux-kernel@...r.kernel.org>,
Jonathan Corbet <corbet@....net>,
"open list:DOCUMENTATION" <linux-doc@...r.kernel.org>
Subject: Re: [PATCH 2/3] kcsan: Update Documentation/dev-tools/kcsan.rst
On Wed, 4 Mar 2020 at 17:57, Marco Elver <elver@...gle.com> wrote:
>
> On Wed, 4 Mar 2020 at 17:44, Qian Cai <cai@....pw> 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.
I've sent v2 of the comment/documentation update series:
http://lkml.kernel.org/r/20200305142109.50945-1-elver@google.com
(only this patch changed)
Please check it captures the current caveat around "__no_kcsan inline"
with old compilers.
Thank you,
-- Marco
Powered by blists - more mailing lists