Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1448694ioo; Sun, 22 May 2022 15:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVQhO5ehQj/OTNYz0HnCHW5XdigGBnk9CKGX3nYI3fopnOzTabFdKljGoyBTmqYacJ2Mim X-Received: by 2002:a50:ef09:0:b0:42a:a617:9cdb with SMTP id m9-20020a50ef09000000b0042aa6179cdbmr21242673eds.188.1653257092893; Sun, 22 May 2022 15:04:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653257092; cv=none; d=google.com; s=arc-20160816; b=afvEB6P741iwVTGXGh0M6zQRQZcl5Q4ZfVCPFsW+/dxaZjbaK02NBtZpEBOLuZb52y pCRw1zco+NxDYvTvPvXuWp0XdLOZdAiSNT2yKSR56mWPi0K8qVTJW5iHWDPEjuqP3XF7 2UG7Hey+8qNj5Cn+eXnGFpbMeKIquqejRXjXoB9O4dhTtkBZL8YzHNJTijZaIkIfNr9E JHbC3SrabjVR7JROdnAevpZKTS/dh/mx0cTV1SKDc5a2/UxFIi4QkeBe7x1V6WZEzvr3 HXQL+s64DsMFrCfLz/r6uYz3BHl+X/Y8NtiWdbAG7KG8De6pIzKTS9DEdspZm0oNvUEF URyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=117xuqHBOdhuOAsmwIJGI3P4mj0w/efp2m2gROWKZlA=; b=h9ZKTQV+5S9kZvT3s2WRchSxv8nTPbqlbrnGDDyAcFewX9vtS/MmsK5nxOw9rVDlyV VovLUseeZyRHkifXEn4yCGfr8l4oXQkeCr0s0lGzhGieneKEnSbt2MFb/zthODk7ptW8 ab9HljHHteX8kK8dIRsjOb6nxn+H36FuExHJEiJ26hPPHPx9w0s7CvHhK0iElcAo3CjE c7IdlBPql1gMI6ubM4pzJ1IR9f+5FFDK4x2JsV4qk5wDf4QPB6WiUpoki8e8aC3C7+dC ghIA8yPJI2JSW1RN6s0/S6UjjxvkkWedAgvpG9VtoYgh7zOtg9HmsEWq6QIDatHdjc2l dPYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Jh+koRmI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020a1709062d4100b006f3ad555460si12296098eji.652.2022.05.22.15.04.26; Sun, 22 May 2022 15:04:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Jh+koRmI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347474AbiEUXvP (ORCPT + 99 others); Sat, 21 May 2022 19:51:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345028AbiEUXvI (ORCPT ); Sat, 21 May 2022 19:51:08 -0400 Received: from out2.migadu.com (out2.migadu.com [IPv6:2001:41d0:2:aacc::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD9B23150 for ; Sat, 21 May 2022 16:51:04 -0700 (PDT) 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=1653177063; 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=117xuqHBOdhuOAsmwIJGI3P4mj0w/efp2m2gROWKZlA=; b=Jh+koRmI//BLkM/hoAgYAhNGC+0gspnLZjPA6+o3fL6M9HcD5jkU1bZ7PVoI39soZ+y8O1 QkoCAhHSilcjE+5A0ZtPA5RLcfrm853gS8dUZhguqQcYgPVaLa8qHG7yalDGxTAwXmDJsA jOioYqPpMqRFbKhcfQYOuEc9y71UGVs= From: andrey.konovalov@linux.dev To: Mark Rutland Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Catalin Marinas , Vincenzo Frascino , Will Deacon , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH 2/2] arm64: stacktrace: use non-atomic __set_bit Date: Sun, 22 May 2022 01:50:59 +0200 Message-Id: In-Reply-To: <697e015e22ea78b021c2546f390ad5d773f3af86.1653177005.git.andreyknvl@google.com> References: <697e015e22ea78b021c2546f390ad5d773f3af86.1653177005.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 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); } /* -- 2.25.1