From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-rt-users@vger.kernel.org
Cc: mingo@elte.hu, tglx@linutronix.de, dvhltc@us.ibm.com, tytso@us.ibm.com
Subject: Question on -rt synchronize_irq()
Date: Thu, 20 Sep 2007 18:12:22 -0700 [thread overview]
Message-ID: <20070921011222.GA12394@linux.vnet.ibm.com> (raw)
Hello!
Color me blind, but I don't see how the following race is avoided:
CPU 0: A hardware interrupt is received for a threaded irq, which
eventually results in do_hardirq() being invoked and the
descriptor lock being acquired. Because the IRQ_INPROGRESS
status bit is set, execution continues. Once the handler
returns, having already cleared the IRQ_INPROGRESS status bit,
the descriptor lock is released.
CPU 1: A second hardware interrupt is received for the same threaded
irq, which also wends its way to do_hardirq() with the
IRQ_INPROGRESS status bit set. It enters the handler (having
released the descriptor lock) and accesses some data structure
that CPU 2 now wants to get rid of.
CPU 2: A synchronize_irq() is executed, again for this same irq.
Because the descriptor status does not have the IRQ_NODELAY
bit set, and because the IRQ_INPROGRESS status bit is set,
this task blocks.
CPU 0: Execution continues near the end of do_hardirq(), which notices
that the descriptor wait_for_handler queue is non-empty,
and therefore wakes up CPU 2's task.
CPU 2: The task starts running, and proceeds to clean up the data
structures that CPU 1 is still using.
CPU 1: This second handler is suddenly and fatally disappointed by
the disappearance of its data structures.
So what am I missing here?
Thanx, Paul
next reply other threads:[~2007-09-21 1:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-21 1:12 Paul E. McKenney [this message]
2007-09-23 17:46 ` Question on -rt synchronize_irq() 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=20070921011222.GA12394@linux.vnet.ibm.com \
--to=paulmck@linux.vnet.ibm.com \
--cc=dvhltc@us.ibm.com \
--cc=linux-rt-users@vger.kernel.org \
--cc=mingo@elte.hu \
--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.