Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5043650ybb; Tue, 24 Mar 2020 09:55:55 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuu9ydPWoaXNmCESb+I1gQYvbAfBrmtmqPF2mWpI30hC+kt8NKYAmbv6Elof0Vf7rcGHCck X-Received: by 2002:a9d:6b16:: with SMTP id g22mr5230010otp.37.1585068955700; Tue, 24 Mar 2020 09:55:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585068955; cv=none; d=google.com; s=arc-20160816; b=NImyTKYHtaQpHvrRwHPtICpPCaupLIfDQH5q/AuVOVLwEP5pwlW8U/HZ0x3sCZUuvZ /GORFUSXT6bjrzvTWiZD5lJnDV6IgZMRSRP6OM1HykX3saY5FLDzjSD5djox2BaQwnP2 ayF8GnEWsC5HzsNrwHRhVNtlchA5J2ByQhi0H+SrcEFZ5q1OcZyCZB7lEibDRl8qaSmK 3AMs18f9+GLRxufamub6qQbTF6VUZDUHf8ZrlzC21+l8EMeV18Fu07lALJdko1HaDCUr JF4aUhLow9SmrdBpKG8Z+RRAKMvf5FwHlzIkMrwHOx4dZHngm4MueWkNs6+r+Tsz4ynm ppQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=A0ojL14BqOuhudwXrers//6Y4R0jtCChC5fidi/X22w=; b=xFm0NdOdliM9/WYYFdd1OIO7hOz92H7Tb/7PXHPoT7/BS1RLGGL3SYrXCJmJxmaJi7 Thm4fLW0vFq5xhS7QgneRLV/MN3Q/3DZW4B9yFXHBMEEFuwEqYHrs0m5pyl1fV4n9nNe 05R8wLi14xdyGOg53iaEjqNJUxcl4xyVbo26fCGbuiwYqPn2SNnji9EgRNFollTKxbAd VgNlSCgkiBEAPltvfWpb5RoIhMAdbUTnvUXvVOgYNRQ70AL53QSyWREb9slGeA7Vvtaf hc+I9Ijf64hvcOJouH3z7JVEDGoOmku++cxdq7C1kys+CSzdOdJzGvAe6s6uvqbZN/Yr +R3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=j68qL3vm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t6si9614773oib.255.2020.03.24.09.55.43; Tue, 24 Mar 2020 09:55:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=j68qL3vm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727376AbgCXQzX (ORCPT + 99 others); Tue, 24 Mar 2020 12:55:23 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42708 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725767AbgCXQzW (ORCPT ); Tue, 24 Mar 2020 12:55:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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=A0ojL14BqOuhudwXrers//6Y4R0jtCChC5fidi/X22w=; b=j68qL3vmM3RwzBBTQ+9Yhd1Wif wVcKyM8VC/1JnZ8JktLxZ7gMe+8u0DF51w6z959S65beMOMmux0PgTtp6Da9UG/nSy2J7iQAPRvAr XMVyadEkWSB3att8VgPXRwB/3lnUavIb4OGSCRQn9mOZz306rdb3y3vprbti4mmCshhw5yECazS9I 6BsEOA2MlM/LdDfjHGE6ZRVSHN1KGOzqAfmIdKIJJTyX3lLq5FVigxGXCShY2nGJXDNdpNJCeAuJE lKCbaAZh7dnT2aWbE+6e8LApfvPkMEpMp2hJeimHWSL5PsH0om58yBJzULXR+RY5GT9NToLLimqUt BjZS7vPg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jGmpM-0007kH-2r; Tue, 24 Mar 2020 16:54:56 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 5584E300235; Tue, 24 Mar 2020 17:54:54 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2D85429942924; Tue, 24 Mar 2020 17:54:54 +0100 (CET) Date: Tue, 24 Mar 2020 17:54:54 +0100 From: Peter Zijlstra To: Linus Torvalds Cc: the arch/x86 maintainers , Linux Kernel Mailing List , Steven Rostedt , Masami Hiramatsu , Daniel Bristot de Oliveira , Jason Baron , Thomas Gleixner , Ingo Molnar , Nadav Amit , Peter Anvin , Andrew Lutomirski , Ard Biesheuvel , Josh Poimboeuf Subject: Re: [RESEND][PATCH v3 14/17] static_call: Add static_cond_call() Message-ID: <20200324165454.GT20696@hirez.programming.kicks-ass.net> References: <20200324135603.483964896@infradead.org> <20200324142246.127013582@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2020 at 09:14:03AM -0700, Linus Torvalds wrote: > On Tue, Mar 24, 2020 at 7:25 AM Peter Zijlstra wrote: > > > > Extend the static_call infrastructure to optimize the following common > > pattern: > > > > if (func_ptr) > > func_ptr(args...) > > Is there any reason why this shouldn't be the default static call pattern? > > IOW, do we need the special "cond" versions at all? Couldn't we just > say that this is how static calls fundamentally work - if the function > is NULL, they are nops? That doesn't work for functions that have a return value ...