From: Roman Gushchin <roman.gushchin@linux.dev>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Yafang Shao <laoar.shao@gmail.com>,
Michal Hocko <mhocko@suse.com>,
Shakeel Butt <shakeelb@google.com>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Muchun Song <songmuchun@bytedance.com>,
Cgroups <cgroups@vger.kernel.org>, Linux MM <linux-mm@kvack.org>,
bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH] mm: memcontrol: do not miss MEMCG_MAX events for enforced allocations
Date: Thu, 7 Jul 2022 20:18:52 -0700 [thread overview]
Message-ID: <YseiHOgqLapJPiyC@castle> (raw)
In-Reply-To: <CAADnVQ+qqeAVvtDYox4xj85Qxt79EV1Hn+HDEMuzHrwZv14X4Q@mail.gmail.com>
On Thu, Jul 07, 2022 at 03:41:11PM -0700, Alexei Starovoitov wrote:
> On Tue, Jul 5, 2022 at 9:24 PM Roman Gushchin <roman.gushchin@linux.dev> wrote:
> >
> > Anyway, here is the patch for reparenting bpf maps:
> > https://github.com/rgushchin/linux/commit/f57df8bb35770507a4624fe52216b6c14f39c50c
> >
> > I gonna post it to bpf@ after some testing.
>
> Please do. It looks good.
> It needs #ifdef CONFIG_MEMCG_KMEM
> because get_obj_cgroup_from_current() is undefined otherwise.
> Ideally just adding a static inline to a .h ?
Actually all call sites are already under CONFIG_MEMCG_KMEM.
>
> and
> if (map->objcg)
> memcg = get_mem_cgroup_from_objcg(map->objcg);
>
> or !NULL check inside get_mem_cgroup_from_objcg()
> which would be better.
Yes, you're right, as now we need to handle it specially.
In the near future it won't be necessary. There are patches in
mm-unstable which make objcg API useful outside of CONFIG_MEMCG_KMEM.
In particular it means that objcg will be created for the root_mem_cgroup.
So map->objcg can always point at a valid objcg and we will be able
to drop this check.
Will post an updated version shortly.
Thanks!
WARNING: multiple messages have this Message-ID (diff)
From: Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
To: Alexei Starovoitov
<alexei.starovoitov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Yafang Shao <laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Michal Hocko <mhocko-IBi9RG/b67k@public.gmane.org>,
Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Muchun Song <songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org>,
Cgroups <cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Linux MM <linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org>,
bpf <bpf-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] mm: memcontrol: do not miss MEMCG_MAX events for enforced allocations
Date: Thu, 7 Jul 2022 20:18:52 -0700 [thread overview]
Message-ID: <YseiHOgqLapJPiyC@castle> (raw)
In-Reply-To: <CAADnVQ+qqeAVvtDYox4xj85Qxt79EV1Hn+HDEMuzHrwZv14X4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Thu, Jul 07, 2022 at 03:41:11PM -0700, Alexei Starovoitov wrote:
> On Tue, Jul 5, 2022 at 9:24 PM Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org> wrote:
> >
> > Anyway, here is the patch for reparenting bpf maps:
> > https://github.com/rgushchin/linux/commit/f57df8bb35770507a4624fe52216b6c14f39c50c
> >
> > I gonna post it to bpf@ after some testing.
>
> Please do. It looks good.
> It needs #ifdef CONFIG_MEMCG_KMEM
> because get_obj_cgroup_from_current() is undefined otherwise.
> Ideally just adding a static inline to a .h ?
Actually all call sites are already under CONFIG_MEMCG_KMEM.
>
> and
> if (map->objcg)
> memcg = get_mem_cgroup_from_objcg(map->objcg);
>
> or !NULL check inside get_mem_cgroup_from_objcg()
> which would be better.
Yes, you're right, as now we need to handle it specially.
In the near future it won't be necessary. There are patches in
mm-unstable which make objcg API useful outside of CONFIG_MEMCG_KMEM.
In particular it means that objcg will be created for the root_mem_cgroup.
So map->objcg can always point at a valid objcg and we will be able
to drop this check.
Will post an updated version shortly.
Thanks!
next prev parent reply other threads:[~2022-07-08 3:19 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-02 3:35 [PATCH] mm: memcontrol: do not miss MEMCG_MAX events for enforced allocations Roman Gushchin
2022-07-02 5:50 ` Shakeel Butt
2022-07-02 5:50 ` Shakeel Butt
2022-07-02 15:39 ` Roman Gushchin
2022-07-02 15:39 ` Roman Gushchin
2022-07-03 5:36 ` Shakeel Butt
2022-07-03 5:36 ` Shakeel Butt
2022-07-03 22:50 ` Roman Gushchin
2022-07-03 22:50 ` Roman Gushchin
2022-07-04 15:07 ` Michal Hocko
2022-07-04 15:30 ` Michal Hocko
2022-07-04 15:30 ` Michal Hocko
2022-07-05 20:51 ` Roman Gushchin
2022-07-05 20:51 ` Roman Gushchin
2022-07-06 2:40 ` Yafang Shao
2022-07-06 2:40 ` Yafang Shao
2022-07-07 7:47 ` Michal Hocko
2022-07-07 7:47 ` Michal Hocko
2022-07-05 20:49 ` Roman Gushchin
2022-07-06 2:46 ` Yafang Shao
2022-07-06 3:28 ` Roman Gushchin
2022-07-06 3:42 ` Yafang Shao
2022-07-06 3:42 ` Yafang Shao
2022-07-06 3:56 ` Roman Gushchin
2022-07-06 3:56 ` Roman Gushchin
2022-07-06 4:02 ` Yafang Shao
2022-07-06 4:02 ` Yafang Shao
2022-07-06 4:19 ` Roman Gushchin
2022-07-06 4:19 ` Roman Gushchin
2022-07-06 4:33 ` Yafang Shao
2022-07-06 4:33 ` Yafang Shao
2022-07-07 22:41 ` Alexei Starovoitov
2022-07-08 3:18 ` Roman Gushchin [this message]
2022-07-08 3:18 ` Roman Gushchin
2022-07-04 15:12 ` Michal Hocko
2022-07-04 15:12 ` Michal Hocko
2022-07-05 20:55 ` Roman Gushchin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YseiHOgqLapJPiyC@castle \
--to=roman.gushchin@linux.dev \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=hannes@cmpxchg.org \
--cc=laoar.shao@gmail.com \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=shakeelb@google.com \
--cc=songmuchun@bytedance.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.