Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp1996057ioo; Mon, 23 May 2022 07:52:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTSzT6yldhHUwUX+LKu7EqqBORS5j7gu7LJSOYu2eJml79qaVN/e4gk5uebjHK2NqQrO8H X-Received: by 2002:a17:902:d64d:b0:162:3595:220c with SMTP id y13-20020a170902d64d00b001623595220cmr1635940plh.10.1653317550947; Mon, 23 May 2022 07:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653317550; cv=none; d=google.com; s=arc-20160816; b=S3hpZiUwj1+qMQpEgEG1Toib+BNziSvDYo+P3ZFwqQxrRBHIl2NjqLAE0oPTRqMisQ 891sUA+FPkWXbi7jNA/IM7/h1iiTenJ8DXgohE/67rrPj6zfZ5LWHPsQ/gWo+x6meR6V NPof3acPYX915b/ApeUT4bXZu068PfNqLq/eS9Huoldsp2iu8lLzNHkOPcP2TGCPcHmA IjHd7p0+hR3nqeUsjsnIqVEmMQ55AesZBn+bJlfyQ4CsKr8OvKUdfkzfHfqkUQ0T+zl8 Ru9l/mnDB1kUvXuLA+V5oSAG9WVyjuH7GBWJ5m93LJOcGpHzFnw4cl6+h5vKSsQnjyFi i5Xg== 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=PDuBGpkT9ArerlP1XBDcRGRfZ28TAQhMJtn5mwFKc7M=; b=ycqnu9PNke6X2BvwGDKILEvywlZG+T5OmlmYOf+3LhJWEAssRHcRH4k/h2usi8MsJX Fe/43ZjG/Dq6i15oQ/UiTc4gxzjVlC5JnkckJ0Fj82ijqzBuezz18aKkrO6ajelhy4iS Ws4efN6SP05gObwdP+AiQ2BovT4neZtFI6rauHGUNiRTl43hM0TtRRe4Z33bguVljzo9 GdgSHPA1e69EuCfrXZsvR2H6HE1nc1+Z8BhvZd8RR0at+p3tOQHrzlgFzeh6yaLL5WmF juiYqKVKLGklhLHW/SURy4bQFi/elt13kVqmRlkJMGWDz/NF/HYstByM7K3zz8/Ivl5Q hbLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=pT6NCGz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v9-20020a655c49000000b003ab8efcc84asi10000368pgr.603.2022.05.23.07.52.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 07:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=pT6NCGz1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 28BAD5AED5; Mon, 23 May 2022 07:52:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237342AbiEWOwG (ORCPT + 99 others); Mon, 23 May 2022 10:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237284AbiEWOwB (ORCPT ); Mon, 23 May 2022 10:52:01 -0400 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B2A728E0E for ; Mon, 23 May 2022 07:51:58 -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=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 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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); } /* -- 2.25.1