From: "Stone, Joshua I" <joshua.i.stone@intel.com>
To: "Frank Ch. Eigler" <fche@redhat.com>, <systemtap@sources.redhat.com>
Subject: RE: [Bug translator/1276] support more timer varieties
Date: Fri, 02 Dec 2005 02:54:00 -0000 [thread overview]
Message-ID: <CBDB88BFD06F7F408399DBCF8776B3DC05C0403E@scsmsx403.amr.corp.intel.com> (raw)
Frank Ch. Eigler wrote:
> Hi -
>
>> [...] timer.profile is always in interrupt, so current->tgid is not
>> accessed. I tried this without the in_interrupt check, and the pids
>> I got looked fine. [...] The reason you might NOT want to read
>> from current in an interrupt is that it may be misleading to the
>> user if they're not expecting this.
>
> Is that the only reason? I was under the impression that it is also
> possible for utterly fictional "current" values to be left in place,
> which could cause problems if dereferenced.
AFAIK, current is always valid. I know in the Vtune driver we
frequently use current during PMU interrupts, and there's never been an
issue. Not to say that Vtune is difinitive - I scanned the kernel
sources as well, and didn't see anything making checks before accessing
current. I also didn't find anything through Google. So unless someone
knows otherwise, or has a reference to cast doubt on this, I think it's
safe.
The "let's not mislead the user" issue may be minor enough that we just
say who cares...
> Or a "I believe `current' is safe to dereference here." flag.
If we determine that there are specific unsafe instances of current,
then yes, this would be nice.
> I am rather embarrassed to suggest this in the interim:
>
> # if (unlikely(in_interrupt() &&
> # strcmp(CONTEXT->probe_point, "timer.profile")))
Hmm... I think we can at least do:
# if (unlikely(in_interrupt() &&
# (CONTEXT->probe_point != "timer.profile")))
Since they are both literal strings, string-pooling should make them
identical pointers. We could whitelist probes this way, but... yuck...
I hope we can get a better answer to the validity of "current".
Josh
next reply other threads:[~2005-12-02 2:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 2:54 Stone, Joshua I [this message]
2005-12-06 1:03 ` Frank Ch. Eigler
2005-12-06 1:11 ` Roland McGrath
-- strict thread matches above, loose matches on Subject: below --
2005-12-08 22:01 Keshavamurthy, Anil S
2005-12-08 21:55 Stone, Joshua I
2005-12-08 5:35 Keshavamurthy, Anil S
2005-12-08 2:40 Stone, Joshua I
2005-12-08 1:53 Stone, Joshua I
2005-12-06 1:40 Stone, Joshua I
2005-12-06 15:07 ` Frank Ch. Eigler
2005-12-06 18:47 ` Roland McGrath
[not found] <CBDB88BFD06F7F408399DBCF8776B3DC05C039A8@scsmsx403.amr.corp.intel.com>
2005-12-01 21:38 ` Frank Ch. Eigler
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=CBDB88BFD06F7F408399DBCF8776B3DC05C0403E@scsmsx403.amr.corp.intel.com \
--to=joshua.i.stone@intel.com \
--cc=fche@redhat.com \
--cc=systemtap@sources.redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).