Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-08 Thread Tejun Heo
Hello, Michal. On Wed, Aug 07, 2013 at 07:30:51PM +0200, Michal Hocko wrote: > On Wed 07-08-13 16:47:30, Michal Hocko wrote: > > On Wed 07-08-13 15:57:34, Michal Hocko wrote: > > [...] > > > Hmm, OK so you think that the fd limit is sufficient already? > > > > Hmm, that would need to touch the co

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Michal Hocko
On Wed 07-08-13 16:47:30, Michal Hocko wrote: > On Wed 07-08-13 15:57:34, Michal Hocko wrote: > [...] > > Hmm, OK so you think that the fd limit is sufficient already? > > Hmm, that would need to touch the code as well (the register callback > would need to make sure only one event is registered p

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Michal Hocko
On Wed 07-08-13 15:57:34, Michal Hocko wrote: [...] > Hmm, OK so you think that the fd limit is sufficient already? Hmm, that would need to touch the code as well (the register callback would need to make sure only one event is registered per cfile). But yes this way would be better. I will send a

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Tejun Heo
On Wed, Aug 07, 2013 at 03:57:34PM +0200, Michal Hocko wrote: > On Wed 07-08-13 09:47:41, Tejun Heo wrote: > > Hello, > > > > On Wed, Aug 07, 2013 at 03:37:46PM +0200, Michal Hocko wrote: > > > > It isn't different from listening from epoll, for example. > > > > > > epoll limits the number of wat

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Michal Hocko
On Wed 07-08-13 09:47:41, Tejun Heo wrote: > Hello, > > On Wed, Aug 07, 2013 at 03:37:46PM +0200, Michal Hocko wrote: > > > It isn't different from listening from epoll, for example. > > > > epoll limits the number of watchers, no? > > Not that I know of. It'll be limited by max open fds but I

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Tejun Heo
Hello, On Wed, Aug 07, 2013 at 03:37:46PM +0200, Michal Hocko wrote: > > It isn't different from listening from epoll, for example. > > epoll limits the number of watchers, no? Not that I know of. It'll be limited by max open fds but I don't think there are other limits. Why would there be? >

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Michal Hocko
On Wed 07-08-13 09:08:36, Tejun Heo wrote: > Hello, Michal. > > On Wed, Aug 07, 2013 at 01:28:26PM +0200, Michal Hocko wrote: > > There is no limit for the maximum number of oom_control events > > registered per memcg. This might lead to an user triggered memory > > depletion if a regular user is

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Tejun Heo
On Wed, Aug 07, 2013 at 09:08:36AM -0400, Tejun Heo wrote: > Hello, Michal. > > On Wed, Aug 07, 2013 at 01:28:26PM +0200, Michal Hocko wrote: > > There is no limit for the maximum number of oom_control events > > registered per memcg. This might lead to an user triggered memory > > depletion if a

Re: [PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Tejun Heo
Hello, Michal. On Wed, Aug 07, 2013 at 01:28:26PM +0200, Michal Hocko wrote: > There is no limit for the maximum number of oom_control events > registered per memcg. This might lead to an user triggered memory > depletion if a regular user is allowed to register events. > > Let's be more strict a

[PATCH 2/3] memcg: Limit the number of events registered on oom_control

2013-08-07 Thread Michal Hocko
There is no limit for the maximum number of oom_control events registered per memcg. This might lead to an user triggered memory depletion if a regular user is allowed to register events. Let's be more strict and cap the number of events that might be registered. MAX_OOM_NOTIFY_EVENTS value is mor