From patchwork Mon May 23 14:51:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: andrey.konovalov@linux.dev X-Patchwork-Id: 12859140 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 B35EDC433EF for ; Mon, 23 May 2022 14:53:37 +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=972xzUI+yfQaetj1jopL6Yb1qlB+ZEJsI1lwOCBrQXg=; b=bZCjzIeNeObTig vQesjOnkfTZ8X5EOzBt7MhZC5bDaka3kIvDhQ7zyBJvDkDzTlG1w7Jn27vT+uqRTFZMh0KQDoI1/e XN7mxWpExMEBPwD+Xwt4Oadzb0D69s1mnkuCODyiIusfg8m1o/cHCOnYIPXXEOZOZAP00dGiYaaOE VrxQjPWTr05bCbTOK0hXCc41BUpj65GRtdSTa75Fs5LzHLmEYSxvglQyTY8nHtf4INyQplUpmFLMt G+p4tRUNrJxEOtXYFTNqUOXw3zd1GiGiTTv2+qRAt9Uvw4QRcHHZiLEPV0G99ENrHmHLCi4vpO4rG OiPR1oGb7jd/74mjZgEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt9Pt-004mzc-Cv; Mon, 23 May 2022 14:52:17 +0000 Received: from out0.migadu.com ([94.23.1.103]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt9Pi-004muq-0T for linux-arm-kernel@lists.infradead.org; Mon, 23 May 2022 14:52:07 +0000 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1653317516; 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=PDuBGpkT9ArerlP1XBDcRGRfZ28TAQhMJtn5mwFKc7M=; b=pT6NCGz1IFsXBIrDvwCoik1ZV8eldYrPZNWLkNKH+lo2SU9YYNuxj+hKHhZzXVUuMbNE7n ZF4FDr2WOm/hifRLWsWleJR17juhKvG0QhW1QsaM8mahfr7jYAM/cXWMiE1g2eigcue0lZ MzJ4QmeUBjvLQqZBs4OSwm+Y//LCyxU= From: andrey.konovalov@linux.dev To: Will Deacon , Catalin Marinas Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Vincenzo Frascino , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH v2 2/2] arm64: stacktrace: use non-atomic __set_bit Date: Mon, 23 May 2022 16:51:52 +0200 Message-Id: <23dfa36d1cc91e4a1059945b7834eac22fb9854d.1653317461.git.andreyknvl@google.com> In-Reply-To: References: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220523_075206_235157_7214A285 X-CRM114-Status: GOOD ( 10.76 ) 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: Andrey Konovalov Use the non-atomic version of set_bit() in arch/arm64/kernel/stacktrace.c, as there is no concurrent accesses to frame->prev_type. This speeds up stack trace collection and improves the boot time of Generic KASAN by 2-5%. Suggested-by: Mark Rutland Acked-by: Mark Rutland Signed-off-by: Andrey Konovalov --- arch/arm64/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/stacktrace.c b/arch/arm64/kernel/stacktrace.c index 33e96ae4b15f..03593d451b0a 100644 --- a/arch/arm64/kernel/stacktrace.c +++ b/arch/arm64/kernel/stacktrace.c @@ -103,7 +103,7 @@ static int notrace unwind_frame(struct task_struct *tsk, if (fp <= frame->prev_fp) return -EINVAL; } else { - set_bit(frame->prev_type, frame->stacks_done); + __set_bit(frame->prev_type, frame->stacks_done); } /*