Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-17 Thread Roman Gushchin
On Mon, Apr 16, 2018 at 01:41:44PM +0200, Michal Hocko wrote: > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > > On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > > > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > > > We would need kmalloc-reclaimable-X variants. It could

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-17 Thread Roman Gushchin
On Mon, Apr 16, 2018 at 01:41:44PM +0200, Michal Hocko wrote: > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > > On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > > > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > > > We would need kmalloc-reclaimable-X variants. It could

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-17 Thread Michal Hocko
[the head of the thread is http://lkml.kernel.org/r/08524819-14ef-81d0-fa90-d7af13c6b...@suse.cz] On Mon 16-04-18 21:57:50, Vlastimil Babka wrote: > On 04/16/2018 02:27 PM, Michal Hocko wrote: > > On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: > >> > >> For example the percpu (and other) array

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-17 Thread Michal Hocko
[the head of the thread is http://lkml.kernel.org/r/08524819-14ef-81d0-fa90-d7af13c6b...@suse.cz] On Mon 16-04-18 21:57:50, Vlastimil Babka wrote: > On 04/16/2018 02:27 PM, Michal Hocko wrote: > > On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: > >> > >> For example the percpu (and other) array

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Vlastimil Babka
On 04/16/2018 02:27 PM, Michal Hocko wrote: > On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: >> >> For example the percpu (and other) array caches... >> >>> maybe it will turn out that such a large >>> portion of the chache would need to duplicate the state that a >>> completely new cache would

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Vlastimil Babka
On 04/16/2018 02:27 PM, Michal Hocko wrote: > On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: >> >> For example the percpu (and other) array caches... >> >>> maybe it will turn out that such a large >>> portion of the chache would need to duplicate the state that a >>> completely new cache would

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Matthew Wilcox
On Mon, Apr 16, 2018 at 02:06:21PM +0200, Vlastimil Babka wrote: > On 04/16/2018 01:41 PM, Michal Hocko wrote: > > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > We

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Matthew Wilcox
On Mon, Apr 16, 2018 at 02:06:21PM +0200, Vlastimil Babka wrote: > On 04/16/2018 01:41 PM, Michal Hocko wrote: > > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > We

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Michal Hocko
On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: > On 04/16/2018 01:41 PM, Michal Hocko wrote: > > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > We would need

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Michal Hocko
On Mon 16-04-18 14:06:21, Vlastimil Babka wrote: > On 04/16/2018 01:41 PM, Michal Hocko wrote: > > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > We would need

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Vlastimil Babka
On 04/16/2018 01:41 PM, Michal Hocko wrote: > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: We would need kmalloc-reclaimable-X variants. It could be worth it,

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Vlastimil Babka
On 04/16/2018 01:41 PM, Michal Hocko wrote: > On Fri 13-04-18 10:37:16, Johannes Weiner wrote: >> On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: >>> On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: We would need kmalloc-reclaimable-X variants. It could be worth it,

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Michal Hocko
On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > > We would need kmalloc-reclaimable-X variants. It could be worth it, > > > especially if we find more similar usages. I suspect

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-16 Thread Michal Hocko
On Fri 13-04-18 10:37:16, Johannes Weiner wrote: > On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > > We would need kmalloc-reclaimable-X variants. It could be worth it, > > > especially if we find more similar usages. I suspect

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Johannes Weiner
On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > We would need kmalloc-reclaimable-X variants. It could be worth it, > > especially if we find more similar usages. I suspect they would be more > > useful than the existing

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Johannes Weiner
On Fri, Apr 13, 2018 at 04:28:21PM +0200, Michal Hocko wrote: > On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > > We would need kmalloc-reclaimable-X variants. It could be worth it, > > especially if we find more similar usages. I suspect they would be more > > useful than the existing

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Michal Hocko
On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > On 04/13/2018 03:59 PM, Michal Hocko wrote: > > On Fri 13-04-18 22:35:19, Minchan Kim wrote: > >> On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > > [...] > >>> @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Michal Hocko
On Fri 13-04-18 16:20:00, Vlastimil Babka wrote: > On 04/13/2018 03:59 PM, Michal Hocko wrote: > > On Fri 13-04-18 22:35:19, Minchan Kim wrote: > >> On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > > [...] > >>> @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Vlastimil Babka
On 04/13/2018 03:59 PM, Michal Hocko wrote: > On Fri 13-04-18 22:35:19, Minchan Kim wrote: >> On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > [...] >>> @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, >>> const struct qstr *name) >>> name =

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Vlastimil Babka
On 04/13/2018 03:59 PM, Michal Hocko wrote: > On Fri 13-04-18 22:35:19, Minchan Kim wrote: >> On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > [...] >>> @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, >>> const struct qstr *name) >>> name =

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Michal Hocko
On Fri 13-04-18 22:35:19, Minchan Kim wrote: > On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: [...] > > @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, > > const struct qstr *name) > > name = _name; > > dname = dentry->d_iname; > >

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Michal Hocko
On Fri 13-04-18 22:35:19, Minchan Kim wrote: > On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: [...] > > @@ -1614,9 +1623,11 @@ struct dentry *__d_alloc(struct super_block *sb, > > const struct qstr *name) > > name = _name; > > dname = dentry->d_iname; > >

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Minchan Kim
On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > I was reported about suspicious growth of unreclaimable slabs > on some machines. I've found that it happens on machines > with low memory pressure, and these unreclaimable slabs > are external names attached to dentries. > >

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-13 Thread Minchan Kim
On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > I was reported about suspicious growth of unreclaimable slabs > on some machines. I've found that it happens on machines > with low memory pressure, and these unreclaimable slabs > are external names attached to dentries. > >

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-06 Thread Roman Gushchin
On Thu, Apr 05, 2018 at 03:11:23PM -0700, Andrew Morton wrote: > On Tue, 13 Mar 2018 00:45:32 + Al Viro wrote: > > > On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > > > > > Ah, I see... > > > > > > I think, it's better to account them when we're

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-06 Thread Roman Gushchin
On Thu, Apr 05, 2018 at 03:11:23PM -0700, Andrew Morton wrote: > On Tue, 13 Mar 2018 00:45:32 + Al Viro wrote: > > > On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > > > > > Ah, I see... > > > > > > I think, it's better to account them when we're actually freeing, > > >

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-05 Thread Andrew Morton
On Tue, 13 Mar 2018 00:45:32 + Al Viro wrote: > On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > > > Ah, I see... > > > > I think, it's better to account them when we're actually freeing, > > otherwise we will have strange path: > > (indirectly)

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-04-05 Thread Andrew Morton
On Tue, 13 Mar 2018 00:45:32 + Al Viro wrote: > On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > > > Ah, I see... > > > > I think, it's better to account them when we're actually freeing, > > otherwise we will have strange path: > > (indirectly) reclaimable ->

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Al Viro
On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > Ah, I see... > > I think, it's better to account them when we're actually freeing, > otherwise we will have strange path: > (indirectly) reclaimable -> unreclaimable -> free > > Do you agree? > +static void

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Al Viro
On Mon, Mar 12, 2018 at 10:36:38PM +, Roman Gushchin wrote: > Ah, I see... > > I think, it's better to account them when we're actually freeing, > otherwise we will have strange path: > (indirectly) reclaimable -> unreclaimable -> free > > Do you agree? > +static void

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Roman Gushchin
On Mon, Mar 12, 2018 at 09:17:42PM +, Al Viro wrote: > On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > > diff --git a/fs/dcache.c b/fs/dcache.c > > index 5c7df1df81ff..a0312d73f575 100644 > > --- a/fs/dcache.c > > +++ b/fs/dcache.c > > @@ -273,8 +273,16 @@ static void

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Roman Gushchin
On Mon, Mar 12, 2018 at 09:17:42PM +, Al Viro wrote: > On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > > diff --git a/fs/dcache.c b/fs/dcache.c > > index 5c7df1df81ff..a0312d73f575 100644 > > --- a/fs/dcache.c > > +++ b/fs/dcache.c > > @@ -273,8 +273,16 @@ static void

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Al Viro
On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > diff --git a/fs/dcache.c b/fs/dcache.c > index 5c7df1df81ff..a0312d73f575 100644 > --- a/fs/dcache.c > +++ b/fs/dcache.c > @@ -273,8 +273,16 @@ static void __d_free(struct rcu_head *head) > static void __d_free_external(struct

Re: [PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-12 Thread Al Viro
On Mon, Mar 05, 2018 at 01:37:43PM +, Roman Gushchin wrote: > diff --git a/fs/dcache.c b/fs/dcache.c > index 5c7df1df81ff..a0312d73f575 100644 > --- a/fs/dcache.c > +++ b/fs/dcache.c > @@ -273,8 +273,16 @@ static void __d_free(struct rcu_head *head) > static void __d_free_external(struct

[PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-05 Thread Roman Gushchin
I was reported about suspicious growth of unreclaimable slabs on some machines. I've found that it happens on machines with low memory pressure, and these unreclaimable slabs are external names attached to dentries. External names are allocated using generic kmalloc() function, so they are

[PATCH 3/3] dcache: account external names as indirectly reclaimable memory

2018-03-05 Thread Roman Gushchin
I was reported about suspicious growth of unreclaimable slabs on some machines. I've found that it happens on machines with low memory pressure, and these unreclaimable slabs are external names attached to dentries. External names are allocated using generic kmalloc() function, so they are