Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1214865pxb; Sat, 4 Sep 2021 03:39:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypIDJANXtJwt7xySHmkPsNseOA4K91gllEAhB5HXLUmUpEbJUTTXA8hMuZ24bTOmeFL48Q X-Received: by 2002:a6b:8f94:: with SMTP id r142mr2518697iod.183.1630751946201; Sat, 04 Sep 2021 03:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630751946; cv=none; d=google.com; s=arc-20160816; b=Nir8iBXagbxVs6xKxiYPAtLD122jvnyh93FNWuQezDb29+tHGGazpprgzxg/CSBrX/ zoXRUoR5+UJnVZbKMXAzLkxInrZtF2MX4oEGExm6p76PjkdYqc2nYZq4ktBOFQMJu8Oz Lhr+NJQB+Hk41i9cBsmjm6qsrfZpzLN31SyeN99wJZIpoHnDmZb+PG2mImJFuMmE4t4Y Kkl+UK43xC4yYeQhEO6cnLnY2Q5oi3DnzJC9ZLS0f/k8w51JAD1TsJvJPlaqt5mJKHY/ NPAMBXl9FItw5cFZy2h+S712hWZxGTeRQQrPFYK/PnN5hDHnf/zMJBAOPVxMzG4SaGFp w+Gw== 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:dkim-signature; bh=QEFGMQJ2WP0sty7LjvnD/gj9uF39L/OqqqlqNHn7lWk=; b=GQVs1uNJL1H88t+Y0QGjheO//sW2e+z8Zj8ipL8nDt85mJkufNLqVamJYTRpk3ERG0 jA0rVc7B24MfTGPuRkwyGQ47mREVpyIt7AIJveJo/VCA/qj/sNHLSLvuKpHQbkQjlMXO K8/f+saccy1n7ehk4nCtimvfcfjpR3dNuj1UY/AurdMSZN8Vczu2T0FoNF+6xI1E7M7L WMB0KWqwrNOgo5wI/gJHQYqf1VaCB03KgkDqtV61DWv8Zq9Po2+6K1Oj7RQq83Y54kDE 0yZMYku01iPraxw59k25Vuwbeql6sZv7ws+6dVlnqjw+6hLeQgnR0V5/OLAEPUAPna28 qtJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=j2a16Kya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si2186681ilu.84.2021.09.04.03.38.41; Sat, 04 Sep 2021 03:39:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=j2a16Kya; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235277AbhIDK0I (ORCPT + 99 others); Sat, 4 Sep 2021 06:26:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234482AbhIDK0E (ORCPT ); Sat, 4 Sep 2021 06:26:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A74D3C061575; Sat, 4 Sep 2021 03:25:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=QEFGMQJ2WP0sty7LjvnD/gj9uF39L/OqqqlqNHn7lWk=; b=j2a16Kyax11/plC2V3jBaxM2nm Zzv5MQ8EhlEb2KSlVkgxmYL4d/IdfsbU48e9tAmShVAVk7rZnALBCMyKXMh8jyKHxxx/Cx/8ybAX/ TOyu3rOSVpmQ9xU8iovVapUWVGMJRycE2GHbN3yk7G5rieA5fKeIxiihFTnBrceu1TKzk+Lv87Z5a oSFQeNi4Jw9A4IesKvI5nzg79tGYaQtsB3GZEfh7hkNBE+mDuaSmqTmr0ArC44j7abf78FkTEv1i6 WvQWkVoTEKJs4E4XcA/uqn4Y3uVB/i/f5ExzcLT+Jgs1sysgklw8gWf3c56l23PEmuidBiX4yePwH Eprrbkfg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mMSqc-005EXM-G6; Sat, 04 Sep 2021 10:24:37 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 0F842986283; Sat, 4 Sep 2021 12:24:30 +0200 (CEST) Date: Sat, 4 Sep 2021 12:24:30 +0200 From: Peter Zijlstra To: Andrii Nakryiko Cc: Song Liu , bpf , open list , Arnaldo Carvalho de Melo , Ingo Molnar , Kajol Jain , Kernel Team Subject: Re: [PATCH v5 bpf-next 2/3] bpf: introduce helper bpf_get_branch_snapshot Message-ID: <20210904102430.GD4323@worktop.programming.kicks-ass.net> References: <20210902165706.2812867-1-songliubraving@fb.com> <20210902165706.2812867-3-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 03, 2021 at 10:10:16AM -0700, Andrii Nakryiko wrote: > > I suppose you have to have this helper function because the JIT cannot > > emit static_call()... although in this case one could cheat and simply > > emit a call to static_call_query() and not bother with dynamic updates > > (because there aren't any). > > If that's safe, let's do it. I'll try and remember to look into static_call_lock(), a means of forever denying future static_call_update() calls. That should make this more obvious.