Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1674803ioo; Sun, 22 May 2022 23:58:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHjdjJviG6DmSBrhZTHZ1R4dLRx7lNB1AJE+bB8pCSLi8Rg5XK35Q35w6H9fz0KHY1q1q7 X-Received: by 2002:a17:902:ef48:b0:159:51d:f725 with SMTP id e8-20020a170902ef4800b00159051df725mr22155179plx.47.1653289088749; Sun, 22 May 2022 23:58:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653289088; cv=none; d=google.com; s=arc-20160816; b=pKc9aDcTuLnD134DbZwUCPOSYYMY2YqtfzHlBNWCqVihuMzOmatIr4JdSWCVJ0QqCm V/qgZLH0VFrq6JmDyvVZ8rK4iE4a8BWSqsSmYE9B29xu8yc9a2g/wa2MdTJAzvOZzngv idbZ0AywZnWEHU5F/ae1MIAqKhA8gszBAiA4UvSe1OIp7MA8tOx7w6M2957w6ayd5VlC 0+PYhCRVNGS4pzsq2Q6eFNiE4FRWQG1NbZXEYaaL1ae1OpLDHItFqYcTdvyT1N8Sn3/8 al0JG89rWQsPHHan7/IUeNvsEsLU0LpICjgEGbMYSPT/J3MxHdHvGPkFzp4+hV5eu641 v71g== 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=cSj1iULxPa/Q17vQx9CvBh+XXwbDyu32iNxH8BDHGWo=; b=KyTuk4UIVPt3I0AdRXiepxhyxZPBnivab9i5jnc6UsilnkvqnmRV4z1pCN60yN5Mcx 5saIohsNXF7DfQUJOLjapTfLj8NGBfBLBHmodgi5h7Acsg1+trBsaPaBPwXjp8Tp8X4A 4XvK5fATlRJAFUeqT9ZgNNXZUbgFI8kfHIeDPTD8hpWteR1c7L+W4WvmQtzFUxTXGSOS 85IerY0IYuPn+baJcTb+C9szEg+TVQEgzsIOZ7vrqJBfZNtbpGDxdRLc0RHw6UvV+djN 3wWOnrfNUHOG+ua5FO7HutVjubr9BglkXCzHjQsMoLSpKQR9x43KAuA5celJWusRBONl in3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KAl6JiUb; 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 i37-20020a635425000000b003c24706f629si9439561pgb.75.2022.05.22.23.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 May 2022 23:58:08 -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=KAl6JiUb; 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 B354A5A17D; Sun, 22 May 2022 23:23:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348440AbiETLQP (ORCPT + 99 others); Fri, 20 May 2022 07:16:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348460AbiETLQE (ORCPT ); Fri, 20 May 2022 07:16:04 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28908201AE; Fri, 20 May 2022 04:16:02 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id h13so1226896pfq.5; Fri, 20 May 2022 04:16:02 -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=cSj1iULxPa/Q17vQx9CvBh+XXwbDyu32iNxH8BDHGWo=; b=KAl6JiUblhGNLjQZ5H0XrsEH9sR+zAIGiIrYCvRSOx3z++Jx75Eil0AfqhCM8BbmPR qPbECuxldaypu17UE9fgu89sGfMl+EohW1msxEf6R+k1ZrxamBnRam6cYcJcx7mXGEqg g/6VIVWY73HuktEyJ9EyJCB4Lddi2viqjElMH2ai6Q9L+7nv7ma1iOTRAbMr0jGRP0sT T2ga5r8esXHAIG+CzKW2Pt1e8LuhbOIyKuceUi9Yu5OgSv+9+TSt7xFSfM1lI8rZhdxQ aVEFgCYfivV/FDw3ekn39hJpjJ8YmEZ/SpoeZdUduz+g+kLNR+zul2CDNo3FNVhbchS9 tEIA== 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=cSj1iULxPa/Q17vQx9CvBh+XXwbDyu32iNxH8BDHGWo=; b=0w88yCrOL04HwqV5gLOWjIFgDP0uBZPSjC4HwA7j7jzwRJIzIgVsdCu4FqViL5FvQ7 MNx4wNSizTpF209qV+DHVEoP95X2w3Oue2vdTgjoHn1uoNT0zBE5ey+NnxVvjTvQxGIi FDpQ+BsXBxUCs3PottXCEglZsGEwypRbBNAOSDSlcyM3qk6Z3/QYMuZg9a90/aHCLiEb DVooyjnx2J+WFfjceGq2+HaMmEKglBxerSlh4zYRyXzfQwxTQWYP2LwXX7Bo3SyTrauX 6fXCAmAgYqz/g5jGzkmoszWQNZoVvcdXyJa9i55zjq9j7V6iH6GxHd1UfKAYh4nJh+lj mwiA== X-Gm-Message-State: AOAM533hze85FmLKL61QQUsktWisM+oV9UFKK+YoiqhPPoLb2qMRJLJM t1ggoNEy1QLTAwV2bwTj8dy3j/VAgKk= X-Received: by 2002:a63:1a1d:0:b0:3f5:eb02:b6b4 with SMTP id a29-20020a631a1d000000b003f5eb02b6b4mr8196749pga.343.1653045362244; Fri, 20 May 2022 04:16:02 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:1761]) by smtp.gmail.com with ESMTPSA id y6-20020a62ce06000000b005082a7fd144sm1559042pfg.3.2022.05.20.04.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 04:16:01 -0700 (PDT) Sender: Tejun Heo Date: Fri, 20 May 2022 01:16:00 -1000 From: Tejun Heo To: Kumar Kartikeya Dwivedi Cc: Yosry Ahmed , 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 Subject: Re: [PATCH bpf-next v1 2/5] cgroup: bpf: add cgroup_rstat_updated() and cgroup_rstat_flush() kfuncs Message-ID: References: <20220520012133.1217211-1-yosryahmed@google.com> <20220520012133.1217211-3-yosryahmed@google.com> <20220520093607.sadvim2igfde6x22@apollo.legion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220520093607.sadvim2igfde6x22@apollo.legion> 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 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. 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? Thanks. -- tejun