Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp1458484pxb; Fri, 27 Aug 2021 09:16:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7v1dsoVcvuAXFyzoWuKsuz0NKUWp3B9KZ1XCX92QX3+a0ha3fF2IslodH5cyH39I0conu X-Received: by 2002:a05:6402:1775:: with SMTP id da21mr10448418edb.49.1630080994752; Fri, 27 Aug 2021 09:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630080994; cv=none; d=google.com; s=arc-20160816; b=h7E/3spcG/g6y4E8Z6UkAA6taSSXb4COCR8QQ0BOrvRdu6aoC3uCtgDEhMEme9kJt8 Pj4thexlP0sIzuqMnVDOxgmuJvtlo5jv3E/WEgv3R+oS7EzsxBzx95PCh2QZTQYhble+ yeWgOm/yaBBvK8fmAmiVw9sCLmgvrhWP5kemtxXeQd9CthxphubX+ELt4Ilso4ZpnZl3 zZVveBSu/pXG41N0PnT1oZmjbIaI9YG3gcDDT65jnn4dzhVtrXdCE/1fA3P0qn611yHX 7BcaSmNBYiG5HctGFAvIWUjB/R5quQxWa6Hsr+kHUekuToFPKqWgpTFqs0fqoyTjkcPw /2OQ== 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; bh=zOY/EDyq9eMi3N1mHZJsXKC5/V9sYfUEBI9+xdZtugw=; b=v+1/DxK08v4YtgY2cL66kk3yOCORa5Lb32ISF1iP/5SfWJrdptx6rD93eZ4aQ5WYk8 LXCy2+F1XD41A9j4Ro+v1z4xtiRGsh0hazrgL1TZNUODjvnM8exFmUu/Uu8Fb7/CgCv3 5Cl/VvR3t0kYncbRzIVOsjnySVEdEULyyugmnct13Qtz/q224JZAZTKcmpgqjNl2nAEW HDJUWGYgIXqpiiIeqcN3OOlxqagbL+dwIxAxRfMtxKLBVIbnSmC+0qgtv/4cCc46yYW5 QxtPA0pDKT0+Ji8xE8bRKBnhPiZBSpj1uy3E7bHq1Pd8cuW1Q4lGogF3tg4ctKFgxW13 /htw== ARC-Authentication-Results: i=1; mx.google.com; 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 u30si3545391edb.156.2021.08.27.09.16.00; Fri, 27 Aug 2021 09:16:34 -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; 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 S245533AbhH0QLT (ORCPT + 99 others); Fri, 27 Aug 2021 12:11:19 -0400 Received: from gate.crashing.org ([63.228.1.57]:57559 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234299AbhH0QLS (ORCPT ); Fri, 27 Aug 2021 12:11:18 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 17RG4ccs010710; Fri, 27 Aug 2021 11:04:38 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 17RG4ajV010707; Fri, 27 Aug 2021 11:04:36 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 27 Aug 2021 11:04:36 -0500 From: Segher Boessenkool To: Peter Zijlstra Cc: Christophe Leroy , linux-kernel@vger.kernel.org, Steven Rostedt , Jason Baron , Paul Mackerras , Josh Poimboeuf , linuxppc-dev@lists.ozlabs.org, Ard Biesheuvel Subject: Re: [RFC PATCH] powerpc: Investigate static_call concept Message-ID: <20210827160436.GQ1583@gate.crashing.org> References: <8077899fee81f08a7dffbf185569d3a1f7a2ab68.1630057495.git.christophe.leroy@csgroup.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 27, 2021 at 04:18:47PM +0200, Peter Zijlstra wrote: > On Fri, Aug 27, 2021 at 09:45:37AM +0000, Christophe Leroy wrote: > > This RFC is to validate the concept of static_call on powerpc. > > > > Highly copied from x86. > > > > It replaces ppc_md.get_irq() which is called at every IRQ, by > > a static call. > > The code looks saner, but does it actually improve performance? I'm > thinking the double branch also isn't free. It isn't, but it is very cheap, while the branch-to-count is not, even *if* it is correctly predicted. > The paranoid in me would've made it: > > BUG_ON(patch_branch(...)); > > just to make sure to notice the target not fitting. Ohh, patch_branch() > doesn't return the create_branch() error, perhaps that wants to be > fixed? Should that be allowed to fail ever? I.e., should a failure be a fatal error? Sounds very fragile otherwise. Segher