Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp688901pxb; Thu, 21 Oct 2021 07:40:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5+gXHgdJRmyMgW9SJchCIOucqhnOGKMTZ0RVuuVFarC/+Ykwvh8A+lhp4MOT45PrMONFq X-Received: by 2002:a17:90a:bb91:: with SMTP id v17mr7044819pjr.116.1634827231253; Thu, 21 Oct 2021 07:40:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634827231; cv=none; d=google.com; s=arc-20160816; b=SsjeKidaKrpvfP8Uv28fO3AB5YfAfyIVlabY038ElLEemZKRcjopc5I7R5hArB+z8F OHswX+VbpKs8jwpOUK0EjjhsdjhHCnLD4DrVYWQYkr6Y6vEKwn17PI7GUDJiI0FtT2K6 ZGYe70rKL838iZYYVJ7Kc4mvHKhPx5CcZR70jIZ9G1cP1KhelHQmkKi6e4A60M4z+077 WdXuBnusZmYuguN3hOjWHLW2x8UrjZnz9fm/38XljHh1SoCM2feBfr39l2R2e0x7iB+o +cVvrP2BXZn2TmgIo6pIsRZm06868x2mkcM8QOr6rpaNNH/cLw/LoJtLHuf/M1pTTim4 x/8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hWMulavHguDBRCrVKyFBVx7gMZcaLDBqhj8CvP80Q7E=; b=lKTzku5gOF8z+N9IrdCI1WpEhj7FPyh+eFoR36fII6r948jCGsiWdNtYgTRxhijx36 Z4eWSSJmURQfjj9A57coxUUaOzNhmPdtWzC9BLI86snCS3dS2EAWg82YZ4BRKEbUFnXl gKRUopwrCcbCl2fABSy1jH6G4L8jdMFWjnC0LYozB45uqvSsjZaLgqZ/KZjnH/f22S9x DapFsnHq6cyzUI8zeh3U1sjM848aMymt4ifH9Nsy/scUpbHrpiXZblvO90GltLaT9qdM m+dNcF8RqZu7YOIlf2Exyw0OZJQK0rNWQOL+SfUoptO5j9e+J/cklqEn/1Z/ZBbOlu/K Ybzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iAmCvh52; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w2si7134444pgs.469.2021.10.21.07.40.18; Thu, 21 Oct 2021 07:40:31 -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; dkim=pass header.i=@linaro.org header.s=google header.b=iAmCvh52; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231182AbhJUOju (ORCPT + 99 others); Thu, 21 Oct 2021 10:39:50 -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-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