mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zwane Mwaikambo <zwane@fsmlabs.com>
To: Duncan Sands <baldrick@free.fr>
Cc: Keith Owens <kaos@sgi.com>, Andrew Morton <akpm@osdl.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][2.6-mm] i386: enable interrupts on contention in spin_lock_irq
Date: Wed, 26 May 2004 21:45:33 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0405262111310.1794@montezuma.fsmlabs.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0405260401320.1794@montezuma.fsmlabs.com>

On Wed, 26 May 2004, Zwane Mwaikambo wrote:

> On Wed, 26 May 2004, Duncan Sands wrote:
>
> > > However I have seen buggy code where spin_lock_irq() was issued with
> > > interrupts disabled. [...]
> >
> > Some time ago I sent a patch to lkml that tests for this [1].
> > And guess what - it happens all over the place [2].  Also, the
> > scheduler often gets called with interrupts disabled (schedule()
> > does spin_lock_irq), but the cases I checked all turned out to be
> > OK [3].  Perhaps it is more problematic now?
>
> I'll run with the debug code and audit any suspect ones. The ones
> mentioned below all seem ok.

The oft hit one is triggered from the timer softirq;

Badness in __run_timers at kernel/timer.c:427
 [<c0107705>] dump_stack+0x15/0x20
 [<c012d497>] run_timer_softirq+0x2e7/0x2f0
 [<c0128bc8>] __do_softirq+0xb8/0xc0
 [<c0128c05>] do_softirq+0x35/0x40
 [<c0108fb5>] do_IRQ+0x1a5/0x240

static inline void __run_timers(tvec_base_t *base)
{
	struct timer_list *timer;

	spin_lock_irq(&base->lock); <==
	...
		timer->base = NULL;
		spin_unlock_irq(&base->lock);
		fn(data);
		spin_lock_irq(&base->lock);
	...
	spin_unlock_irq(&base->lock);
}

Most of them would be because the timer irq is setup with SA_INTERRUPT,
this particular one looks safe too, we're on the exit path of irq handling
and there is no critical section to protect. We're also about to
unconditionally enable interrupts again before running the timers. There
also isn't much contention on this lock on most workloads, some
heavy tcp networking load should help that out.

I'll look for others too.

	Zwane

      reply	other threads:[~2004-05-27  1:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-26  7:11 Zwane Mwaikambo
2004-05-26  7:29 ` Keith Owens
2004-05-26  7:48   ` Zwane Mwaikambo
2004-05-26  7:58   ` Duncan Sands
2004-05-26  8:11     ` Zwane Mwaikambo
2004-05-27  1:45       ` Zwane Mwaikambo [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=Pine.LNX.4.58.0405262111310.1794@montezuma.fsmlabs.com \
    --to=zwane@fsmlabs.com \
    --cc=akpm@osdl.org \
    --cc=baldrick@free.fr \
    --cc=kaos@sgi.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®