From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nicolas Pitre <nicolas.pitre@linaro.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Josh Triplett <josh@joshtriplett.org>
Subject: Re: [PATCH RFC tip/core/rcu] Make SRCU be once again optional
Date: Tue, 16 Jan 2018 14:34:31 -0800 [thread overview]
Message-ID: <20180116223431.GA9671@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAK8P3a1AKdSiansYoztQ1GqOUvL8YPAP8HnSGe_gv+wwHk4f4w@mail.gmail.com>
On Tue, Jan 16, 2018 at 10:02:10PM +0100, Arnd Bergmann wrote:
> On Sat, Jun 3, 2017 at 10:36 PM, Paul E. McKenney
> <paulmck@linux.vnet.ibm.com> wrote:
> > On Sat, Jun 03, 2017 at 01:18:43AM -0400, Nicolas Pitre wrote:
> >> On Fri, 2 Jun 2017, Paul E. McKenney wrote:
> >>
> >> > On Fri, May 12, 2017 at 12:10:05PM -0700, Paul E. McKenney wrote:
> >> > > On Fri, May 12, 2017 at 02:59:48PM -0400, Nicolas Pitre wrote:
> >> > > > On Fri, 12 May 2017, Paul E. McKenney wrote:
> >> >
> >> > [ . . . ]
> >> >
> >> > > > No. "Available in mainline" is the name of the game for all I do. If it
> >> > > > can't be made acceptable for mainline then it basically has no chance of
> >> > > > gaining traction and becoming generally useful. My approach is therefore
> >> > > > to always find solutions that can be maintained upstream and contributed
> >> > > > to with minimal fuss by anyone.
> >> > >
> >> > > OK, then wish me luck. ;-)
> >> >
> >> > And still quite a bit of back and forth. How are things with tty?
> >> >
> >> > One question that came up -- what sort of SoCs are you targeting?
> >> > A number of people are insisting that smartphone SoCs with 256M DRAM
> >> > are the minimal systems of the future. This seems unlikely to me,
> >> > given the potential for extremely cheap SoCs with EDRAM or some such,
> >> > but figured I should ask what you are targeting.
> >>
> >> I'm targetting 256 *kilobytes* of RAM. Most likely SRAM. That's not for
> >> smart phones but really cheap IoT devices. That's the next area for
> >> (trimmed down) Linux to conquer. Example targets are STM32 chips.
> >>
> >> Please see the following for the rationale and how to get there:
> >>
> >> https://lwn.net/Articles/721074/
> >>
> >> http://www.mail-archive.com/search?l=mid&q=alpine.LFD.2.20.1703241215540.2304%40knanqh.ubzr
> >
> > Ah, thank you for the reminder. I did read that article, but somehow
> > got a few megabytes stuck in my head instead of the correct quarter meg.
> >
> > Anyway, don't look now, but Tiny {S,}RCU just might live on, for a bit
> > longer, anyway.
>
> It took me around 200000 randconfig builds since May, but I eventually
> ran into the regression caused by this patch, building an ARM kernel
> with the defconfig from https://pastebin.com/TiTWHP8t as input results
> in this build failure:
Yow!!! I am impressed!
> CC arch/arm/kernel/asm-offsets.s
> In file included from ./include/linux/notifier.h:16:0,
> from ./include/linux/memory_hotplug.h:7,
> from ./include/linux/mmzone.h:775,
> from ./include/linux/gfp.h:6,
> from ./include/linux/mm.h:10,
> from arch/arm/kernel/asm-offsets.c:15:
> ./include/linux/srcu.h: In function 'srcu_read_lock_held':
> ./include/linux/srcu.h:99:25: error: 'struct srcu_struct' has no
> member named 'dep_map'
> return lock_is_held(&sp->dep_map);
> ^~
This one I get -- I messed up and let the compiler evaluate ->dep_map
even for !CONFIG_DEBUG_LOCK_ALLOC. Does the patch below help?
> ./include/linux/srcu.h: In function 'srcu_read_lock':
> ./include/linux/srcu.h:160:24: error: 'struct srcu_struct' has no
> member named 'dep_map'
> rcu_lock_acquire(&(sp)->dep_map);
> ^~
> ./include/linux/srcu.h: In function 'srcu_read_unlock':
> ./include/linux/srcu.h:174:24: error: 'struct srcu_struct' has no
> member named 'dep_map'
> rcu_lock_release(&(sp)->dep_map);
> ^~
These two I don't get given the definitions for !CONFIG_DEBUG_LOCK_ALLOC:
# define rcu_lock_acquire(a) do { } while (0)
# define rcu_lock_release(a) do { } while (0)
Is your build somehow picking up a different definition? Or are you
using an older kernel (if so, please let me know the version.)
> I think what happened here is that randconfig builds basically never hit the
> CONFIG_SRCU=n case since lots of other things 'select SRCU', directly
> or indirectly. Until commit c9afbec27089 ("debugfs: purge obsolete SRCU
> based removal protection"), SRCU was selected by debugfs, which is
> practically always on, now it has become much easier to disable it,
> but it's still fairly unlikely.
It has been getting harder.
Another option would be simply conditionally compile out all or most
of include/linux/srcu.h for !CONFIG_SRCU builds.
Thoughts?
Thanx, Paul
------------------------------------------------------------------------
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 62be8966e837..b4fd484ad6cb 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -94,9 +94,11 @@ void synchronize_srcu(struct srcu_struct *sp);
*/
static inline int srcu_read_lock_held(struct srcu_struct *sp)
{
- if (!debug_lockdep_rcu_enabled())
- return 1;
+#ifdef CONFIG_PROVE_RCU
return lock_is_held(&sp->dep_map);
+#else /* #ifdef CONFIG_PROVE_RCU */
+ return 1;
+#endif /* #else #ifdef CONFIG_PROVE_RCU */
}
#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
next prev parent reply other threads:[~2018-01-16 22:34 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-28 21:15 [PATCH RFC tip/core/rcu] Make SRCU be once again optional Paul E. McKenney
2017-04-28 21:51 ` Nicolas Pitre
2017-04-29 0:10 ` Paul E. McKenney
2017-05-12 18:41 ` Paul E. McKenney
2017-05-12 18:45 ` Paul E. McKenney
2017-05-12 18:59 ` Nicolas Pitre
2017-05-12 19:10 ` Paul E. McKenney
2017-06-03 3:59 ` Paul E. McKenney
2017-06-03 5:18 ` Nicolas Pitre
2017-06-03 20:36 ` Paul E. McKenney
2018-01-16 21:02 ` Arnd Bergmann
2018-01-16 21:10 ` Arnd Bergmann
2018-01-16 22:34 ` Paul E. McKenney [this message]
2018-01-16 22:55 ` Arnd Bergmann
2018-01-16 23:03 ` Arnd Bergmann
2018-01-16 23:57 ` Paul E. McKenney
2018-01-17 10:29 ` Arnd Bergmann
2018-01-17 16:32 ` Josh Triplett
2018-01-17 17:10 ` Arnd Bergmann
2018-01-17 16:47 ` Paul E. McKenney
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=20180116223431.GA9671@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=arnd@arndb.de \
--cc=josh@joshtriplett.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.pitre@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.