Re: [take6 1/3] kevent: Core files.

Andrew Morton
2006-08-11T00:57:07Z

On Thu, 10 Aug 2006 12:22:35 +0400
Evgeniy Polyakov <johnpol@2ka.mipt.ru> wrote:

> On Thu, Aug 10, 2006 at 01:02:54AM -0700, Andrew Morton (akpm@osdl.org) wrote:
> > > > Afaict this mmap function gives a user a free way of getting pinned memory.
> > > > What is the upper bound on the amount of memory which a user can thus
> > > > obtain?
> > >
> > > it is limited by maximum queue length which is 4k entries right now, so
> > > maximum number of paged here is 4k*40/page_size, i.e. about 40 pages on
> > > x86.
> >
> > Is that per user or per fd? If the latter that is, with the usual
> > RLIMIT_NOFILE, 160MBytes. 2GB with 64k pagesize. Problem ;)
>
> Per kevent fd.
> I have some ideas about better mmap ring implementation, which would
> dinamically grow it's buffer when events are added and reuse the same
> place for next events, but there are some nitpics unresolved yet.
> Let's not see there in next releases (no merge of course), until better
> solution is ready. I will change that area when other things are ready.

This is not a problem with the mmap interface per-se. If the proposed
event code permits each user to pin 160MB of kernel memory then that would
be a serious problem.