From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>,
Steven Rostedt <rostedt@goodmis.org>,
linux-rt-users@vger.kernel.org, mingo@elte.hu,
tglx@linutronix.de, dvhltc@us.ibm.com, tytso@us.ibm.com,
akpm@linux-foundation.org, nickpiggin@yahoo.com.au
Subject: Re: [PATCH RFC -rt] updated synchronize_all_irqs implementation
Date: Wed, 26 Sep 2007 10:43:41 -0700 [thread overview]
Message-ID: <20070926174341.GF9101@linux.vnet.ibm.com> (raw)
In-Reply-To: <d120d5000709261019v3c514fc7y49f5f0fe2c43a8a6@mail.gmail.com>
On Wed, Sep 26, 2007 at 01:19:05PM -0400, Dmitry Torokhov wrote:
> On 9/26/07, Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> > On Wed, Sep 26, 2007 at 09:16:55AM -0400, Dmitry Torokhov wrote:
> >
> > > No, I don't think synchronize_irq() will work for me. While in i8042 I
> > > know there are 2 possible IRQs (so I'd need 2 calls to
> > > synchronize_irq()) other drivers may not know what IRQ triggered their
> > > handler (or whether it was an IRQ at all).
> > >
> > > Actually, I need clarifucation on what you mean by "interrupt
> > > handlers" in sync_all_irqs(). Right now (if I understand it correctly)
> > > synchronize_sched() in mainline will wait for completion of all
> > > IRQ-like contexts. By IRQ-like context I mean code guardede by
> > > spinlock + IRQ off. Serio (input) drivers have their "interrupt"
> > > routines run in that IRQ-like context. They may be invoked as a result
> > > of real IRQ being raised but they also be invoked as a result of
> > > userspace action of some sort. It all depends on implementation of
> > > underlying serio port. So if sync_all_irqs() only waits for real IRQ
> > > handlers to complete it is not sufficient in my case...
> >
> > The synchronize_all_irqs() will not return until:
> >
> > 1. All pre-existing hardirqs have completed.
> >
> > 2. All pre-existing threaded irqs have completed.
> >
> > 3. All preempt_disable() regions of code have completed.
> >
> > 4. All irq-disable regions of code have completed.
> >
> > It will not necessarily wait for all softirqs to complete, but
> > then again, synchronize_sched() in non-rt might not wait for all
> > softirqs either, for example, if ksoftirqd is handling softirqs.
> >
> > Does that do what you need, or am I missing a case that needs
> > to be covered?
>
> As long as the list includes code guarded by
> spin_lock_irqsave()/spin_unlock_irqrestore() I am happy. Does this
> count as an irq-disable region? Peter said earlier that in -rt such
> code still runs with IRQs enabled...
If I remember correctly, it depends on whether the underlying spinlock
is spinlock_t or raw_spinlock_t.
However, doesn't spin_lock_irqsave() disable preemption in both cases
(either explicitly for the spinlock_t case or implicitly via irq
disable in the raw_spinlock_t case)? If so, synchronize_all_irqs()
should do what you want in both cases.
Thanx, Paul
next prev parent reply other threads:[~2007-09-26 17:43 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-21 5:46 [PATCH RFC -rt] synchronize_all_irqs implementation Paul E. McKenney
2007-09-23 17:34 ` [PATCH RFC -rt] updated " Paul E. McKenney
2007-09-25 17:22 ` Steven Rostedt
2007-09-25 19:34 ` Paul E. McKenney
2007-09-25 20:02 ` Steven Rostedt
2007-09-25 23:24 ` Peter Zijlstra
2007-09-26 1:11 ` Paul E. McKenney
2007-09-26 8:28 ` Peter Zijlstra
2007-09-26 13:03 ` Paul E. McKenney
2007-09-26 13:16 ` Dmitry Torokhov
2007-09-26 15:56 ` Paul E. McKenney
2007-09-26 17:19 ` Dmitry Torokhov
2007-09-26 17:43 ` Paul E. McKenney [this message]
2007-09-26 17:47 ` Steven Rostedt
2007-09-26 17:44 ` Steven Rostedt
2007-09-26 19:55 ` Paul E. McKenney
2007-09-26 20:54 ` Peter Zijlstra
2007-09-26 21:07 ` Steven Rostedt
2007-09-26 21:42 ` Paul E. McKenney
2007-09-27 14:24 ` Dmitry Torokhov
2007-09-27 14:28 ` Steven Rostedt
2007-09-27 14:32 ` Dmitry Torokhov
2007-09-26 21:22 ` Paul E. McKenney
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=20070926174341.GF9101@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=dmitry.torokhov@gmail.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=nickpiggin@yahoo.com.au \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
--cc=tytso@us.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.