From: Jon Masters <jonathan@jonmasters.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: "Frank Ch. Eigler" <fche@redhat.com>,
Daniel Walker <dwalker@mvista.com>,
linux-rt-users <linux-rt-users@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>
Subject: Re: try_module_get and friends
Date: Mon, 10 Mar 2008 01:53:48 -0400 [thread overview]
Message-ID: <1205128428.5484.222.camel@perihelion> (raw)
In-Reply-To: <Pine.LNX.4.58.0803051611390.15882@gandalf.stny.rr.com>
On Wed, 2008-03-05 at 16:14 -0500, Steven Rostedt wrote:
> On Wed, 5 Mar 2008, Frank Ch. Eigler wrote:
> > > There's a theoretical potential for the system to crash in -rt when
> > > unloading a module. Simply because interrupts are threads.
> > >
> > > Some device has an interrupt handler that is called and preempted.
> > > At that moment the module for that device is unloaded. [...]
> > > Since the code for the interrupt handler no longer exists... KABOOM!
> >
> > Perhaps you can identify those modules that have asked for interrupts,
> > and block only them from unloading. Or, would it be outrageously
> > expensive to increment the module refcount while one of its interrupt
> > handlers is running?
>
> Actually this whole thing is theoretical. Since the device would have to
> free the irq before unloading and interrupt desc->lock protects races like
> this. Then there is the question of softirqs and tasklets. And random
> passing of pointers. But this can also happen in mainline since tasklets
> and softirqs can run in a thread.
>
> We need to look deeper. I'm not sure there is an issue here.
I can poke some more and look at what actually happens on module unload
(for now I think a quick test script loading/unloading modules in a loop
should show us whether this is enough of a problem in reality), but I do
want to point out that I was never concerned with interrupt handlers
themselves - only the assumptions mainline makes about "interrupt
context" use of pointers without an explicit try_module_get.
Rusty didn't have a simple answer either, so I'll poke.
Jon.
prev parent reply other threads:[~2008-03-10 5:55 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-04 5:20 try_module_get and friends Jon Masters
2008-03-04 5:28 ` Jon Masters
2008-03-04 20:07 ` Jon Masters
2008-03-05 19:30 ` Daniel Walker
2008-03-05 19:47 ` Steven Rostedt
2008-03-05 20:28 ` Daniel Walker
2008-03-05 20:46 ` Frank Ch. Eigler
2008-03-05 20:54 ` Steven Rostedt
2008-03-05 21:15 ` Daniel Walker
2008-03-07 16:16 ` Paul E. McKenney
2008-03-05 21:14 ` Steven Rostedt
2008-03-10 5:53 ` Jon Masters [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=1205128428.5484.222.camel@perihelion \
--to=jonathan@jonmasters.org \
--cc=dwalker@mvista.com \
--cc=fche@redhat.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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.