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 2179BC38145 for ; Wed, 7 Sep 2022 22:29:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 94BA36B0072; Wed, 7 Sep 2022 18:29:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 922978D0002; Wed, 7 Sep 2022 18:29:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 810B88D0001; Wed, 7 Sep 2022 18:29:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 6E13C6B0072 for ; Wed, 7 Sep 2022 18:29:16 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4A04D12081B for ; Wed, 7 Sep 2022 22:29:16 +0000 (UTC) X-FDA: 79886731512.22.80F5557 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by imf14.hostedemail.com (Postfix) with ESMTP id BC3B8100064 for ; Wed, 7 Sep 2022 22:29:15 +0000 (UTC) Date: Wed, 7 Sep 2022 15:28:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1662589753; 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=I1yxj38W9LLCjnCLzWIfLwcTDKqLav/lxTozk1c1g/I=; b=cnV9/bLAglNubg1YwGbWHhR5c6MxCQUpK8c/LmjtAgg0I61ifYF43G6tihLY8hrcN7hlHT khUhhtSDN0Xlgt6WlQAC0Xlj76xzCuUMt1VcEnCtvQRk0/rc8BXjMAMggDJ+qRupn5BGOg +CPlIh3epn0VqimtvaJOVDxfjWsnmVU= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Tejun Heo Cc: Yafang Shao , ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, shakeelb@google.com, songmuchun@bytedance.com, akpm@linux-foundation.org, lizefan.x@bytedance.com, cgroups@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH bpf-next v3 00/13] bpf: Introduce selectable memcg for bpf map Message-ID: References: <20220902023003.47124-1-laoar.shao@gmail.com> 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662589756; 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=I1yxj38W9LLCjnCLzWIfLwcTDKqLav/lxTozk1c1g/I=; b=JV/EZWVmZfExwwXGEpDwA0mUN2zOiBFxNxsh+AYdur8pJl58rE0WDo+Z5ClmGcrJOp9j+j A08QSKjivA4XFS4bkRAPa+n6GxvirMbAH+JgMGPlrnd8A2HLfzKTBcvoaDucOTkLAV71FA 7l+nOAKDSYhxlwJD76UYPPD2Z7HQzr4= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="cnV9/bLA"; spf=pass (imf14.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662589756; a=rsa-sha256; cv=none; b=P1n0yq6lfClsbjCg1wZFkWVGG+C7BitjC32CqCI4GizsKxj9FbuKScwM6s3y57v5Xiw5e1 45O4shn8E99bWRxbFIZiuVxeLWoN4u+2jwDRAszCkKN8dN7WlCqujP2yq7c4VGoCwudT5e aUkPy6zqetieQpdJu1bfFuuKvm+Em0c= X-Rspam-User: Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b="cnV9/bLA"; spf=pass (imf14.hostedemail.com: domain of roman.gushchin@linux.dev designates 188.165.223.204 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Rspamd-Queue-Id: BC3B8100064 X-Rspamd-Server: rspam03 X-Stat-Signature: 8sr1co97khb46ae5h5sqgrm48isx7msb X-HE-Tag: 1662589755-704343 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 Wed, Sep 07, 2022 at 05:43:31AM -1000, Tejun Heo wrote: > Hello, > > On Fri, Sep 02, 2022 at 02:29:50AM +0000, Yafang Shao wrote: > ... > > This patchset tries to resolve the above two issues by introducing a > > selectable memcg to limit the bpf memory. Currently we only allow to > > select its ancestor to avoid breaking the memcg hierarchy further. > > Possible use cases of the selectable memcg as follows, > > As discussed in the following thread, there are clear downsides to an > interface which requires the users to specify the cgroups directly. > > https://lkml.kernel.org/r/YwNold0GMOappUxc@slm.duckdns.org > > So, I don't really think this is an interface we wanna go for. I was hoping > to hear more from memcg folks in the above thread. Maybe ping them in that > thread and continue there? As I said previously, I don't like it, because it's an attempt to solve a non bpf-specific problem in a bpf-specific way. Yes, memory cgroups are not great for accounting of shared resources, it's well known. This patchset looks like an attempt to "fix" it specifically for bpf maps in a particular cgroup setup. Honestly, I don't think it's worth the added complexity. Especially because a similar behaviour can be achieved simple by placing the task which creates the map into the desired cgroup. Beatiful? Not. Neither is the proposed solution. Thanks!