From: Robert Love <rml@tech9.net>
To: paulus@samba.org
Cc: george anzinger <george@mvista.com>, linux-kernel@vger.kernel.org
Subject: Re: in_interrupt race
Date: 22 Apr 2002 19:15:52 -0400 [thread overview]
Message-ID: <1019517352.1469.19.camel@phantasy> (raw)
In-Reply-To: <15556.38775.439624.762586@argo.ozlabs.ibm.com>
On Mon, 2002-04-22 at 19:06, Paul Mackerras wrote:
> > If (b) we are preemptible, and then it does not matter what happens
> > during this check, since we are not preemptible and the check won't
> > return a false true.
>
> Huh? First you say we are preemptible, then you say we are not, in
> the same sentence?
Sorry - yes, we are preemptible. I meant to say even if we do preempt,
we still end up returning false, which is all we care about.
> No. The point is that in_interrupt() asks two separate questions:
> (1) which cpu are we on? (2) is that cpu in interrupt context?
> If we switch cpus between (1) and (2) then we can get a false positive
> from in_interrupt().
How can we get a false positive? Positive => we are in an interrupt.
If we are in an interrupt, we can't preempt, so this is not an issue.
Negative => we are not in an interrupt. Even if we do preempt, we
preempt to a CPU where we are _also_ not in an interrupt, so we get the
same answer. In other words, if we preempt, no matter where we were or
where we end up, in_interrupt is (correctly) false.
> > This says nothing of the CPU you may of been on, but then who cares
> > about it?
>
> We don't care about any cpu, what we want to know is whether the
> current thread of execution is in process context or not. Which is
> why it is bogus for in_interrupt to need to ask which cpu we are on,
> and why the local_bh_count and local_irq_count should go in the
> thread_info struct IMHO. I am working on that now. :)
Right, but I don't see a flaw (as noted previously) in the current
scheme... if preemption is a problem, then we are certainly in process
context so it is a non-issue!
Robert Love
next prev parent reply other threads:[~2002-04-22 23:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-20 10:27 in_interrupt race Paul Mackerras
2002-04-22 19:02 ` Robert Love
2002-04-22 21:39 ` george anzinger
2002-04-22 21:54 ` Robert Love
2002-04-22 23:06 ` Paul Mackerras
2002-04-22 23:15 ` Robert Love [this message]
2002-04-23 3:25 ` Rusty Russell
2002-04-23 8:31 ` Russell King
2002-04-24 4:43 ` Rusty Russell
2002-04-22 23:22 ` Paul Mackerras
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=1019517352.1469.19.camel@phantasy \
--to=rml@tech9.net \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulus@samba.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 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.