netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Mattia Dongili <malattia@linux.it>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	netdev@vger.kernel.org, netfilter-devel@lists.netfilter.org
Subject: Re: dynticks + iptables almost stops the boot process [was: Re: 2.6.20-rc6-mm3]
Date: Tue, 6 Feb 2007 17:48:26 +0100	[thread overview]
Message-ID: <20070206164826.GA3491@elte.hu> (raw)
In-Reply-To: <20070202204344.GB4262@inferi.kami.home>


Mattia,

* Mattia Dongili <malattia@linux.it> wrote:

> > I have it halfways reproducible now and I'm working to find the root 
> > cause. Thanks for providing the info.
> 
> Great, I'm obviously available to test any patch :)

Could you try the patch below? The RCU serialization code (a rare call 
but can be common in some types of setups) has a nasty implicit 
dependency on the HZ tick - which until now was a hidden wart but became 
an explicit bug under dynticks. Maybe this is what is slowing down your 
box.

	Ingo

------------------------->
Subject: [patch] dynticks: make sure synchronize_rcu() completes
From: Ingo Molnar <mingo@elte.hu>

synchronize_rcu() has a nasty implicit dependency on the HZ tick: it 
relies on another CPU finishing all RCU work so that this CPU can finish 
its RCU work too - in IRQ context. But wait_for_completion() goes to 
sleep indefinitely on dynticks and there might be no other IRQs to this 
CPU for a long time.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 kernel/rcupdate.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Index: linux/kernel/rcupdate.c
===================================================================
--- linux.orig/kernel/rcupdate.c
+++ linux/kernel/rcupdate.c
@@ -85,8 +85,13 @@ void synchronize_rcu(void)
 	/* Will wake me after RCU finished */
 	call_rcu(&rcu.head, wakeme_after_rcu);
 
-	/* Wait for it */
-	wait_for_completion(&rcu.completion);
+	/*
+	 * Wait for it. Note: on dynticks RCU completion needs to be
+	 * polled frequently, to make sure we finish work. If this CPU
+	 * goes idle then another CPU cannot finish this CPU's work.
+	 */
+	while (wait_for_completion_timeout(&rcu.completion, HZ/100 ? : 1) == 0)
+		/* nothing */;
 }
 
 static void rcu_barrier_callback(struct rcu_head *notused)

  reply	other threads:[~2007-02-06 16:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20070129204528.eb8d695e.akpm@osdl.org>
     [not found] ` <20070131215241.GB2890@inferi.kami.home>
     [not found]   ` <20070131232130.GC4137@inferi.kami.home>
     [not found]     ` <1170358572.29240.292.camel@localhost.localdomain>
     [not found]       ` <1170360101.29240.297.camel@localhost.localdomain>
     [not found]         ` <20070201211137.GA2830@inferi.kami.home>
     [not found]           ` <1170369202.29240.339.camel@localhost.localdomain>
2007-02-02 19:18             ` dynticks + iptables almost stops the boot process [was: Re: 2.6.20-rc6-mm3] Mattia Dongili
2007-02-02 20:27               ` Thomas Gleixner
2007-02-02 20:43                 ` Mattia Dongili
2007-02-06 16:48                   ` Ingo Molnar [this message]
2007-02-06 19:28                     ` Mattia Dongili
2007-02-06 23:12                       ` Tilman Schmidt
2007-02-06 23:17                         ` Thomas Gleixner
2007-02-07  1:01                           ` Andrew Morton
2007-02-07 19:33                             ` Ingo Molnar
2007-02-06 22:12 ` [RFC: -mm patch] drivers/net/atl1/: possible cleanups Adrian Bunk
2007-02-07  0:19   ` Jay Cliburn
2007-02-07  0:22     ` Jeff Garzik
2007-02-07  0:24       ` J. K. Cliburn
2007-02-07  0:24     ` Adrian Bunk

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=20070206164826.GA3491@elte.hu \
    --to=mingo@elte.hu \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malattia@linux.it \
    --cc=mingo@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=tglx@linutronix.de \
    /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).