From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF170C43334 for ; Sun, 3 Jul 2022 22:51:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0B8A36B0072; Sun, 3 Jul 2022 18:51:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 040EC6B0073; Sun, 3 Jul 2022 18:51:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E23EA8E0001; Sun, 3 Jul 2022 18:51:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D03E16B0072 for ; Sun, 3 Jul 2022 18:51:07 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 9D5732056F for ; Sun, 3 Jul 2022 22:51:07 +0000 (UTC) X-FDA: 79647285774.09.26FD98B Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf11.hostedemail.com (Postfix) with ESMTP id E1A0340035 for ; Sun, 3 Jul 2022 22:51:06 +0000 (UTC) Date: Sun, 3 Jul 2022 15:50:59 -0700 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= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Shakeel Butt Cc: Andrew Morton , Yafang Shao , Johannes Weiner , Michal Hocko , Muchun Song , Cgroups , Linux MM , bpf Subject: Re: [PATCH] mm: memcontrol: do not miss MEMCG_MAX events for enforced allocations Message-ID: References: <20220702033521.64630-1-roman.gushchin@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656888667; a=rsa-sha256; cv=none; b=OmIuvhioRPfMQ6oO/ZuCK+vkyfftkQcSi4t2A5Pb2VHn2av+DT10VxIx2Fl1GbsIYlP8nM 3Ehzhx//hmkVjV2FpEMDhohJ24hTry42Sd7WG1SsznDZmxzwJ6kbU6jHo3Jbg09iMUoN44 YSlO1OkgNzm3+gtcskULnLW2VUXYU1w= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NdeXq3Q0; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf11.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656888667; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=x1aMEnERkcYXRuDziS0Zc8C87mC49RuzSVJcPFqy0W4=; b=7S7tTPsQN7xHDRtlepQ63ir6KaIOFC174aR4xCWIr2KwIiHrA4vRlmQDclxMo7v23lTcq6 zNW2+AoRppJb2owS66b/AgslYjUBEf2ljumfH4LeSvN5uVafFaBDJdT1/6QqqiSWhL+MkH OJkifij3AM1giRvahOgM2qj0linLSGQ= X-Stat-Signature: h38m7rnjmtggcafe3cxfgirsepp3dodz X-Rspamd-Queue-Id: E1A0340035 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NdeXq3Q0; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf11.hostedemail.com: domain of roman.gushchin@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1656888666-356257 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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!