LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: Dave Young <hidave.darkstar@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [BUG] using smp_processor_id() in preemptible as suspending
Date: Wed, 27 Feb 2008 16:26:06 -0800	[thread overview]
Message-ID: <20080228002606.GE9634@linux.vnet.ibm.com> (raw)
In-Reply-To: <200802280011.49386.fzu@wemgehoertderstaat.de>

On Thu, Feb 28, 2008 at 12:11:48AM +0100, Karsten Wiese wrote:
> Am Mittwoch, 27. Februar 2008 schrieb Dave Young:
> > On Wed, Feb 27, 2008 at 3:45 AM, Paul E. McKenney
> > <paulmck@linux.vnet.ibm.com> wrote:
> > > On Tue, Feb 26, 2008 at 08:33:54AM -0800, Andrew Morton wrote:
> > >  > On Tue, 26 Feb 2008 16:24:11 +0800 Dave Young <hidave.darkstar@gmail.com> wrote:
> > >  >
> > >  > > I don't know whom I should mail to, could you cc the proper guy? Thanks.
> > >
> > >  Hello, Dave,
> > >
> > >  Would you be willing to try out the following (untested, might not even
> > >  compile) patch show at the very end of this message?  This assumes that
> > >  you were running with CONFIG_PREEMPT_RCU, which seems most likely based
> > >  on looking at your oops.
> > 
> > Built ok, but can't even resume now. (dark screen with cursor blinking
> > on top-left of minitor)
> 
> Dave, can you give this untested patch a try?

The second part of the patch is similar to the one I sent to Dave
earlier for testing (it worked for him, so I just now posted to LKML).
The advantage of my approach is that it retains the pair of disabled
sections, rather than merging them as yours does.

That said, as near as I can tell, your patch should work.

							Thanx, Paul

> thanks,
>       Karsten
> 
> ---
> diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c
> index c7c5209..5a7f8fc 100644
> --- a/kernel/rcupreempt.c
> +++ b/kernel/rcupreempt.c
> @@ -878,18 +878,20 @@ void rcu_offline_cpu(int cpu)
>  	 * Otherwise rcu_barrier() will fail
>  	 */
> 
> -	spin_lock_irqsave(&rdp->lock, flags);
> +	local_irq_save(flags);
> +
> +	spin_lock(&rdp->lock);
>  	rcu_offline_cpu_enqueue(rdp->donelist, rdp->donetail, list, tail);
>  	for (i = GP_STAGES - 1; i >= 0; i--)
>  		rcu_offline_cpu_enqueue(rdp->waitlist[i], rdp->waittail[i],
>  						list, tail);
>  	rcu_offline_cpu_enqueue(rdp->nextlist, rdp->nexttail, list, tail);
> -	spin_unlock_irqrestore(&rdp->lock, flags);
> +	spin_unlock(&rdp->lock);
>  	rdp->waitlistcount = 0;
> 
>  	/* Disengage the newly dead CPU from the grace-period computation. */
> 
> -	spin_lock_irqsave(&rcu_ctrlblk.fliplock, flags);
> +	spin_lock(&rcu_ctrlblk.fliplock);
>  	rcu_check_mb(cpu);
>  	if (per_cpu(rcu_flip_flag, cpu) == rcu_flipped) {
>  		smp_mb();  /* Subsequent counter accesses must see new value */
> @@ -906,7 +908,7 @@ void rcu_offline_cpu(int cpu)
> 
>  	cpu_clear(cpu, rcu_cpu_online_map);
> 
> -	spin_unlock_irqrestore(&rcu_ctrlblk.fliplock, flags);
> +	spin_unlock(&rcu_ctrlblk.fliplock);
> 
>  	/*
>  	 * Place the removed callbacks on the current CPU's queue.
> @@ -919,11 +921,13 @@ void rcu_offline_cpu(int cpu)
>  	 */
> 
>  	rdp = RCU_DATA_ME();
> -	spin_lock_irqsave(&rdp->lock, flags);
> +	spin_lock(&rdp->lock);
>  	*rdp->nexttail = list;
>  	if (list)
>  		rdp->nexttail = tail;
> -	spin_unlock_irqrestore(&rdp->lock, flags);
> +	spin_unlock(&rdp->lock);
> +
> +	local_irq_restore(flags);
>  }
> 
>  void __devinit rcu_online_cpu(int cpu)

  reply	other threads:[~2008-02-28  0:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-26  8:24 Dave Young
2008-02-26 16:33 ` Andrew Morton
2008-02-26 19:45   ` Paul E. McKenney
2008-02-27  1:04     ` Dave Young
2008-02-27 23:11       ` Karsten Wiese
2008-02-28  0:26         ` Paul E. McKenney [this message]
2008-02-27  0:39   ` Dave Young

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=20080228002606.GE9634@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=fzu@wemgehoertderstaat.de \
    --cc=hidave.darkstar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --subject='Re: [BUG] using smp_processor_id() in preemptible as suspending' \
    /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

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).