From: Peter Zijlstra <peterz@infradead.org>
To: Marco Elver <elver@google.com>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
kernel test robot <lkp@intel.com>,
kbuild-all@lists.01.org, LKML <linux-kernel@vger.kernel.org>,
Will Deacon <will@kernel.org>
Subject: Re: [rcu:rcu/next 35/35] kernel/rcu/tree.c:251:8: error: implicit declaration of function 'arch_atomic_add_return'; did you mean
Date: Thu, 25 Jun 2020 13:29:26 +0200 [thread overview]
Message-ID: <20200625112926.GO4781@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <CANpmjNO5uBSZj0gHy0t+O2VhD+UjG58+zON0AFX8i7MNSO5a6Q@mail.gmail.com>
On Thu, Jun 25, 2020 at 11:55:13AM +0200, Marco Elver wrote:
> On Wed, 24 Jun 2020 at 22:30, Paul E. McKenney <paulmck@kernel.org> wrote:
> > diff --git a/include/linux/atomic-fallback.h b/include/linux/atomic-fallback.h
> > index 2c4927b..b7935857 100644
> > --- a/include/linux/atomic-fallback.h
> > +++ b/include/linux/atomic-fallback.h
> > @@ -133,6 +133,7 @@ atomic_add_return(int i, atomic_t *v)
> > return ret;
> > }
> > #define atomic_add_return atomic_add_return
> > +#define arch_atomic_add_return atomic_add_return
> > #endif
> >
> > #endif /* atomic_add_return_relaxed */
> >
> > ------------------------------------------------------------------------
> >
> > And of course similar for arch_atomic_andnot() and arch_atomic_read().
> >
> > Another way would be to define a noinstr_atomic_add_return() that
> > was defined something like this:
> >
> > ------------------------------------------------------------------------
> >
> > #ifdef CONFIG_HAVE_ARCH_KCSAN
> > # define noinstr_atomic_add_return arch_atomic_add_return
> > #else
> > # define noinstr_atomic_add_return atomic_add_return
> > #endif
>
> noinstr also needs to apply to KASAN & co, so this won't quite work.
> Every architecture that defines arch_atomic_* has #define ARCH_ATOMIC,
> so that could be used instead.
Right. And my bad for forgetting arch_atomic_ isn't generally available
:/
> > ------------------------------------------------------------------------
> >
> > And again similarly for the others.
> >
> > Left to myself, I would take the second option just because it provably
> > leaves unaltered anything that isn't using the new API. That said,
> > there has to be a better Kconfig option to key this off of.
> >
> > Thoughts?
>
> I think 'arch_atomic_*' is already the noinstr variant, and your first
> suggestion of adding arch-defines to atomic-fallback.h seems cleaner,
> as it avoids introducing new interfaces. But that also depends on if
> it's a one-off, only for RCU, or if the use of 'arch_atomic'
> proliferates outside of arch/. My guess is that, unfortunately, other
> places will want 'arch_atomic' as well eventually.
I fear the same. Let me see if I can quickly modify the atomic scripts
to generate the required fallbacks.
next prev parent reply other threads:[~2020-06-25 11:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 19:38 kernel test robot
2020-06-24 20:30 ` Paul E. McKenney
2020-06-25 9:55 ` Marco Elver
2020-06-25 11:29 ` Peter Zijlstra [this message]
2020-06-25 14:11 ` Peter Zijlstra
2020-06-25 15:38 ` Paul E. McKenney
2020-06-25 19:35 ` Marco Elver
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=20200625112926.GO4781@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=elver@google.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=paulmck@kernel.org \
--cc=will@kernel.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
all inboxes | Powered by JetHome®