Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-29 Thread Jan Kara
On Thu 28-06-18 12:21:26, Shakeel Butt wrote: > On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > > A lot of memory can be consumed by the events generated for the huge or > > > unlimited queues if there is either no or slow listener. This

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-29 Thread Jan Kara
On Thu 28-06-18 12:21:26, Shakeel Butt wrote: > On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > > A lot of memory can be consumed by the events generated for the huge or > > > unlimited queues if there is either no or slow listener. This

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-29 Thread Michal Hocko
On Thu 28-06-18 12:21:26, Shakeel Butt wrote: > On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > > A lot of memory can be consumed by the events generated for the huge or > > > unlimited queues if there is either no or slow listener. This

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-29 Thread Michal Hocko
On Thu 28-06-18 12:21:26, Shakeel Butt wrote: > On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > > A lot of memory can be consumed by the events generated for the huge or > > > unlimited queues if there is either no or slow listener. This

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-28 Thread Shakeel Butt
On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > A lot of memory can be consumed by the events generated for the huge or > > unlimited queues if there is either no or slow listener. This can cause > > system level memory pressure or OOMs.

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-28 Thread Shakeel Butt
On Thu, Jun 28, 2018 at 12:03 PM Jan Kara wrote: > > On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > > A lot of memory can be consumed by the events generated for the huge or > > unlimited queues if there is either no or slow listener. This can cause > > system level memory pressure or OOMs.

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-28 Thread Jan Kara
On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > A lot of memory can be consumed by the events generated for the huge or > unlimited queues if there is either no or slow listener. This can cause > system level memory pressure or OOMs. So, it's better to account the > fsnotify kmem caches to the

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-28 Thread Jan Kara
On Wed 27-06-18 12:12:49, Shakeel Butt wrote: > A lot of memory can be consumed by the events generated for the huge or > unlimited queues if there is either no or slow listener. This can cause > system level memory pressure or OOMs. So, it's better to account the > fsnotify kmem caches to the

[PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-27 Thread Shakeel Butt
A lot of memory can be consumed by the events generated for the huge or unlimited queues if there is either no or slow listener. This can cause system level memory pressure or OOMs. So, it's better to account the fsnotify kmem caches to the memcg of the listener. However the listener can be in

[PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-27 Thread Shakeel Butt
A lot of memory can be consumed by the events generated for the huge or unlimited queues if there is either no or slow listener. This can cause system level memory pressure or OOMs. So, it's better to account the fsnotify kmem caches to the memcg of the listener. However the listener can be in

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-27 Thread Jan Kara
On Tue 26-06-18 12:07:57, Shakeel Butt wrote: > On Tue, Jun 26, 2018 at 11:55 AM Johannes Weiner wrote: > > > > On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > > > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein > > > wrote: > > > > > > > ... > > > > > > > > The verb 'unuse'

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-27 Thread Jan Kara
On Tue 26-06-18 12:07:57, Shakeel Butt wrote: > On Tue, Jun 26, 2018 at 11:55 AM Johannes Weiner wrote: > > > > On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > > > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein > > > wrote: > > > > > > > ... > > > > > > > > The verb 'unuse'

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Amir Goldstein
On Tue, Jun 26, 2018 at 11:05 PM, Shakeel Butt wrote: > On Tue, Jun 26, 2018 at 12:03 PM Johannes Weiner wrote: >> >> On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: >> > @@ -140,8 +141,9 @@ struct fanotify_event_info >> > *fanotify_alloc_event(struct fsnotify_group *group, >> >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Amir Goldstein
On Tue, Jun 26, 2018 at 11:05 PM, Shakeel Butt wrote: > On Tue, Jun 26, 2018 at 12:03 PM Johannes Weiner wrote: >> >> On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: >> > @@ -140,8 +141,9 @@ struct fanotify_event_info >> > *fanotify_alloc_event(struct fsnotify_group *group, >> >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Tue, Jun 26, 2018 at 12:03 PM Johannes Weiner wrote: > > On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: > > @@ -140,8 +141,9 @@ struct fanotify_event_info *fanotify_alloc_event(struct > > fsnotify_group *group, > >struct inode

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Tue, Jun 26, 2018 at 12:03 PM Johannes Weiner wrote: > > On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: > > @@ -140,8 +141,9 @@ struct fanotify_event_info *fanotify_alloc_event(struct > > fsnotify_group *group, > >struct inode

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Tue, Jun 26, 2018 at 11:55 AM Johannes Weiner wrote: > > On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > > > > > ... > > > > > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > > > You can use

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Tue, Jun 26, 2018 at 11:55 AM Johannes Weiner wrote: > > On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > > > > > ... > > > > > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > > > You can use

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Johannes Weiner
On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: > @@ -140,8 +141,9 @@ struct fanotify_event_info *fanotify_alloc_event(struct > fsnotify_group *group, >struct inode *inode, u32 mask, >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Johannes Weiner
On Mon, Jun 25, 2018 at 04:06:58PM -0700, Shakeel Butt wrote: > @@ -140,8 +141,9 @@ struct fanotify_event_info *fanotify_alloc_event(struct > fsnotify_group *group, >struct inode *inode, u32 mask, >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Johannes Weiner
On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > > > ... > > > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > > You can use 'override'/'revert' verbs like override_creds or just call > >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Johannes Weiner
On Tue, Jun 26, 2018 at 11:00:53AM -0700, Shakeel Butt wrote: > On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > > > ... > > > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > > You can use 'override'/'revert' verbs like override_creds or just call > >

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > ... > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > You can use 'override'/'revert' verbs like override_creds or just call > memalloc_use_memcg(old_memcg) since there is no reference taken > anyway in use_memcg and

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-26 Thread Shakeel Butt
On Mon, Jun 25, 2018 at 10:49 PM Amir Goldstein wrote: > ... > > The verb 'unuse' takes an argument memcg and 'uses' it - too weird. > You can use 'override'/'revert' verbs like override_creds or just call > memalloc_use_memcg(old_memcg) since there is no reference taken > anyway in use_memcg and

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-25 Thread Amir Goldstein
On Tue, Jun 26, 2018 at 2:06 AM, Shakeel Butt wrote: > A lot of memory can be consumed by the events generated for the huge or > unlimited queues if there is either no or slow listener. This can cause > system level memory pressure or OOMs. So, it's better to account the > fsnotify kmem caches

Re: [PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-25 Thread Amir Goldstein
On Tue, Jun 26, 2018 at 2:06 AM, Shakeel Butt wrote: > A lot of memory can be consumed by the events generated for the huge or > unlimited queues if there is either no or slow listener. This can cause > system level memory pressure or OOMs. So, it's better to account the > fsnotify kmem caches

[PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-25 Thread Shakeel Butt
A lot of memory can be consumed by the events generated for the huge or unlimited queues if there is either no or slow listener. This can cause system level memory pressure or OOMs. So, it's better to account the fsnotify kmem caches to the memcg of the listener. However the listener can be in

[PATCH 1/2] fs: fsnotify: account fsnotify metadata to kmemcg

2018-06-25 Thread Shakeel Butt
A lot of memory can be consumed by the events generated for the huge or unlimited queues if there is either no or slow listener. This can cause system level memory pressure or OOMs. So, it's better to account the fsnotify kmem caches to the memcg of the listener. However the listener can be in