Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp5016488ybb; Tue, 24 Mar 2020 09:24:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtNesaHhVbS3gUWqtmV/YQXkNiM9bplet+ktaIS+ZyrdEU672THlKU2ARRSQtXusf1dFBEW X-Received: by 2002:aca:cdcd:: with SMTP id d196mr4065671oig.16.1585067064655; Tue, 24 Mar 2020 09:24:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585067064; cv=none; d=google.com; s=arc-20160816; b=gAMRCz2AGjOu/su9eWeFDF/Xg+mHgEoGAPZCL275rOyYITtA8qi7ZvxxMFtCSidHZ8 g+JnyB9BT3J63EirDWwp86x6AzdwO2GF8YTqKEzP3cFaWTkhkOpRX5LJRsW2tDwhlbkO yfCiJTQOtzB68binp8s8uwZnvoiTXDUm7XYSv5FE8GDbxd1l8s/LFs6/aadIL/juY42q 0mJ+121kPmWbEK7g5MkqpuJzPY0WsCQO7LokqFxki7ZdZyOEbcpaKXzWtKY0+NAGB3xx ZvVGrl5YiiOqs2Ux3Akl+20HvBPChpJHNfsBvAGG4i0l2bsptn9zvJIMkRIwNFUCvine EC8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:in-reply-to:cc:references:message-id :date:subject:mime-version:from:content-transfer-encoding :dkim-signature; bh=zElBZBLASkl8tIZVLgPF3Kl3otpP9bPotITVcSHs4/A=; b=0n4UnGM2LWA8h8mhlqeXtZLuNpg0y3ul3L2yv3ZxU3+TEK2Dmpyfr5n7UX9q6ApDto thfUpED2DBJhGgn3PeIkYZmi2c4+ZIikdkx1oaxqd3Uub0ziey3g/kRDyqw9axuFdmrj 5Pv1kFlz2YTqb0lsRfbIg39QueYvRCRyDpHOmVeLEfWrBefsDRMHtXtT1+3XrrxZnERs SV6Ed8MosDq276hUkd5hvNtV5SSqIFG+kirIrnw6IC2KpQGC79Itrp5IP1OSfmcq6n8Y xVx3KSRQH5Mbc81lNC7bgX76mEGgQSIOKiVe4myid3SsqpXN1At7cdLDjBt55HDDBAgV Gw1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YKsA+qFK; 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 i16si3394769otk.112.2020.03.24.09.24.11; Tue, 24 Mar 2020 09:24:24 -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=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=YKsA+qFK; 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 S1727755AbgCXQWf (ORCPT + 99 others); Tue, 24 Mar 2020 12:22:35 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37695 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbgCXQWf (ORCPT ); Tue, 24 Mar 2020 12:22:35 -0400 Received: by mail-pf1-f194.google.com with SMTP id h72so7318477pfe.4 for ; Tue, 24 Mar 2020 09:22:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=content-transfer-encoding:from:mime-version:subject:date:message-id :references:cc:in-reply-to:to; bh=zElBZBLASkl8tIZVLgPF3Kl3otpP9bPotITVcSHs4/A=; b=YKsA+qFKquODHT56C8+xdEVHq5PkRJZux2YJFvXOkUhbrxCUFdkldgrmK4BBWiJwhV HkHSJbNBG53YtwqHLKXT/+GClot9/1kN3KdapmJEUH4vOQv8YgWpq17dA/Kov9QP8xAb FdVEg6AKKALqEdecwh4LHB6mVe6cLpQddbeAYZpavzoll3F9FWgUN6p+Tng7Z305SJJJ 6on0Cfj206Fj/EdIhuJyCNhvqDsDcpT2zAydhlO3uusf+5oQP1JMgDoBWvFhjAU9rq/C IIJtDKfG8pPaZ1vpv7BdX85OGH0PlJ/iT+xU6GPqwgO5NbNmmj232UDHSs6QmXZQ6lqA GMPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:content-transfer-encoding:from:mime-version :subject:date:message-id:references:cc:in-reply-to:to; bh=zElBZBLASkl8tIZVLgPF3Kl3otpP9bPotITVcSHs4/A=; b=EQrVz8Nq3bPnP+fmDj0X2w0wdB1AssZPW7jofq8vbhupBwR4lWDz42yZzLAf4Uz6Ia 1QXZW6yIH57ptBn+85GG0rZeNNOOGsA1WT8es6N63uVDC8kNmdPF86IOgSNoCpwFC5hp ZYrWut4LOchzrekoB3bBTGexGk59MjgYJfZaNDlShgjQG+w2Z4BRA10+QaPQQRaWANby Z7iRq9MVCCDGqWhPqpoYMFjNXRY+M+S0sar7GhgKiCM+3I7Jn+DsZ1G1Em6PndJAuC93 FyNYVr8o4CwWmNIeJ+Ga7uKe1a3bD3LIPc88lhhEpi/3knfFO5YLyBxyQOAMqz9b7Bfu 8bwg== X-Gm-Message-State: ANhLgQ1dVh+A+laKCDUvGmV6Vr8Wup3JlCzPBziLkd7HNqdU/DR6W9GM ZDaFLyHbcdY8guQ8qGksYxn1nQ== X-Received: by 2002:a63:1e44:: with SMTP id p4mr28437618pgm.367.1585066954419; Tue, 24 Mar 2020 09:22:34 -0700 (PDT) Received: from ?IPv6:2601:646:c200:1ef2:f57f:ae28:7a6d:bb35? ([2601:646:c200:1ef2:f57f:ae28:7a6d:bb35]) by smtp.gmail.com with ESMTPSA id nh4sm2706730pjb.39.2020.03.24.09.22.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 24 Mar 2020 09:22:33 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Andy Lutomirski Mime-Version: 1.0 (1.0) Subject: Re: [RESEND][PATCH v3 14/17] static_call: Add static_cond_call() Date: Tue, 24 Mar 2020 09:22:29 -0700 Message-Id: <86D80EA7-9087-4042-8119-12DD5FCEAA87@amacapital.net> References: Cc: Peter Zijlstra , 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 In-Reply-To: To: Linus Torvalds X-Mailer: iPhone Mail (17D50) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Mar 24, 2020, at 9:14 AM, Linus Torvalds wrote: >=20 > =EF=BB=BFOn Tue, Mar 24, 2020 at 7:25 AM Peter Zijlstra wrote: >>=20 >> Extend the static_call infrastructure to optimize the following common >> pattern: >>=20 >> if (func_ptr) >> func_ptr(args...) >=20 > Is there any reason why this shouldn't be the default static call pattern?= >=20 > 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? >=20 >=20 I haven=E2=80=99t checked if static calls currently support return values, b= ut the conditional case only makes sense for functions that return void.=20 Aside from that, it might be nice for passing NULL in to warn or bug when th= e NULL pointer is stored instead of silently NOPping out the call in cases w= here having a real implementation isn=E2=80=99t optional.=