Re: [patch 016/104] epoll: introduce resource usage limits

From: Bron Gondwana
Date: Sat Jan 24 2009 - 08:04:07 EST


On Fri, Jan 23, 2009 at 09:06:31AM -0800, Greg KH wrote:
> On Fri, Jan 23, 2009 at 08:47:45PM +1100, Bron Gondwana wrote:
> > 2) if we're going to stick with 128, is there any way to query the
> > kernel as to how close to the limit it's getting? [...]
>
> Good idea, we should report this somewhere for the very reasons you
> suggest. Can you write up a patch to do this? If not, I'll see what I
> can do.

The attached patches do this - the first bumps the default to 1024, and
the second adds /proc/sys/fs/epoll/limits which contains 4 values. The
first two are the maximum current value for each field, and the second
two are the values of max_user_instances and max_user_watches again,
similar to the file-max interface.

Any particular reason why the naming is so different? I would have used
"max" for the current maximum, but the name is already taken by the
limit keys!

By the way, I have approximately no experience with any of this, so
coding standards criticism or "stuff should go elsewhere" suggestions
would be very gratefully received. This is pretty much the first set
of code I managed that compiled, booted and gave me plausible values.

You can also find the attached in the brong-epoll branch on
http://github.com/brong/linux-2.6/ - I'm working against Linus'
latest.

Thanks,

Bron.