public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: george anzinger <george@mvista.com>
To: Oleg Nesterov <oleg@tv-sign.ru>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>
Subject: Re: [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups.
Date: Mon, 22 Jul 2002 11:03:03 -0700	[thread overview]
Message-ID: <3D3C48D7.4B36F14E@mvista.com> (raw)
In-Reply-To: 3D3C1A6E.53F29011@tv-sign.ru

Oleg Nesterov wrote:
> 
> Hello.
> 
> > > [...] To do this from irq.c means that it must exit with interrupts off
> > > and the the low level code needs to keep them off till the irtn. [...]
> 
> > yes, we are very careful to keep irqs disabled in do_IRQ(), both before
> > and after calling the handler.
> 
> Note that smp_xxx_interrupt() functions must be carefull
> with preemt_{disable,enable} brackets.
> 
> For example, smp_invalidate_interrupt() may be preempted
> after put_cpu(). Probably not big deal (it is return path),
> but it is better to use preempt_enable_no_resched() here -
> let ret_from_intr: do its job.
> 
> smp_{error,spurious,thermal}_interrupt() - all of them
> use printk() without bumping preemt_count and have problem
> after spin_unlock_irqrestore(&logbuf_lock, flags).
> 
> If these problems worth fixing, then preempt_stop (cli)
> can be killed in entry.S:ret_from_intr(), yes? 

I REALLY have a problem with this abstraction for cli.  I
think it just makes the code hard to read...
> If i understand
> correctly none of the irq handlers should return to low level
> code with irq enabled.

But schedule and signal code does return with interrupts
enabled, so a cli is still needed here.  Also at least some
of the trap code returns with interrupts enabled.
> 
> P.S.
> 
> May I suggest somebody with good english fix
> Documentation/preempt-locking.txt?
> It states, that disabled interrupts prevents preemption.
> Yes, but only in a sense, that the delivery of reschedule
> interrupt is suppressed.
> 
> Process with irqs disabled and current->preempt_count == 0 can
> be preempted (with interrupts enabled) after spin_lock/unlock etc.
> Even in UP case preemption can happen while calling wake_up_...().

This is really a bug and a fix is on the way.  Turning
interrupts off MUST disable preemption, but trying to
preempt from this state is so rare that the test will be in
preempt_schedule() rather than inline or an attempt to put
disable/enable code along with each cli/sti.

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Real time sched:  http://sourceforge.net/projects/rtsched/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml

  parent reply	other threads:[~2002-07-22 18:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-22 14:45 [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups Oleg Nesterov
2002-07-22 14:58 ` [patch] big IRQ lock removal, 2.5.27-D9 Ingo Molnar
2002-07-22 17:25   ` Oleg Nesterov
2002-07-22 21:19   ` Oleg Nesterov
2002-07-23  9:18     ` Ingo Molnar
2002-07-22 18:03 ` george anzinger [this message]
2002-07-22 18:04   ` [announce, patch, RFC] "big IRQ lock" removal, IRQ cleanups Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2002-07-20 20:54 Ingo Molnar
2002-07-19 21:49 ` george anzinger
2002-07-20 14:25 ` Marcin Dalecki
2002-07-21 21:17   ` Ingo Molnar
2002-07-20 20:57 ` Ingo Molnar
2002-07-20 17:57 Oleg Nesterov
2002-07-21 23:43 ` george anzinger
2002-07-21 23:50   ` 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=3D3C48D7.4B36F14E@mvista.com \
    --to=george@mvista.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    /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