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 D6975C6FA83 for ; Thu, 8 Sep 2022 02:44:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 62BF96B0072; Wed, 7 Sep 2022 22:44:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5DC216B0073; Wed, 7 Sep 2022 22:44:57 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4A4926B0074; Wed, 7 Sep 2022 22:44:57 -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 39D8B6B0072 for ; Wed, 7 Sep 2022 22:44:57 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 0D3A91202FE for ; Thu, 8 Sep 2022 02:44:57 +0000 (UTC) X-FDA: 79887375834.04.AB3B7AA Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by imf08.hostedemail.com (Postfix) with ESMTP id AB076160084 for ; Thu, 8 Sep 2022 02:44:56 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id by6so18230117ljb.11 for ; Wed, 07 Sep 2022 19:44:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=2pHEsap3RFdinHeELihIMRhGO2rHiXvCucqCEo2lx64=; b=HerJ8zNIlx4KHJmo5rkripn6dc0/uLP0bHlCb3Ir6cVFH2m4xHRDlcFANr9WVi00R9 6sJRUd0ROsz/B/WSxkeZRjGIOA0+IWKXv0AaopO3oXVpMylWb92xH5Zi/ylwhUAX2aU1 +QWG4XSp3f4CMhHjeK7NTMO2hhUPkkgJRlED8qh40XzSnOQBzhSZyU2Rivt4Djs/bDdV snK5PCrW2MLxj4H4ARaumC9esLTEeZoAF4eMMgVENnqOaXNULsFmjrUJN+P3BuUyWJzr OuXKoUOpXIAZjZqhSlAnD0YZDCO3M7rz2i7xybd/WXS3EceSfNGZzLZ3Ako9A4AFYU7U Vlvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=2pHEsap3RFdinHeELihIMRhGO2rHiXvCucqCEo2lx64=; b=RWXFl4zq0KuODNL/DjGN6tgkwatzaOkDAgSepS0HuPIuLV2oCSWQovznphEm0zA8FR dMFLbIYGpgGyUs4TFYlLAgR4J8WykfjU3t752nBTPl1WHj5YWSHcVDbW4lFTRfLW2hWh cZrbYRYrmOKghl3FtwKGROevy3Ln+UotOjpB6BbtWJ1xYelnk5HjENogtfd8ts35XKO0 QI4ijfaCnB+OcMUOSnk2AxsQhX1RYjmc1PDydHsPuHjk7IDFtQzOrdTCGFxiJVAEfZZi rel78FQFhsUYuAkUJHy+CIJPKyO6DGLR3MDi62xVyw2Q4gqmO8SLJ2vT7U0wcBTVZrMC wojQ== X-Gm-Message-State: ACgBeo1TjmuwfmqVYZzMl1lvx1tH1jbGA8agwz8LBhilxtK441mLOPVG A7PUpvcrYcpYxJKSWBJiHIH3igGPORLVHURx1bY= X-Google-Smtp-Source: AA6agR73GsfTr+BVMr92nDb6WrcflbCFjXbxmVQTeONe5M+FnMlrdJlCBIlDqK/OBASRxJHykPZY3DdxLL4K2o9GjY4= X-Received: by 2002:a2e:9681:0:b0:261:c515:2b13 with SMTP id q1-20020a2e9681000000b00261c5152b13mr1837959lji.210.1662605095177; Wed, 07 Sep 2022 19:44:55 -0700 (PDT) MIME-Version: 1.0 References: <20220902023003.47124-1-laoar.shao@gmail.com> In-Reply-To: From: Yafang Shao Date: Thu, 8 Sep 2022 10:44:18 +0800 Message-ID: Subject: Re: [PATCH bpf-next v3 00/13] bpf: Introduce selectable memcg for bpf map To: Tejun Heo Cc: Alexei Starovoitov , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Johannes Weiner , Michal Hocko , Roman Gushchin , Shakeel Butt , Muchun Song , Andrew Morton , Zefan Li , "open list:CONTROL GROUP (CGROUP)" , Network Development , bpf , linux-mm Content-Type: text/plain; charset="UTF-8" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662605096; 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=2pHEsap3RFdinHeELihIMRhGO2rHiXvCucqCEo2lx64=; b=SGQawLYQfux+tanxXrrUGLSA7uT+ii5oMnXP85SqXTK6BpN9iCzj9blMcpcVvws3qr5iBc lhUHHqLu/lM2HQ/Td22OYbPQMQySfAJZ4yY7oPvOpeHm203K7KkfmzyxJ6bpcKfeVt+H/i O2Hn21hY1qtohAZ5xxXmFDJMLuq2dpU= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HerJ8zNI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.208.178 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662605096; a=rsa-sha256; cv=none; b=MYg+EorxyQple3IaS0f2M6GKCFOIhsLBdgix0CpTXkntpiVAOrWhI2oFoRAEbeuwGp9QpQ 7x0nAkNMem26aO/ykHkd59dHRhqb7GIZgTeit9m+T2HK1FrilDkrLstxKscISKoGEl4kUn cF+oczipTpXo00AWXUkRYYQ0k7afBuI= X-Stat-Signature: sn94gwy9tdkrhzrbizubt9zgroybffyw X-Rspamd-Queue-Id: AB076160084 Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HerJ8zNI; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf08.hostedemail.com: domain of laoar.shao@gmail.com designates 209.85.208.178 as permitted sender) smtp.mailfrom=laoar.shao@gmail.com X-Rspam-User: X-Rspamd-Server: rspam02 X-HE-Tag: 1662605096-335747 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 Thu, Sep 8, 2022 at 1:01 AM Tejun Heo wrote: > > On Wed, Sep 07, 2022 at 09:27:09AM -0700, Alexei Starovoitov wrote: > > On Wed, Sep 7, 2022 at 9:18 AM Tejun Heo wrote: > > > > > > Hello, > > > > > > On Wed, Sep 07, 2022 at 09:13:09AM -0700, Alexei Starovoitov wrote: > > > > Hmm. We discussed this option already. We definitely don't want > > > > to introduce an uapi knob that will allow anyone to skip memcg > > > > accounting today and in the future. > > > > > > cgroup.memory boot parameter is how memcg provides last-resort workarounds > > > for this sort of problems / regressions while they're being addressed. It's > > > not a dynamically changeable or programmable thing. Just a boot time > > > opt-out. That said, if you don't want it, you don't want it. > > > > ahh. boot param. > > Are you suggesting a global off switch ? Like nosocket and nokmem. > > That would be a different story. > > Need to think more about it. It could be ok. > > Yeah, nobpf or sth like that. An equivalent cgroup.memory parameter. > It may be a useful feature for some cases, but it can't help container users. The memcg works well to limit the non-pinned bpf-map, that's the reason why we, a container user, switch to memcg-based bpf charging. Our goal is to make it also work for pinned bpf-map. That said, your proposal may be a useful feature, but it should be another different patchset. -- Regards Yafang