cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
To: Shakeel Butt <shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Yafang Shao <laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
	Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@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: Sat, 2 Jul 2022 08:39:14 -0700	[thread overview]
Message-ID: <YsBmoqEBCa7ra7w2@castle> (raw)
In-Reply-To: <CALvZod7TGhWtcRD6HeEx90T2+Rod-yamq9i+WbEQUKwNFTi-1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Fri, Jul 01, 2022 at 10:50:40PM -0700, Shakeel Butt wrote:
> On Fri, Jul 1, 2022 at 8:35 PM Roman Gushchin <roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org> wrote:
> >
> > Yafang Shao reported an issue related to the accounting of bpf
> > memory: if a bpf map is charged indirectly for memory consumed
> > from an interrupt context and allocations are enforced, MEMCG_MAX
> > events are not raised.
> >
> > It's not/less of an issue in a generic case because consequent
> > allocations from a process context will trigger the reclaim and
> > MEMCG_MAX events. However a bpf map can belong to a dying/abandoned
> > memory cgroup, so it might never happen.
> 
> The patch looks good but the above sentence is confusing. What might
> never happen? Reclaim or MAX event on dying memcg?

Direct reclaim and MAX events. I agree it might be not clear without
looking into the code. How about something like this?

"It's not/less of an issue in a generic case because consequent
allocations from a process context will trigger the direct reclaim
and MEMCG_MAX events will be raised. However a bpf map can belong
to a dying/abandoned memory cgroup, so there will be no allocations
from a process context and no MEMCG_MAX events will be triggered."

Thanks!

  parent reply	other threads:[~2022-07-02 15:39 UTC|newest]

Thread overview: 22+ 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
     [not found] ` <20220702033521.64630-1-roman.gushchin-fxUVXftIFDnyG1zEObXtfA@public.gmane.org>
2022-07-02  5:50   ` Shakeel Butt
     [not found]     ` <CALvZod7TGhWtcRD6HeEx90T2+Rod-yamq9i+WbEQUKwNFTi-1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-02 15:39       ` Roman Gushchin [this message]
2022-07-03  5:36         ` Shakeel Butt
     [not found]           ` <CALvZod6zCHKyjd8Ewr02xcHRWrxR_82my6mmTgsRp3HceqsBcg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-03 22:50             ` Roman Gushchin
2022-07-04 15:07         ` Michal Hocko
     [not found]           ` <YsMCMveSdiYX/2eH-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-07-04 15:30             ` Michal Hocko
     [not found]               ` <YsMHkXJ0vAPG0lyM-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org>
2022-07-05 20:51                 ` Roman Gushchin
2022-07-06  2:40                   ` Yafang Shao
     [not found]                     ` <CALOAHbBrctf_wOiAxUvXD0JSjgEV46YdDQh9QnUK0XZ+Jsapnw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
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
     [not found]                   ` <CALOAHbDjRzySCHeMVHtVDe=Ji+qh=n0pT4CwiAM5Pahi2-QNCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-06  3:56                     ` Roman Gushchin
2022-07-06  4:02                       ` Yafang Shao
     [not found]                         ` <CALOAHbA+C2nM4qSj2yPfbdzbqZ-UdCpg5QP0+f5HbEtpi0ZZGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-06  4:19                           ` Roman Gushchin
2022-07-06  4:33                             ` Yafang Shao
2022-07-07 22:41                       ` Alexei Starovoitov
     [not found]                         ` <CAADnVQ+qqeAVvtDYox4xj85Qxt79EV1Hn+HDEMuzHrwZv14X4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2022-07-08  3:18                           ` Roman Gushchin
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=YsBmoqEBCa7ra7w2@castle \
    --to=roman.gushchin-fxuvxftifdnyg1zeobxtfa@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=bpf-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
    --cc=laoar.shao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
    --cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=shakeelb-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
    --cc=songmuchun-EC8Uxl6Npydl57MIdRCFDg@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).