From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0476BC433EF for ; Sat, 4 Sep 2021 10:25:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF1D760FA0 for ; Sat, 4 Sep 2021 10:25:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235121AbhIDK0G (ORCPT ); Sat, 4 Sep 2021 06:26:06 -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: bpf@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.