From patchwork Mon Jun 13 18:24:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12879884 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 94012C433EF for ; Mon, 13 Jun 2022 18:26:20 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UebVyg0TMiu6gZ4PXFckXWMH3DeB29r8aiedRf+izaU=; b=J3krC9c0tMDQx6 /kuO3Tj92T1q+o1lNQh6TVmKctRxw8a/tKBPGLFPa2owPF6pCjM2h8fbYkvgLR2zA7M7IT24iwGEn b1gPd4Fixc5ROpWwsmo5I7BTNLpFpfEcKy5hFcBHE56efKvs2hB6K1C3b4G7+YsuWWepTta/cYd6a PEpGjcIAyu0zfTxHEw/E+NLp3KpjbOjyw680G7RxvLcQkBI6BCA/rulaZCp561xYhvw3TjPck8AN0 GGvV/u4Dy7/j86jc8WUiU5DtC/NfotS+hkdfN9fHOuW4knmZVhIdh+YKPvWz8cznkv2svBbNFN17X 1AXXo1mYJzkt7vgJdQMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0okZ-0059Yf-M7; Mon, 13 Jun 2022 18:25:19 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0okF-0059RW-Ff for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 18:25:01 +0000 From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1655144693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dbivo31boorExIfiEyWN7RONQm+9Q9+SCeN69csIayY=; b=42ZSg1ksBNk3yj7iwxP9Zc6FSefCcrQn4Umu3Zg42CVcToZn3Yd8mp4SPM+PupQxdEVs8+ tStgmX00WCsKJOepHEjARgrE9f7qvG/ViMJ5XTInWvuSVdPEEXm+EA4IwuXA80JmGs/DcB b+xvroKamgLo2x6O18m1VDgglIvXE06friZ2fkru3mfHm4WVswRk/+xnWfCDkg57D/pih4 JuhbqEQPq39AVj3eatct2qtSdxx3p+pI5SJVu1TVgnFCQayXRC7T/g+uuEIBXjT+1exN17 mxRt6QigK0Z/7TmfL8bL64yGBk7QVtIK5yhFlASCMD2Wcv27LNJiuFd59F7Dwg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1655144693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dbivo31boorExIfiEyWN7RONQm+9Q9+SCeN69csIayY=; b=K6KwCCLZkLuRAPxNtz9vswmaVkeBGeafBo8uJnvsWzDQzBEL+KqibtxnTqrDEJt7XFlYTc L7k/fAs8108S10CQ== To: linux-arm-kernel@lists.infradead.org Cc: Russell King , Arnd Bergmann , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 1/2] arm: Disable jump-label on PREEMPT_RT. Date: Mon, 13 Jun 2022 20:24:46 +0200 Message-Id: <20220613182447.112191-2-bigeasy@linutronix.de> In-Reply-To: <20220613182447.112191-1-bigeasy@linutronix.de> References: <20220613182447.112191-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_112459_745587_39AFE6E3 X-CRM114-Status: GOOD ( 13.14 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Thomas Gleixner jump-labels are used to efficiently switch between two possible code paths. To achieve this, stop_machine() is used to keep the CPU in a known state while the opcode is modified. The usage of stop_machine() here leads to large latency spikes which can be observed on PREEMPT_RT. Jump labels may change the target during runtime and are not restricted to debug or "configuration/ setup" part of a PREEMPT_RT system where high latencies could be defined as acceptable. Disable jump-label support on a PREEMPT_RT system. [bigeasy: Patch description.] Signed-off-by: Thomas Gleixner Signed-off-by: Sebastian Andrzej Siewior --- arch/arm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 7630ba9cb6ccc..2088d9322588e 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -71,7 +71,7 @@ config ARM select HARDIRQS_SW_RESEND select HAVE_ARCH_AUDITSYSCALL if AEABI && !OABI_COMPAT select HAVE_ARCH_BITREVERSE if (CPU_32v7M || CPU_32v7) && !CPU_32v6 - select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU + select HAVE_ARCH_JUMP_LABEL if !XIP_KERNEL && !CPU_ENDIAN_BE32 && MMU && !PREEMPT_RT select HAVE_ARCH_KFENCE if MMU && !XIP_KERNEL select HAVE_ARCH_KGDB if !CPU_ENDIAN_BE32 && MMU select HAVE_ARCH_KASAN if MMU && !XIP_KERNEL From patchwork Mon Jun 13 18:24:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 12879883 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 8E579C43334 for ; Mon, 13 Jun 2022 18:26:07 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I20HlLFLFHcsziJSV7AVQVHk+48nxqBGcxOwjVB1WQI=; b=fYfyONaWBqvaYE Zyic2fsvIM5uf/SRU/qwzlxBtyowaRAOfsKGcDJ0FORARvI6vWH9Q+r04vaYtKrCLYeA17rCxgGPs kyR4jYjl0DTVBUUQZ14or2rUNE4qzX8LgDSkCKVqEML0yLcspcD2qVIYU0fTBzpbl8Tc+u5kc1J0n 0FhylEObU+OZdbKGUdkT6HN+s3G7v1/kWSuVpUsY81DpTlyeg9jA/h4ea8Qxy0TQU5kGX6CIePNp5 FNFhHUuYEMhjwcBnswnhAmd6YP8Jzyf1P3rIipu4kisBq6ESxuLwEiX34FAf/H6llI1dq9IiwOfmI s05ZxGNrhdeX3mBUndIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0okQ-0059W4-7Q; Mon, 13 Jun 2022 18:25:10 +0000 Received: from galois.linutronix.de ([2a0a:51c0:0:12e:550::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o0okF-0059RX-Ff for linux-arm-kernel@lists.infradead.org; Mon, 13 Jun 2022 18:25:00 +0000 From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1655144693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2NGyAb0WcetN7ToLlzxneVtLWt6/hCmdBiRDJ79v73M=; b=d5upP3d8biDVUZU9FrZNYy0otOHDYkgzT56GWXNU9A3mOn8ZhEzB2VYLGrB0utePaRQ4hA M+hboWiTgZ1DpOte3c/UBJ8pmf9DciQWp0pbGKecaiU1gSJXfxS5q+iW4+JR7r9f9AElEa M35rOSaFo4ipmBZBRTSYn+gL+0y1P5PyjyePs68dD6CScopY99t4cbINyWBeuwOdNbDDZF gZq2Xl8Rd/771bQdXO1rOHo6/oUaCYDQ/ERZs/7Mr0Vyiqla5yL7r2AGuWmA2HeMBi2wIj HZBXaVnNiMPlWE8YUgZxvKb6DBYBtmM6bxB1vudRmvmFqXN6ob7JnH1ycq1Vxg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1655144693; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2NGyAb0WcetN7ToLlzxneVtLWt6/hCmdBiRDJ79v73M=; b=41Gd7JFJEtNZooyq6ulqyiz08g2y57lUKst8A8IWZ+lMjrSBXc+8fMzBWri+ZjoWgFbQF8 mppcQ0xf58kXA9CA== To: linux-arm-kernel@lists.infradead.org Cc: Russell King , Arnd Bergmann , Thomas Gleixner , Sebastian Andrzej Siewior Subject: [PATCH 2/2] arm: Disable softirq stacks on PREEMPT_RT. Date: Mon, 13 Jun 2022 20:24:47 +0200 Message-Id: <20220613182447.112191-3-bigeasy@linutronix.de> In-Reply-To: <20220613182447.112191-1-bigeasy@linutronix.de> References: <20220613182447.112191-1-bigeasy@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220613_112459_710184_CEF9D4EF X-CRM114-Status: GOOD ( 11.72 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org PREEMPT_RT preempts softirqs and the current implementation avoids do_softirq_own_stack() and only uses __do_softirq(). Disable the unused softirqs stacks on PREEMPT_RT to safe some memory and ensure that do_softirq_own_stack() is not used which is not expected. Signed-off-by: Sebastian Andrzej Siewior --- arch/arm/kernel/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 5c6f8d11a3ce5..034cb48c9eeb8 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c @@ -70,6 +70,7 @@ static void __init init_irq_stacks(void) } } +#ifndef CONFIG_PREEMPT_RT static void ____do_softirq(void *arg) { __do_softirq(); @@ -80,7 +81,7 @@ void do_softirq_own_stack(void) call_with_stack(____do_softirq, NULL, __this_cpu_read(irq_stack_ptr)); } - +#endif #endif int arch_show_interrupts(struct seq_file *p, int prec)