From: Peter Zijlstra <peterz@infradead.org>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Erik Bosman <ebn310@few.vu.nl>, Ingo Molnar <mingo@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
Kees Cook <keescook@chromium.org>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Andrea Arcangeli <aarcange@redhat.com>,
Valdis Kletnieks <Valdis.Kletnieks@vt.edu>
Subject: Re: [RFC 5/5] x86,perf: Only allow rdpmc if a perf_event is mapped
Date: Mon, 20 Oct 2014 10:33:26 +0200 [thread overview]
Message-ID: <20141020083326.GA3219@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <CALCETrXzwA3JH8xYLFcLdUSXAJi05Q62dZP3yOjZJTxgVugDrQ@mail.gmail.com>
On Sun, Oct 19, 2014 at 03:57:54PM -0700, Andy Lutomirski wrote:
> > Maybe, but at that point we commit to yet another ABI... I'd rather just
> > put a 'sane' implementation in a library or so.
>
> This cuts both ways, though. For vdso timekeeping, the underlying
> data structure has changed repeatedly, sometimes to add features, and
> sometimes for performance, and the vdso has done a good job insulating
> userspace from it. (In fact, until 3.16, even the same exact kernel
> version couldn't be relied on to have the same data structure with
> different configs, and even now, no one really wants to teach user
> libraries how to parse the pvclock data structures.)
Fair enough, but as it stands we've already committed to the data
structure exposed to userspace.
> I would certainly not suggest putting anything beyond the bare minimum
> into the vdso.
Depends on what you really want to do I suppose, if you've got a pinned
event and know there cannot be multiplexing, not doing the time reads
the multiplications and all that saves a ton of cycles. But in generic I
suppose you have to do all that.
> FWIW, something should probably specify exactly when it's safe to try
> a userspace rdpmc. I think that the answer is that, for a perf event
> watching a pid, only that pid can do it (in particular, other threads
> must not try). For a perf event monitoring a whole cpu, the answer is
> less clear to me.
This all was really only meant to be used for self-monitoring, so where
an event is attached to the very same task, anything else and I'm find
disabling it.
next prev parent reply other threads:[~2014-10-20 8:33 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 22:57 [RFC 0/5] CR4 handling improvements Andy Lutomirski
2014-10-14 22:57 ` [RFC 1/5] x86: Clean up cr4 manipulation Andy Lutomirski
2014-10-16 8:16 ` Peter Zijlstra
2014-10-16 11:18 ` Borislav Petkov
2014-10-16 11:29 ` Borislav Petkov
2014-10-16 15:32 ` Andy Lutomirski
2014-10-16 15:47 ` Borislav Petkov
2014-10-14 22:57 ` [RFC 2/5] x86: Store a per-cpu shadow copy of CR4 Andy Lutomirski
2014-10-16 8:26 ` Peter Zijlstra
2014-10-16 11:49 ` Borislav Petkov
2014-10-16 15:30 ` Andy Lutomirski
2014-10-14 22:57 ` [RFC 3/5] x86: Add a comment clarifying LDT context switching Andy Lutomirski
2014-10-16 15:49 ` Borislav Petkov
2014-10-16 16:21 ` Andy Lutomirski
2014-10-21 5:41 ` Borislav Petkov
2014-10-21 5:44 ` Andy Lutomirski
2014-10-21 6:05 ` Borislav Petkov
2014-10-14 22:57 ` [RFC 4/5] perf: Add pmu callbacks to track event mapping and unmapping Andy Lutomirski
2014-10-14 22:57 ` [RFC 5/5] x86,perf: Only allow rdpmc if a perf_event is mapped Andy Lutomirski
2014-10-16 8:42 ` Peter Zijlstra
2014-10-16 15:37 ` Andy Lutomirski
2014-10-16 15:57 ` Borislav Petkov
2014-10-17 0:00 ` Andy Lutomirski
2014-10-19 20:23 ` Andy Lutomirski
2014-10-19 21:33 ` Peter Zijlstra
2014-10-19 22:05 ` Andy Lutomirski
2014-10-19 22:20 ` Peter Zijlstra
2014-10-19 22:57 ` Andy Lutomirski
2014-10-20 8:33 ` Peter Zijlstra [this message]
2014-10-20 16:49 ` Andy Lutomirski
2014-10-20 17:39 ` Andy Lutomirski
2014-10-21 8:59 ` Peter Zijlstra
2014-10-19 21:35 ` Peter Zijlstra
2014-10-20 0:08 ` Andy Lutomirski
2014-10-20 8:48 ` Peter Zijlstra
2014-10-20 9:24 ` Martin Schwidefsky
2014-10-20 10:51 ` Hendrik Brueckner
2014-10-21 9:14 ` Peter Zijlstra
2014-10-21 15:52 ` Andy Lutomirski
2014-10-21 4:06 ` [RFC 0/5] CR4 handling improvements Vince Weaver
2014-10-21 4:28 ` Andy Lutomirski
2014-10-21 15:00 ` Vince Weaver
2014-10-21 16:04 ` Peter Zijlstra
2014-10-21 17:05 ` Vince Weaver
2014-10-23 11:42 ` Peter Zijlstra
2014-10-24 12:41 ` Vince Weaver
2014-10-24 22:14 ` Andy Lutomirski
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=20141020083326.GA3219@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=Valdis.Kletnieks@vt.edu \
--cc=aarcange@redhat.com \
--cc=acme@kernel.org \
--cc=ebn310@few.vu.nl \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@redhat.com \
--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.