mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@osdl.org>
Cc: Jens Axboe <axboe@suse.de>,
	linux-kernel@vger.kernel.org, Maneesh Soni <maneesh@in.ibm.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Juergen Kreileder <jk@blackdown.de>
Subject: Re: Fw: [Bug 4559] New: cfq scheduler lockup: NMI oops while runningltp  - 20050207  on 2.6.12-rc2-mm3 with kdump enabled
Date: Sat, 30 Apr 2005 16:42:34 +0400	[thread overview]
Message-ID: <42737D3A.ABEF2022@tv-sign.ru> (raw)
In-Reply-To: <20050429000038.1da6f2e1.akpm@osdl.org>

Andrew Morton wrote:
> 
>  http://bugme.osdl.org/show_bug.cgi?id=4559
> 
> Timer bug, I guess.

Yes, the new timer code is racy. Example:

spinlock_t LOCK;

void void timer_func()
{
	spin_lock(&LOCK);
}

timer_list TIMER = TIMER_INITIALIZER(timer_func);

-------------------------------------------------------------------
CPU_0					CPU_1

					add_timer(&TIMER);
spin_lock(&LOCK);
					__run_timers:
						sets ->running_timer = &TIMER;
						calls timer_func()
							waits for &LOCK

__mod_timer(&TIMER);
	/* Ensure the timer is serialized. */
	retries while ->running_timer == &TIMER


Many thanks to Maneesh Soni for his excellent analysis in
http://bugme.osdl.org/show_bug.cgi?id=4559.

Note that del_timer_sync has this problem too, but this
situation is forbidden by synchronization rules.

At the moment I don't have a proper solution.

One option is to change __mod_timer() so that it would not
switch ->base when the timer is already running. But this
would be behavioural change: currently __mod_timer() guarantees
that the timer would be armed on the local cpu.

I'll try to find a solution, but perhaps it's better to drop
this patch for now.

Oleg.

       reply	other threads:[~2005-04-30 12:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20050429000038.1da6f2e1.akpm@osdl.org>
2005-04-30 12:42 ` Oleg Nesterov [this message]
2005-04-30 17:09   ` Oleg Nesterov
2005-04-30 20:10     ` Andrew Morton

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=42737D3A.ABEF2022@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=axboe@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=jk@blackdown.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.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

all inboxes | Powered by JetHome®