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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 16B4DC6FA82 for ; Wed, 21 Sep 2022 15:09:25 +0000 (UTC) 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=wseLmYwu3eqGYZtyPjhETbv++WmOHJ51Dec3F3sN5Ck=; b=2b5NXpP/6N1IUd 0c6oesdHnEZS6R/KEPhjohvwiYb9nWjgWdoZ3v4Nd4nm1X5D+nj2Ha9//9MYb9pQMvwJ66kc8dYGd qzVUSDHg79f4hUQYTG+jhOiXvc45uVPnFivUp7n63n+1CVuU+Oo/JwTcK+JuX9SzSyW3BEqTFv2IY kihhXtfiQ3foF8DRvYNXAFFxdzDu5/X3OpypCEqOCRAO+H5085I5KFbbr26n8PnjC3ETwFUKOM1v7 g8107s/khdr7r3lvjPnq+ShcVm81QR9d8gcWAN/sxaQzh/5FmC3NdLfVyrNGAIJvsZex56yfUYxh8 sJTSfmfBUtCrWwwYbQmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob1Kz-00Bi28-5i; Wed, 21 Sep 2022 15:08:33 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ob1Kw-00Bi0j-4Q for linux-arm-kernel@lists.infradead.org; Wed, 21 Sep 2022 15:08:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 83A1ACE1C84; Wed, 21 Sep 2022 15:08:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49BB7C433B5; Wed, 21 Sep 2022 15:08:23 +0000 (UTC) Date: Wed, 21 Sep 2022 16:08:19 +0100 From: Catalin Marinas To: James Clark Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com, mathieu.poirier@linaro.org, mike.leach@linaro.org, leo.yan@linaro.org, broonie@kernel.org, linux-kernel@vger.kernel.org, Will Deacon , Mark Rutland Subject: Re: [PATCH 0/1] arm64: defconfig: Add Coresight as module Message-ID: References: <20220921140535.152627-1-james.clark@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220921140535.152627-1-james.clark@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220921_080830_370867_7409FC16 X-CRM114-Status: GOOD ( 17.88 ) 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 On Wed, Sep 21, 2022 at 03:05:34PM +0100, James Clark wrote: > As suggested by Catalin here's the change to add Coresight to defconfig. > > Unfortunately I don't think we should add CONFIG_CORESIGHT_SOURCE_ETM4X > which builds a few files until [1] is merged because of the overhead > of CONFIG_PID_IN_CONTEXTIDR. > > [1]: https://lore.kernel.org/lkml/20211021134530.206216-1-leo.yan@linaro.org/T/ I thought the overhead wasn't the problem, it's mostly negligible. We can probably save a few more cycles on the __switch_to() path by replacing several isb()s in those functions with a single one just before cpu_switch_to(). IIRC the issue is that unless a process runs in the root pid namespace, the actual pid written to contextidr is meaningless. Now that you reminded me of that thread, I see three options (sorry, not entirely related to the defconfig updates): 1. Remove CONFIG_PID_IN_CONTEXTIDR and corresponding code completely, find other events to correlate the task with the trace. 2. Always on CONFIG_PID_IN_CONTEXTIDR (we might as well remove the Kconfig entry). This would write the root pid namespace value (task_pid_nr()). 3. Similar to (2) but instead write task_pid_nr_ns(). An alternative here is to write -1 if the task is not in the root pid namespace. Strong preference for (1). -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel