Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3284433lfo; Mon, 23 May 2022 00:41:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyex+117T7gV1d3OJB1U0a3TJzDJrCmu6tAStignheys4KrofF5IWBZ5lHqJp7h6/fmPfMv X-Received: by 2002:a17:90a:ee90:b0:1df:3cea:a6ce with SMTP id i16-20020a17090aee9000b001df3ceaa6cemr25346908pjz.156.1653291671424; Mon, 23 May 2022 00:41:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653291671; cv=none; d=google.com; s=arc-20160816; b=nIa8ssKrfyk3X+jYjXIaXod7dufCt2I3s+FqSN+ri4hwTBHFu53/JFa2QHE8SV3yGp PvpqBNJLdD/4jZD81lpJU+2r91/Xd2ZpE1vTHLvvcgoq8Hv9MWY55K2qYmKCB+4LqkHh r2a6do9RLH8SxcL9ff7NVxgZ7FG9kZWGoxuIu9xQxTvNdzD8UOx+0TeiMxkTRQS8bMPp HgsbybuwUsIeyNKyNJwg/qzcTVG/iwlj0dy48YDrGdAbjRsfkdlojnsVfjVx5TnmnmMs wXRvU5VKDUnU45lZ9YKLOjOtSjhiSQsoE/lzHmmtTzulVW4BKqugupnwjZYs2etYsree przg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vjm4J0UEt15jqND8yu0VfF/JH1EN98mQjkeJ7hl8/Ec=; b=PkwviVqiFzxEu+TSTqCtdYehs/joSS9wqwmBK60+BR06X/v17UnAcE9JtL63TKNZ9v 28IMgE1DX/5jjyJCWqJsTd/nE23qA5GrUVqbg7rOd4LWhCRMnHB1XK3goQJqjn4woE// qZ58z8hcwf6u0B9yxgAcEW5HtYqLQrEd/sWd8DGkp0FWBk2ME1f/lfnXotd0bXOTa/e+ B1G64qBIBtKbhbQLKPtvGlJAsmp2nhWbfCeJ0uBXcPVjnxGVGRDAmX81zNr+xxE4bEJA SsQ/ag+zn25in3qqXv35dhe1mpl2Vqi4nFFLFQbEi9oXfZd1XD1dc5KhItuOxlDU79uJ Rqng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=pPChiNi8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j4-20020a654304000000b003c26d3bb7a0si9366833pgq.542.2022.05.23.00.41.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:41:11 -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=@google.com header.s=20210112 header.b=pPChiNi8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9511A657E; Sun, 22 May 2022 23:46:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351342AbiETQH2 (ORCPT + 99 others); Fri, 20 May 2022 12:07:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351331AbiETQHZ (ORCPT ); Fri, 20 May 2022 12:07:25 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 404831737DC for ; Fri, 20 May 2022 09:07:24 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id r23so12137489wrr.2 for ; Fri, 20 May 2022 09:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vjm4J0UEt15jqND8yu0VfF/JH1EN98mQjkeJ7hl8/Ec=; b=pPChiNi8weWzvtqUuLzWWN2Kgh2JKNWRx5//iF1unO8QpnGtgal2d+z5kUsLbQsqKy iHC3AYYDtLWRRgw2yCAySZ8Ywti0zeA2fYn2pv1Xe4XdvkmRTRyUHnRjCLoEL43VJa0g 1J8laDrC6/zJaUOeTtGsHCUINSBHrKxQ7oXtFbZabduDuf43ww/MDXDlbez6NkDjViSO LsjWN1wqp7T6IXSp894JQqkMs270xetYAn1vvBHxJ++4OeXX48qWMWNLUTLtcY1aSWDJ pnmt8q1zLR1CrKceQKXburkrirj3qSugVm3o12bP8B2MFxjXwSKaUfM01FpwzqTdSzsH J+WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vjm4J0UEt15jqND8yu0VfF/JH1EN98mQjkeJ7hl8/Ec=; b=v4mjgrUS/wT5qpA8O8Rl3V//+Rfswf1LhbW40mbhMHXuFlj9ORCXCDs/S0q123Nx52 /p0Wo4GbiY4W0i33jtx+MGmNqNe4PMKHnpKJDS4lUAptKLo4e8xQFXEQfBixUT4e+VyE FBcs6i3lMZ9p4IXs5L5Gx3B5wLFppf7pgv6GQha3kkpnCxD0N5qPYwemMmU2KP4zRlfR XW5QhpM0cnbnzclU+BjOTHteSZryfy/sSyoCIkOpxNBMqmUcwwPMaI06q4kc8A1LzPpd kqIfai05Y24L98Ih6UpI5AXSQwTNKkpOo9Me/vph57sOZ2quGyzEeRC604s+Oq1TBOvF 9m/A== X-Gm-Message-State: AOAM53200deQHFgCEQM4Fz4LIx+i82VxV5s1sSCVFPFdIHrNR4dN+ysp RTtPcIyJoaJJaUv/bt33cIVL0QF3abi7ijm84o9VDQ== X-Received: by 2002:a5d:6146:0:b0:20d:d42:e954 with SMTP id y6-20020a5d6146000000b0020d0d42e954mr8938736wrt.372.1653062842564; Fri, 20 May 2022 09:07:22 -0700 (PDT) MIME-Version: 1.0 References: <20220520012133.1217211-1-yosryahmed@google.com> <20220520012133.1217211-3-yosryahmed@google.com> <20220520093607.sadvim2igfde6x22@apollo.legion> In-Reply-To: From: Yosry Ahmed Date: Fri, 20 May 2022 09:06:45 -0700 Message-ID: Subject: Re: [PATCH bpf-next v1 2/5] cgroup: bpf: add cgroup_rstat_updated() and cgroup_rstat_flush() kfuncs To: Tejun Heo Cc: Kumar Kartikeya Dwivedi , 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 Mailing List , Networking , bpf , Cgroups Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL 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 4:16 AM Tejun Heo wrote: > > On Fri, May 20, 2022 at 03:06:07PM +0530, Kumar Kartikeya Dwivedi wrote: > > With static noinline, the compiler will optimize away the function. With global > > noinline, it can still optimize away the call site, but will keep the function > > definition, so attach works. Therefore __weak is needed to ensure call is still > > emitted. With GCC __attribute__((noipa)) might have been more appropritate, but > > LLVM doesn't support it, so __weak is the next best thing supported by both with > > the same side effect. Thanks a lot for the explanation! > > Ah, okay, so it's to prevent compiler from optimizing away call to a noop > function by telling it that we don't know what the function might eventually > be. Thanks for the explanation. Yosry, can you please add a comment > explaining what's going on? Will add a comment explaining things in the next section. Thanks for reviewing this, Tejun! > > Thanks. > > -- > tejun