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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3E48C433EF for ; Thu, 21 Oct 2021 14:37:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D2E2B6121E for ; Thu, 21 Oct 2021 14:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231381AbhJUOjv (ORCPT ); Thu, 21 Oct 2021 10:39:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230072AbhJUOju (ORCPT ); Thu, 21 Oct 2021 10:39:50 -0400 Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56034C0613B9 for ; Thu, 21 Oct 2021 07:37:34 -0700 (PDT) Received: by mail-pf1-x436.google.com with SMTP id f11so798671pfc.12 for ; Thu, 21 Oct 2021 07:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hWMulavHguDBRCrVKyFBVx7gMZcaLDBqhj8CvP80Q7E=; b=iAmCvh52C6lmCYBo5ZiN5hHCAu2fAkWo/EasINRykyHBmAETWy8beZzvcus5tEkwRm 7Ljfn0XrTNszaIj6pRrjgqoTow7+xQL2Qqd2li6ADiIk1ZH+53YX4Rrje9ReuzejsKQt WZ5qd6woEpPksRm5JkUKkrpCIpuTDlAtVAIgjBOlULlq2ksuCSswqzryjON+C7/l44Pl ABVgQ0AwVNxXh9ZFicLf4H+a8gTtvOaMIxXM7UFNKbFngZl3mfE/eHHeeRYRFraAgP3k w7fIedfNV4u5amqVkV8ZPpz8vHcKblaYRrLiZENkAqVHEy5qLh5a2/a/L6R9sBdWYWcF j++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hWMulavHguDBRCrVKyFBVx7gMZcaLDBqhj8CvP80Q7E=; b=zMaW8MbwFAimxkqiToG/sQ7E6soSyMQIVg0Ss3A3LS8Cz5cWSHn8u6JvvEAv9yx2qJ 0FOKbGLsDoFLWv0QbtUCOekwZmxDLMKeb4Mk+Ttv+8KiW/KqivN6NtfFtlOHXj2NCTSY kZaov2ZBj8+IrQ8IM+ky3t4qTnkn8rkqyt9m0onMI/EzEXiN4BNDoFA3xL81/Vl6XZ54 7v4aXwPIWItpm42PFD1QpX4HG1zU38P+q2RmHFch8lafG6Fxihmx9yecxTcchUFL3jBA L2MidyGeTDqltQ6KXvgLah0Q/nMKy7uoBUtphkuxSeJW6FhWQjojmXeIAUf+F+N8Pxc3 A0xg== X-Gm-Message-State: AOAM533G0KcamIw+1NXOLejmuiOL8k/sZoZEKUaT/yh30xiz1DK0/h4C EO2fGYXoroLb5tHDRbMpLWir6Q== X-Google-Smtp-Source: ABdhPJyjDdV/DmdDuhG8h5Y8UWuU/WoJYOGcrVrT73FmJenSSbHocJoQBYDDbyDIZYNHHR5dMzTsOA== X-Received: by 2002:a62:6543:0:b0:44c:61a0:555a with SMTP id z64-20020a626543000000b0044c61a0555amr5748532pfb.14.1634827053748; Thu, 21 Oct 2021 07:37:33 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([148.163.172.147]) by smtp.gmail.com with ESMTPSA id z19sm6182867pfj.156.2021.10.21.07.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 07:37:33 -0700 (PDT) Date: Thu, 21 Oct 2021 22:37:26 +0800 From: Leo Yan To: James Clark Cc: Catalin Marinas , Will Deacon , Mark Rutland , Kees Cook , Ard Biesheuvel , Sami Tolvanen , Nicholas Piggin , James Morse , Marc Zyngier , Joey Gouly , Peter Collingbourne , Vincenzo Frascino , "Peter Zijlstra (Intel)" , Stephane Eranian , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv1 1/4] arm64: Use static key for tracing PID in CONTEXTIDR Message-ID: <20211021143726.GA213960@leoy-ThinkPad-X240s> References: <20211021134530.206216-1-leo.yan@linaro.org> <20211021134530.206216-2-leo.yan@linaro.org> <53962765-53b9-dfdc-a5b2-a3133a924c12@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <53962765-53b9-dfdc-a5b2-a3133a924c12@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, On Thu, Oct 21, 2021 at 03:33:01PM +0100, James Clark wrote: [...] > > +static int __init contextidr_init(void) > > +{ > > + if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR)) > > + static_branch_inc(&contextidr_in_use); > > + return 0; > > +} > > +early_initcall(contextidr_init); > > Hi Leo, > > Can you skip this early_initcall() part if you do something like this: > > DECLARE_STATIC_KEY_MAYBE(CONFIG_PID_IN_CONTEXTIDR, contextidr_in_use) > > It seems like there is a way to conditionally initialise it to true. Thanks for good point! Will test this way in next spin. Leo 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F742C433EF for ; Thu, 21 Oct 2021 14:38:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DBD12611C7 for ; Thu, 21 Oct 2021 14:38:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DBD12611C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ydUyAyfzaGhEJ3a2tmxzMVEnXp0gp6jv7smxTYoGqWg=; b=yEAoUvsmtfSZtm LSgpg/G5ICyBWfzu9fVhCOcNuPHgYS7Q4NMvIJsAju9yTQE0spwkMFAYhbkhJeo1hbwAuyFvVg5MR U9IMeeSDME1NnOxptyjZZhA7jiGpTmnWYLiICdwI6nXF5dtrR8D2XtTpDkSpXIa8SKpfpejbuQMUD wkH+ykLO/4sxONLncoICAR+2GAoVkRgVLakGZ7Zr9xOF2MHfl3GwiVOssH0tA5o8701MuLYYWbZ6Y UCatLfOwA6sC7vWACxom+1KJHzyGt9nKSoHGgYcM2YlpsyQkYVsQGlEZVdAoC2qMH00G/NmmFFBkU kNJ5nq3K8AXSZtV4nvzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdZCM-007rj3-8A; Thu, 21 Oct 2021 14:37:38 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdZCI-007rhq-V8 for linux-arm-kernel@lists.infradead.org; Thu, 21 Oct 2021 14:37:36 +0000 Received: by mail-pg1-x52a.google.com with SMTP id q187so518563pgq.2 for ; Thu, 21 Oct 2021 07:37:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=hWMulavHguDBRCrVKyFBVx7gMZcaLDBqhj8CvP80Q7E=; b=iAmCvh52C6lmCYBo5ZiN5hHCAu2fAkWo/EasINRykyHBmAETWy8beZzvcus5tEkwRm 7Ljfn0XrTNszaIj6pRrjgqoTow7+xQL2Qqd2li6ADiIk1ZH+53YX4Rrje9ReuzejsKQt WZ5qd6woEpPksRm5JkUKkrpCIpuTDlAtVAIgjBOlULlq2ksuCSswqzryjON+C7/l44Pl ABVgQ0AwVNxXh9ZFicLf4H+a8gTtvOaMIxXM7UFNKbFngZl3mfE/eHHeeRYRFraAgP3k w7fIedfNV4u5amqVkV8ZPpz8vHcKblaYRrLiZENkAqVHEy5qLh5a2/a/L6R9sBdWYWcF j++Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=hWMulavHguDBRCrVKyFBVx7gMZcaLDBqhj8CvP80Q7E=; b=yETfehIBK1whUPx8RUlp9wg7RdjYuPaLmgc7A/yu7PSnoQWVIObH8MoDVMWTPmppzv L9VLR2ofUJG0ZPfNGKgNI+EebVKtE5NIutVB/nxR1IliTRWZ22bTK0vtmKZwxo5/n5n9 oXCKzLKAe+2oUbnSV1rQk0pOrqRcWui9lL77jLFUNT8nWl4rYRfZNLHKg5dFD3NR5yat VwMgOP8w5XGPYbekXpvvlDyKN7qJ1s1Ll9BDJynw3aT6hiHXtPXYBiJXCAnvSWAc9BPN DV8aIIzcpkiSAbJhHYey2qVMJc18+dHnpJ5p0N1YX5LR1Hl7uLZ0JWV1LHMM59BjR2jC wglA== X-Gm-Message-State: AOAM5336GNksaBy7nuWTXsDOCDrKFYaD/d8DDa3W/u1ZP4/wf/jN8E4r Qw23N4rAP8Q+a0vsaCBRFpOpbQ== X-Google-Smtp-Source: ABdhPJyjDdV/DmdDuhG8h5Y8UWuU/WoJYOGcrVrT73FmJenSSbHocJoQBYDDbyDIZYNHHR5dMzTsOA== X-Received: by 2002:a62:6543:0:b0:44c:61a0:555a with SMTP id z64-20020a626543000000b0044c61a0555amr5748532pfb.14.1634827053748; Thu, 21 Oct 2021 07:37:33 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([148.163.172.147]) by smtp.gmail.com with ESMTPSA id z19sm6182867pfj.156.2021.10.21.07.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Oct 2021 07:37:33 -0700 (PDT) Date: Thu, 21 Oct 2021 22:37:26 +0800 From: Leo Yan To: James Clark Cc: Catalin Marinas , Will Deacon , Mark Rutland , Kees Cook , Ard Biesheuvel , Sami Tolvanen , Nicholas Piggin , James Morse , Marc Zyngier , Joey Gouly , Peter Collingbourne , Vincenzo Frascino , "Peter Zijlstra (Intel)" , Stephane Eranian , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [RFCv1 1/4] arm64: Use static key for tracing PID in CONTEXTIDR Message-ID: <20211021143726.GA213960@leoy-ThinkPad-X240s> References: <20211021134530.206216-1-leo.yan@linaro.org> <20211021134530.206216-2-leo.yan@linaro.org> <53962765-53b9-dfdc-a5b2-a3133a924c12@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <53962765-53b9-dfdc-a5b2-a3133a924c12@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211021_073735_020455_4EABC5A5 X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi James, On Thu, Oct 21, 2021 at 03:33:01PM +0100, James Clark wrote: [...] > > +static int __init contextidr_init(void) > > +{ > > + if (IS_ENABLED(CONFIG_PID_IN_CONTEXTIDR)) > > + static_branch_inc(&contextidr_in_use); > > + return 0; > > +} > > +early_initcall(contextidr_init); > > Hi Leo, > > Can you skip this early_initcall() part if you do something like this: > > DECLARE_STATIC_KEY_MAYBE(CONFIG_PID_IN_CONTEXTIDR, contextidr_in_use) > > It seems like there is a way to conditionally initialise it to true. Thanks for good point! Will test this way in next spin. Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel