Re: [take21 0/4] kevent: Generic event handling mechanism.

Andrew Morton
2006-11-07T19:35:34Z

On Tue, 07 Nov 2006 07:32:20 -0500
Jeff Garzik <jeff@garzik.org> wrote:

> Evgeniy Polyakov wrote:
> > Mmap ring buffer implementation was stopped by Andrew Morton and Ulrich
> > Drepper, process' memory is used instead. copy_to_user() is slower (and
> > some times noticebly), but there are major advantages of such approach.
>
>
> hmmmm. I say there are advantages to both.

My problem with the old mmapped ringbuffer was that it permitted each user
to pin (typically) 48MB of unswappable memory. Plus this pinned-memory
problem would put upper bounds on the ring size.

> Perhaps create a "kevent_direct_limit" resource limit for each thread.
> By default, each thread could mmap $n pinned pagecache pages. Sysadmin
> can tune certain app resource limits to permit more.
>
> I would think that retaining the option to avoid copy_to_user()
> -somehow- in -some- cases would be wise.

What Evgeniy means here is that copy_to_user() is slower than memcpy() (on
his machine, with his kernel config, at least).

Which is kinda weird and unexpected and is something which we should
investigate independently from this project. (Rather than simply going
and bypassing it!)