LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Nobuhiro Tachino <ntachino@redhat.com>
Cc: Takao Indoh <indou.takao@soft.fujitsu.com>,
	linux-kernel@vger.kernel.org,
	Christoph Hellwig <hch@infradead.org>, Andi Kleen <ak@muc.de>
Subject: Re: [3/4] [PATCH]Diskdump - yet another crash dump function
Date: Tue, 22 Jun 2004 12:19:14 +0200	[thread overview]
Message-ID: <20040622101914.GA20623@elte.hu> (raw)
In-Reply-To: <40D747B1.9030406@redhat.com>


* Nobuhiro Tachino <ntachino@redhat.com> wrote:

> Your new dump_run_timers() calls __run_timers() directly. I think
> that's the reason of unstability. __run_timers() calls
> spin_unlock_irq() and enables IRQ, but diskdump expects everything
> runs with IRQ disabled.

indeed!

luckily we can solve this in the upstream kernel without too much fuss,
see the patch below. All callers of __run_timers() run with irqs
enabled.

(NOTE: we unconditionally disable interrupts after having run the timer
fn - this solves the problem of a timer fn keeping irqs disabled.)

does this patch stabilize diskdump?

	Ingo

--- linux/kernel/timer.c.orig
+++ linux/kernel/timer.c
@@ -423,8 +423,9 @@ static int cascade(tvec_base_t *base, tv
 static inline void __run_timers(tvec_base_t *base)
 {
 	struct timer_list *timer;
+	unsigned long flags;
 
-	spin_lock_irq(&base->lock);
+	spin_lock_irqsave(&base->lock, flags);
 	while (time_after_eq(jiffies, base->timer_jiffies)) {
 		struct list_head work_list = LIST_HEAD_INIT(work_list);
 		struct list_head *head = &work_list;
@@ -453,14 +454,14 @@ repeat:
 			set_running_timer(base, timer);
 			smp_wmb();
 			timer->base = NULL;
-			spin_unlock_irq(&base->lock);
+			spin_unlock_irqrestore(&base->lock, flags);
 			fn(data);
 			spin_lock_irq(&base->lock);
 			goto repeat;
 		}
 	}
 	set_running_timer(base, NULL);
-	spin_unlock_irq(&base->lock);
+	spin_unlock_irqrestore(&base->lock, flags);
 }
 
 #ifdef CONFIG_NO_IDLE_HZ

  reply	other threads:[~2004-06-22 14:48 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-27  9:33 [PATCH]Diskdump - yet another crash dump function Takao Indoh
2004-05-27 12:36 ` [1/4] " Takao Indoh
2004-05-27 12:37 ` [2/4] " Takao Indoh
2004-05-27 13:48   ` Christoph Hellwig
2004-05-28  2:13     ` Takao Indoh
2004-05-27 12:39 ` [3/4] " Takao Indoh
2004-05-27 13:51   ` Christoph Hellwig
2004-05-27 21:04     ` Ingo Molnar
2004-06-17 11:34       ` Takao Indoh
2004-06-17 12:00         ` Christoph Hellwig
2004-06-17 12:45           ` Takao Indoh
2004-06-17 12:13         ` Ingo Molnar
2004-06-17 12:18           ` Christoph Hellwig
2004-06-17 12:32             ` Ingo Molnar
2004-06-17 14:56               ` Jeff Moyer
2004-06-17 15:45                 ` Nobuhiro Tachino
2004-06-17 13:04           ` Takao Indoh
2004-06-17 13:10             ` Ingo Molnar
2004-06-17 13:11               ` Ingo Molnar
2004-06-17 13:15                 ` Ingo Molnar
2004-06-17 14:00                 ` Takao Indoh
2004-06-17 14:45                   ` Nobuhiro Tachino
2004-06-17 14:53                     ` Takao Indoh
2004-06-18 12:02           ` Takao Indoh
2004-06-21 20:40             ` Nobuhiro Tachino
2004-06-22 10:19               ` Ingo Molnar [this message]
2004-06-23 12:11                 ` Takao Indoh
2004-06-23 13:00                   ` Takao Indoh
2004-06-21  5:46           ` Keith Owens
2004-06-21  6:25             ` Takao Indoh
2004-06-22  4:21             ` Rob Landley
2004-06-22  7:56             ` Ingo Molnar
2004-05-28  9:38     ` Takao Indoh
2004-05-27 12:40 ` [4/4] " Takao Indoh
2004-05-27 13:34 ` [Document][PATCH]Diskdump " Takao Indoh
2004-06-03 13:10 ` [PATCH]Diskdump " Pavel Machek
2004-06-04  0:44   ` Takao Indoh
2004-06-04  9:33     ` Pavel Machek
     [not found] <20pwP-55v-5@gated-at.bofh.it>
     [not found] ` <20suK-7C5-11@gated-at.bofh.it>
     [not found]   ` <20tAB-5c-31@gated-at.bofh.it>
     [not found]     ` <20AiB-69m-17@gated-at.bofh.it>
2004-05-27 21:31       ` [3/4] " Andi Kleen
2004-05-28  7:38         ` Ingo Molnar

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=20040622101914.GA20623@elte.hu \
    --to=mingo@elte.hu \
    --cc=ak@muc.de \
    --cc=hch@infradead.org \
    --cc=indou.takao@soft.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ntachino@redhat.com \
    /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).