From: "Paul E. McKenney" <paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Nick Piggin <nickpiggin-/E1597aS9LT0CCvOHzKKcA@public.gmane.org>
Cc: "Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
Kamalesh Babulal
<kamalesh-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>,
Alexey Dobriyan
<adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Linux Kernel Mailing List
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Adrian Bunk <bunk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Linus Torvalds
<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Natalie Protasevich
<protasnb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Kernel Testers List
<kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: 2.6.26-rc9-git4: Reported regressions from 2.6.25
Date: Fri, 1 Aug 2008 14:09:34 -0700 [thread overview]
Message-ID: <20080801210934.GG14851@linux.vnet.ibm.com> (raw)
In-Reply-To: <200807101725.36175.nickpiggin-/E1597aS9LT0CCvOHzKKcA@public.gmane.org>
On Thu, Jul 10, 2008 at 05:25:35PM +1000, Nick Piggin wrote:
> On Wednesday 09 July 2008 07:37, Rafael J. Wysocki wrote:
> > Bug-Entry : http://bugzilla.kernel.org/show_bug.cgi?id=10629
> > Subject : 2.6.26-rc1-$sha1: RIP __d_lookup+0x8c/0x160
> > Submitter : Alexey Dobriyan <adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > Date : 2008-05-05 09:59 (65 days old)
> > References : http://lkml.org/lkml/2008/5/5/28
> > Handled-By : Paul E. McKenney <paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
>
> Attached is my fix for this problem. I don't think it is a regression
> as such, but it can't hurt to go into 2.6.26 IMO.
>
> PREEMPT_RCU without HOTPLUG_CPU is broken. The rcu_online_cpu is called to
> initially populate rcu_cpu_online_map with all online CPUs when the hotplug
> event handler is installed, and also to populate the map with CPUs as they
> come online. The former case is meant to happen with and without HOTPLUG_CPU,
> but without HOTPLUG_CPU, the rcu_offline_cpu function is no-oped -- while it
> still gets called, it does not set the rcu CPU map.
>
> With a blank RCU CPU map, grace periods get to tick by completely oblivious
> to active RCU read side critical sections. This results in free-before-grace
> bugs.
>
> Fix is obvious once the problem is known. (Also, change __devinit to
> __cpuinit so the function gets thrown away on !HOTPLUG_CPU kernels).
I officially feel extremely stupid. Thank you -very- much for tracking
this down, Nick!!! And especially for the fix!
I will give this a good testing. In the meantime:
Acked-by: Paul E. McKenney <paulmck-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
> Signed-off-by: Nick Piggin <npiggin-l3A5Bk7waGM@public.gmane.org>
> ---
>
> Annoyed this wasn't a crazy obscure error in the algorithm I could fix :)
> I spent all day debugging it and had to make a special test case (rcutorture
> didn't seem to trigger it), and a big RCU state logging infrastructure to log
> millions of RCU state transitions and events. Oh well.
>
> Index: linux-2.6/kernel/rcupreempt.c
> ===================================================================
> --- linux-2.6.orig/kernel/rcupreempt.c 2008-07-10 17:08:56.000000000 +1000
> +++ linux-2.6/kernel/rcupreempt.c 2008-07-10 17:09:10.000000000 +1000
> @@ -925,26 +925,22 @@ void rcu_offline_cpu(int cpu)
> spin_unlock_irqrestore(&rdp->lock, flags);
> }
>
> -void __devinit rcu_online_cpu(int cpu)
> -{
> - unsigned long flags;
> -
> - spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags);
> - cpu_set(cpu, rcu_cpu_online_map);
> - spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags);
> -}
> -
> #else /* #ifdef CONFIG_HOTPLUG_CPU */
>
> void rcu_offline_cpu(int cpu)
> {
> }
>
> -void __devinit rcu_online_cpu(int cpu)
> +#endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
> +
> +void __cpuinit rcu_online_cpu(int cpu)
> {
> -}
> + unsigned long flags;
>
> -#endif /* #else #ifdef CONFIG_HOTPLUG_CPU */
> + spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags);
> + cpu_set(cpu, rcu_cpu_online_map);
> + spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags);
> +}
>
> static void rcu_process_callbacks(struct softirq_action *unused)
> {
prev parent reply other threads:[~2008-08-01 21:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-08 21:37 2.6.26-rc9-git4: Reported regressions from 2.6.25 Rafael J. Wysocki
2008-07-09 4:49 ` Randy Dunlap
[not found] ` <20080708214903.b783ba84.randy.dunlap-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2008-07-09 14:35 ` Rafael J. Wysocki
[not found] ` <200807101725.36175.nickpiggin@yahoo.com.au>
[not found] ` <200807101725.36175.nickpiggin-/E1597aS9LT0CCvOHzKKcA@public.gmane.org>
2008-07-10 9:03 ` Kamalesh Babulal
2008-07-10 11:02 ` Alexey Dobriyan
[not found] ` <20080710110213.GA6688-QDJVlCTZ4KWTKS93B3g+7KFoa47nwP16@public.gmane.org>
2008-07-10 17:21 ` Linus Torvalds
2008-07-10 17:34 ` Ingo Molnar
[not found] ` <20080710173459.GA11648-X9Un+BFzKDI@public.gmane.org>
2008-07-10 18:06 ` Ingo Molnar
[not found] ` <20080710180620.GA30844-X9Un+BFzKDI@public.gmane.org>
2008-07-11 4:11 ` Nick Piggin
[not found] ` <200807111412.00084.nickpiggin-/E1597aS9LT0CCvOHzKKcA@public.gmane.org>
2008-08-01 21:09 ` Paul E. McKenney
2008-08-01 21:09 ` Paul E. McKenney
[not found] ` <20080710204157.GG6877@linux.vnet.ibm.com>
[not found] ` <20080710204157.GG6877-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2008-08-01 21:09 ` Paul E. McKenney
2008-08-01 21:09 ` Paul E. McKenney [this message]
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=20080801210934.GG14851@linux.vnet.ibm.com \
--to=paulmck-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
--cc=adobriyan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=bunk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=kamalesh-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org \
--cc=kernel-testers-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nickpiggin-/E1597aS9LT0CCvOHzKKcA@public.gmane.org \
--cc=protasnb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=rjw-KKrjLPT3xs0@public.gmane.org \
--cc=torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.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;
as well as URLs for NNTP newsgroup(s).