Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3245011lfo; Sun, 22 May 2022 23:43:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLULcjZHSV4pb2W9CJsfwdVYwIe07OoapABeJ6k7aq51oUuQvaT6AzvWFu+onRW49NFJLB X-Received: by 2002:a17:902:d582:b0:161:c681:c326 with SMTP id k2-20020a170902d58200b00161c681c326mr19360496plh.84.1653288200445; Sun, 22 May 2022 23:43:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653288200; cv=none; d=google.com; s=arc-20160816; b=R9p29Hu5qqDbxc4sTPz4FcTTGrbMG0rsQfINSQqauj8Y6EzrE4LWQ0OpeuAnZ9JvGQ nLRGfwc1ZQuUP/BT6ZSxGGDB6I+YRa6gPyEyuTRlrljltc9Pw9DSIgK3gYugVcfbHgFf sWSRm3kaw7IL2RW4jVDOSDxBJR2EkqG4P5VlDck5T9DD7I7l3vUtXWKJPKTpB3o+8Ntr 9KAMHdvNBt9SHNJ/8DfzfuGK7R07foLVd2LFwB9EMIDhJJYcQmhV/tV990UVXyuX0a2v J+SzWQ71HB7k+uuke/pTGVFwyE0YluLIPdmiSzsdg47cVH3B5kBdo3zcDYnt2swqzrHp z1Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:sender:dkim-signature; bh=RCiECH/4G+z+xrwvKHneVVOuojV/v569kz7/GW36BxA=; b=o/oRQarcZ9QxLkA+lJK+uLDIzmge1NsMx4Zd2o5M+LS/px3EUS+UKDASkWXU5GhWe8 DrWmn+hUq5o9SW8NHvMpG5OQK2cLbT1ym8e0mB74nqHUky6oJ2xedypSdE2y1Sq8li1z 3jLAkvdAAgPfQ+7D4B7sRjvN0kZYlihPIZhw8zIjQZEcsDND2of5XBA2lw1RZ0n6oVmP F6NrkAxq/qsX+SBRZ4FgeAI6VM+dW7eXB74Q4RQrQy1KrqIs17M0b5bkxrslzg3fdpIv fczDJFaM7ANz/GyOtEFntMZbdjNcovytWH9wZ9DWhzUF9petpYdBvVIGAKZvahErD4Y9 0D2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y8SCxfyR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id pg18-20020a17090b1e1200b001e00d7ddfa1si11268537pjb.113.2022.05.22.23.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:43:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Y8SCxfyR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A0D8C50052; Sun, 22 May 2022 23:15:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346596AbiETHlf (ORCPT + 99 others); Fri, 20 May 2022 03:41:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235703AbiETHl2 (ORCPT ); Fri, 20 May 2022 03:41:28 -0400 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C643B427D2; Fri, 20 May 2022 00:41:26 -0700 (PDT) Received: by mail-pf1-x42a.google.com with SMTP id w200so7080310pfc.10; Fri, 20 May 2022 00:41:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=RCiECH/4G+z+xrwvKHneVVOuojV/v569kz7/GW36BxA=; b=Y8SCxfyRjKdY8qHJ3D4MDAZ5k3+J3h3mX8JWQ+xBHcE8p3iO9tZ9IBCP5gj32yCPE8 Clg7iXRfHY0fEx7/ycD4AG4FtmgatsPL53gSb+rNQffMPMQq+aeV4Sbw4RVVJmZxhQu5 1Owu29+6Z4Ha2goDPmiWf/TyIsNFhmhYVbYH7RxaWBMA5P/4SIoTBrXueUvhjNT2k8gW qMY/Y2kIMoC31//gOwbZ8QeLasI0I4hDPGUIGRVFoiiH89bdBuFbnhXt6lkosObFJ4yq U0xBnKJpnSaRD0o1i1A5o7yqYLZpXQXDF2twY3a2B97ob6Hz5ulQIqFmU41wGVN+9V3E 0inA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=RCiECH/4G+z+xrwvKHneVVOuojV/v569kz7/GW36BxA=; b=sHYaSfHbJKGB/3TMiWHsMjuf6G+U9D4TPVGfUk9jwrQfx1loIve1o20SnFa7ux4Y8B mqu0J+2KxJWOUO2geTMfcctD29ZzsD6WXIbZ5tjiaPDnE9ANgLNzhamINefQHmxU5wvn kH8OkmnMxdDkqhMRvfLEr32YZSPo3mvs6pGj2ZIw+ZvCX5jKAQ4Q0ne3A8bk2ZfiQPgZ TJp5aUXrDBZx10PdwO9T1c1RUYywy8ykGxezzT2hQfKHZeWKgDlPcmjhwATgH40g59Xb MR9Rgx1DzzhniztqD097Uv/ZvU7EMckhkoj/i8bIooA8h2eMvDBUc28AQ6Ij89NZJ+k6 UyxQ== X-Gm-Message-State: AOAM533e05pqoZ00EFm3rBdWleKiAk0HiFZJ8vY/Y11jgZIu431l6VKu JSbQTbeDalWIWGNxj5pYRFc= X-Received: by 2002:a05:6a00:a94:b0:4fd:c14b:21cb with SMTP id b20-20020a056a000a9400b004fdc14b21cbmr8999494pfl.53.1653032486217; Fri, 20 May 2022 00:41:26 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:1761]) by smtp.gmail.com with ESMTPSA id o10-20020a170902d4ca00b0015e8d4eb228sm5091246plg.114.2022.05.20.00.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 00:41:25 -0700 (PDT) Sender: Tejun Heo Date: Thu, 19 May 2022 21:41:23 -1000 From: Tejun Heo To: Yosry Ahmed Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Zefan Li , Johannes Weiner , Shuah Khan , Roman Gushchin , Michal Hocko , Stanislav Fomichev , David Rientjes , Greg Thelen , Shakeel Butt , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH bpf-next v1 3/5] bpf: Introduce cgroup iter Message-ID: References: <20220520012133.1217211-1-yosryahmed@google.com> <20220520012133.1217211-4-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520012133.1217211-4-yosryahmed@google.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 20, 2022 at 01:21:31AM +0000, Yosry Ahmed wrote: > From: Hao Luo > > Introduce a new type of iter prog: cgroup. Unlike other bpf_iter, this > iter doesn't iterate a set of kernel objects. Instead, it is supposed to > be parameterized by a cgroup id and prints only that cgroup. So one > needs to specify a target cgroup id when attaching this iter. The target > cgroup's state can be read out via a link of this iter. > > Signed-off-by: Hao Luo > Signed-off-by: Yosry Ahmed This could be me not understanding why it's structured this way but it keeps bothering me that this is adding a cgroup iterator which doesn't iterate cgroups. If all that's needed is extracting information from a specific cgroup, why does this need to be an iterator? e.g. why can't I use BPF_PROG_TEST_RUN which looks up the cgroup with the provided ID, flushes rstat, retrieves whatever information necessary and returns that as the result? Thanks. -- tejun