[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1802211029080.13404@nuc-kabylake>
Date: Wed, 21 Feb 2018 10:35:51 -0600 (CST)
From: Christopher Lameter <cl@...ux.com>
To: Shakeel Butt <shakeelb@...gle.com>
cc: Jan Kara <jack@...e.cz>, Amir Goldstein <amir73il@...il.com>,
Pekka Enberg <penberg@...nel.org>,
David Rientjes <rientjes@...gle.com>,
Joonsoo Kim <iamjoonsoo.kim@....com>,
Andrew Morton <akpm@...ux-foundation.org>,
Greg Thelen <gthelen@...gle.com>,
Johannes Weiner <hannes@...xchg.org>,
Michal Hocko <mhocko@...nel.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
Mel Gorman <mgorman@...e.de>, Vlastimil Babka <vbabka@...e.cz>,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/3] fs: fsnotify: account fsnotify metadata to
kmemcg
On Tue, 20 Feb 2018, Shakeel Butt wrote:
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index 6702a6a0bbb5..0d9493ebc7cd 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> if (fanotify_is_perm_event(mask)) {
> struct fanotify_perm_event_info *pevent;
>
> - pevent = kmem_cache_alloc(fanotify_perm_event_cachep,
> - GFP_KERNEL);
> + pevent = kmem_cache_alloc_memcg(fanotify_perm_event_cachep,
> + GFP_KERNEL, memcg);
> if (!pevent)
#1
> index 8b73332735ba..ed8e7b5f3981 100644
> --- a/fs/notify/inotify/inotify_fsnotify.c
> +++ b/fs/notify/inotify/inotify_fsnotify.c
> @@ -98,7 +98,7 @@ int inotify_handle_event(struct fsnotify_group *group,
> i_mark = container_of(inode_mark, struct inotify_inode_mark,
> fsn_mark);
>
> - event = kmalloc(alloc_len, GFP_KERNEL);
> + event = kmalloc_memcg(alloc_len, GFP_KERNEL, group->memcg);
> if (unlikely(!event))
> return -ENOMEM;
#2
So we have all this churn for those two allocations which are basically
the same code for two different notification schemes.
Could you store the task that is requesting the fsnotify action instead of
the memcg? Then do the allocation in the context of that task. That
reduces the modifications to fsnotify.
Powered by blists - more mailing lists