Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp48801iof; Sun, 5 Jun 2022 20:44:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRGAFvRtMJ7VJJobZho0cReLbsTLcLMvk7HOMkRlExq/N9rO9DRu/wM1445sApFYDamzS+ X-Received: by 2002:a63:8bc7:0:b0:3fc:bd28:c819 with SMTP id j190-20020a638bc7000000b003fcbd28c819mr18718104pge.378.1654487040405; Sun, 05 Jun 2022 20:44:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654487040; cv=none; d=google.com; s=arc-20160816; b=t4tP6qKabI1hkj1bqgAme//Z9roxehgc2WDwV9lshBxQXQzq27bULAQQJ5tMuKo2JX wWZ3fOXom/qdReTTKYAVJNvh2l6P7v63A5pV5O7o6ap56OGaMsnqLUtLEsWR5MFXZnyx yobIzV1IyOq0oj98v0Tu6d6pqgh1wCwBSNgtyFOOQVH9sFCradKZOr5Ss31Fla5X4lua Wm1iOBKvuKUvMvhJYwzovj/mrenN3/2cPQCZLy09l3f7atTnEun5m2SSljjIlIgjW4wd MPdUbOTwssfiLhAvXpd9uexy6AHWRZ6aRx81jb/PzKEPNlWZlzykkDBd2HtZqnKwPJa2 nzBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=2GUYLgLLblP6ZShyfDapCvEFm9z4SpPOJsQkTp/Thic=; b=CqfhUNiqgFMIOfzK8jy7aDAzgMLI1m7HO5yT99qRLgnXcvYnU1enjhStBstKL7offY GO1FwOgeKx4t4/fUrlZ0yQLbJ3y4O1NdLUYJF9n3347ymhg1vCgk0q80cOvrroTwcrEu rYkoZGyhMKqCWJ5nyZ6cVYyEHscsyEhKupGQVz3Zv7kVWQFjEX5e1UOe7+m4zA9w8f8i m9ySJTD67kb+ePhI/QfvTnpv3T6+QRarGw0IicGrE9I3aL/P+JYm18cSvQ7uSVpyFKV8 0nDgzo6MHzb4phZuc2mNZKFbYFoKPNQ87u5KaYL6hbkuVxtN1imrd6ELjyheQ6/KnMYw t1wA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FsBSBMGa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id g68-20020a636b47000000b00398a0c97c69si18083062pgc.751.2022.06.05.20.44.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 20:44:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=FsBSBMGa; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E237A57988; Sun, 5 Jun 2022 20:38:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343881AbiFCQXo (ORCPT + 99 others); Fri, 3 Jun 2022 12:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234520AbiFCQXn (ORCPT ); Fri, 3 Jun 2022 12:23:43 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D1C32CDFF; Fri, 3 Jun 2022 09:23:42 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 000F121A67; Fri, 3 Jun 2022 16:23:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1654273421; h=from:from:reply-to: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=2GUYLgLLblP6ZShyfDapCvEFm9z4SpPOJsQkTp/Thic=; b=FsBSBMGajNErb9riTALytwTaDYhoeYZ8mPEfQ4Mfitmatc3wsEncKsjqO2JuEPRyYmjVrk KpSXVyz+B31NXEVJa0r04ACq1AFXVB4qXswKT9CQgcVXmohknJoOpq4SWi+WOo6nTk3EI1 A8PiB8z7udFoHPur1cnPgTwioo5rZ04= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 8D34613AA2; Fri, 3 Jun 2022 16:23:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id p8CNIYw1mmIuQwAAMHmgww (envelope-from ); Fri, 03 Jun 2022 16:23:40 +0000 Date: Fri, 3 Jun 2022 18:23:39 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Yosry Ahmed Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Tejun Heo , 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 5/5] bpf: add a selftest for cgroup hierarchical stats collection Message-ID: <20220603162339.GA25043@blackbody.suse.cz> References: <20220520012133.1217211-1-yosryahmed@google.com> <20220520012133.1217211-6-yosryahmed@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520012133.1217211-6-yosryahmed@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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:33AM +0000, Yosry Ahmed wrote: > +#define CGROUP_PATH(p, n) {.name = #n, .path = #p"/"#n} > + > +static struct { > + const char *name, *path; Please unify the order of path and name with the macro (slightly confusing ;-). > +SEC("tp_btf/mm_vmscan_memcg_reclaim_end") > +int BPF_PROG(vmscan_end, struct lruvec *lruvec, struct scan_control *sc) > +{ > [...] > + struct cgroup *cgrp = task_memcg(current); > [...] > + /* cgrp may not have memory controller enabled */ > + if (!cgrp) > + return 0; Yes, the controller may not be enabled (for a cgroup). Just noting that the task_memcg() implementation will fall back to root_mem_cgroup in such a case (or nearest ancestor), you may want to use cgroup_ss_mask() for proper detection. Regards, Michal