From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roman Gushchin Subject: Re: [PATCH] mm: memcontrol: do not miss MEMCG_MAX events for enforced allocations Date: Sun, 3 Jul 2022 15:50:59 -0700 Message-ID: References: <20220702033521.64630-1-roman.gushchin@linux.dev> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1656888664; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=x1aMEnERkcYXRuDziS0Zc8C87mC49RuzSVJcPFqy0W4=; b=NdeXq3Q0aH+DxBKSCS1GbadzG/ojBzsDFkJu1dEehs/A4VIcHKeDcfyrAAnIt+xW787Q2Y llJrgKxTG0lCaWhR1V20IxPimKLEoF19Q8mA27pxNl262HKIDQydxfIJM2PNiE+uDGrGfC m9H4YfvK0CIGGgqwrCL8m/lvsv4A7zw= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Shakeel Butt Cc: Andrew Morton , Yafang Shao , Johannes Weiner , Michal Hocko , Muchun Song , Cgroups , Linux MM , bpf On Sat, Jul 02, 2022 at 10:36:28PM -0700, Shakeel Butt wrote: > On Sat, Jul 2, 2022 at 8:39 AM Roman Gushchin wrote: > > > > On Fri, Jul 01, 2022 at 10:50:40PM -0700, Shakeel Butt wrote: > > > On Fri, Jul 1, 2022 at 8:35 PM Roman Gushchin 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." > > > > SGTM and you can add: > > Acked-by: Shakeel Butt Thank you!