Re: [PATCH/RFC] ummunot: Userspace support for MMU notifications

From: Andrew Morton
Date: Wed Jul 22 2009 - 15:42:20 EST


On Wed, 22 Jul 2009 12:27:42 -0700
Roland Dreier <rdreier@xxxxxxxxx> wrote:

> > > 1. ioctl() to register/unregister an address range to watch in the
> > > kernel (cf struct ummunot_register_ioctl in <linux/ummunot.h>).
> > >
> > > 2. read() to retrieve events generated when a mapping in a watched
> > > address range is invalidated (cf struct ummunot_event in
> > > <linux/ummunot.h>). select()/poll()/epoll() and SIGIO are handled
> > > for this IO.
> > >
> > > 3. mmap() one page at offset 0 to map a kernel page that contains a
> > > generation counter that is incremented each time an event is
> > > generated. This allows userspace to have a fast path that checks
> > > that no events have occurred without a system call.
> >
> > If you stand back and squint, each of 1, 2 and 3 are things which the
> > kernel already provides for the delivery of ftrace events to userspace.
> >
> > Did you look at reusing all that stuff?
>
> No, not really... will investigate a bit further. Any pointers to how
> the ftrace stuff might work?

I know who to cc ;)

> Specifically how #3 maps to ftrace is a
> little obscure to me; and also as I understand it, ftrace is controlled
> through debugfs, which means there's a bit of hassle to make this usable
> on a default install. And also I'm not sure how the ftrace control path
> really maps to "here's a 100 address ranges I'd like events for".
>
> So at a first glance after unsquinting a bit I'm not sure how good the
> fit really is.

Oh. Here was I hoping that all that code was about to become useful.
<runs away>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/