From: Axel Rasmussen <axelrasmussen@google.com>
To: "Robert O'Callahan" <roc@pernos.co>
Cc: Andrea Arcangeli <aarcange@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>, Peter Xu <peterx@redhat.com>,
Ingo Molnar <mingo@redhat.com>, Linux-MM <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>, Kyle Huey <khuey@pernos.co>
Subject: Re: Userspace notifications for observing userfaultfd faults
Date: Tue, 11 May 2021 15:24:03 -0700 [thread overview]
Message-ID: <CAJHvVciAMt_PJ=V-q8_7X02cQmor3wVCTMKbpSQ9UhpnwFAa1A@mail.gmail.com> (raw)
In-Reply-To: <CAOp6jLaSLC4O0ZayFz1BiO6UqC7pK_umFUb29bgXDu6U5dUQgg@mail.gmail.com>
On Tue, May 11, 2021 at 3:15 PM Robert O'Callahan <roc@pernos.co> wrote:
>
> On Wed, May 12, 2021 at 6:12 AM Axel Rasmussen <axelrasmussen@google.com> wrote:
> > Is some combination of bpf and kprobes a possible solution? There are
> > some seemingly relevant examples here:
> > https://github.com/iovisor/bpftrace/blob/master/docs/tutorial_one_liners.md
> >
> > I haven't tried it, but it seems like attaching to handle_userfault()
> > would give similar information to perf_count_sw_page_faults, but for
> > userfaults.
>
> That would probably work in some cases, but as Kyle said that requires
> privileges and currently rr can run unprivileged (if you set
> perf_event_paranoid to 1 or less) and usually does. Also, AFAIK,
> kprobing handle_userfault would not be a stable ABI.
True, it would not be a stable ABI. That could be solved by adding a
real tracepoint, instead of just relying on a kprobe on a particular
function. But, I don't think that solves the concern around
permissions.
I am no expert on perf_count_sw_page_faults and similar, so I'll leave
it up to others to give an opinion on extending that.
>
> Rob
prev parent reply other threads:[~2021-05-11 22:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-11 0:37 Robert O'Callahan
2021-05-11 18:11 ` Axel Rasmussen
2021-05-11 18:25 ` Kyle Huey
2021-05-11 22:15 ` Robert O'Callahan
2021-05-11 22:24 ` Axel Rasmussen [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='CAJHvVciAMt_PJ=V-q8_7X02cQmor3wVCTMKbpSQ9UhpnwFAa1A@mail.gmail.com' \
--to=axelrasmussen@google.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=khuey@pernos.co \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@redhat.com \
--cc=peterx@redhat.com \
--cc=roc@pernos.co \
/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