Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5948274rwp; Mon, 17 Jul 2023 12:06:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlE20UE1DCoRn6sHo8KRgPPJftdde0EcBSX9roDUgOrTB6Psw1yruzUctsRCWUIynPjN7ygG X-Received: by 2002:a17:90a:294f:b0:25e:8d74:76f3 with SMTP id x15-20020a17090a294f00b0025e8d7476f3mr9895465pjf.29.1689620764402; Mon, 17 Jul 2023 12:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689620764; cv=none; d=google.com; s=arc-20160816; b=cN2fN2c6Xon+FrZUxTSRQvC6BlyqV3Uca2pApp7kOcDH3otjhiWklEQXENEyImQacX i8x3pSXbflZUmwT9GI9AivR2sXD/RDdbtaalebKp2brHd0uULNRbSw1FpImPVt9S+aQr zQBvYrgLcRhWIZpQ4ufbSZwKcB1fbsdiMImAwE6vDtV+Mqvo/yZTuhFxonzf+xPpnyFn 3IZqviSYHcPig+pFFYll7H5RnG/TiNRMc8WPvVnAWKTDlffuu6dvPIDY8Kj6HsHj9ii4 /JQNKRVh/rtli0tabYmkyUelR8ZR1TPtdw3qfvWB6/tOw1rtt27zz89IGK3Czef//rtP 63dQ== 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=Z2YniucVw6EbMQ9gP2/8wgTt74n6RDs6sPX/omncp+E=; fh=2v2BigKX/Pf+C6GEhbQZCWw2KRurWN9Nu+sU6pW3/0Q=; b=qDW/YzRs66JGLlEbRdft99g8DLfi0LnoRVu8OhuVIvT4K0mnUzSqnkmT1hqaWohJRD dZ2FmSEPhe6/oCG+ov1KBWKX8EHH23/TKJ/mjoKmxz6F4UY19l4wpk10aKspxClhK4/j b2clpoTl/YMNfhouSa1quSY96o/Mwq5BkbazWIiCZWyzJR/VGobIWobaMPWI/SkoqcsM dPgpks19MkB42j/ONiUtCB7yFW1XmH/W1MvGezwne0gRnKRiarEZKVnlIXSG06dKNKuR HKq6IBkPwAZ64f/Xu24z4yrycVnuHFKaMtdoDPACgzDQ1Ll5GlBVFDVYauCr7paj4Z3L 9yMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qq7BU6Ch; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lh15-20020a170903290f00b001b88cae209esi262703plb.250.2023.07.17.12.05.34; Mon, 17 Jul 2023 12:06:04 -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=@kernel.org header.s=k20201202 header.b=qq7BU6Ch; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230305AbjGQSgH (ORCPT + 99 others); Mon, 17 Jul 2023 14:36:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229471AbjGQSgG (ORCPT ); Mon, 17 Jul 2023 14:36:06 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77D2194 for ; Mon, 17 Jul 2023 11:36:05 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 139EF611EC for ; Mon, 17 Jul 2023 18:36:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 741BEC433C7; Mon, 17 Jul 2023 18:36:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689618964; bh=9yE12PZ29ftJGWkQSTA0NaFgX48aRCYj4ThbucaU9ic=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qq7BU6ChMsy/ajc3jDBg3X32u8GY/CKhM7Xwa94P9zvmRefEK6JM6D9dioCAITlqG DftQwzSUfZOj2G1xf9EJokEE+Ad9EGHRdO0VmhJcm8FYVPkefNjSyBXwgd4hfC3I57 SaPQKFvdTXeorrf0Xue5P/9h3kIYWPnCGiGIh49/Ko4+aEOwE9ndZUnMkfcz7Oxegd 6eWR74hIaF4tBLEPK1XMGo7deyoc6bNLmcy2N+pFSJeFSmgeZto/YWjfuRv3xmJ3cS eFo03CCLPVxVFUN0c+kANxKNEDROzEMVC6f60LyCUtkEaFgYuZSxDnbn45QSTiLchI gHfv3eOLTXWdA== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 2F6FDCE03F1; Mon, 17 Jul 2023 11:36:04 -0700 (PDT) From: "Paul E. McKenney" To: peterz@infradead.org, jgross@suse.com, vschneid@redhat.com, yury.norov@gmail.com Cc: linux-kernel@vger.kernel.org, imran.f.khan@oracle.com, kernel-team@meta.com, "Paul E . McKenney" Subject: [PATCH csd-lock 1/2] smp: Reduce logging due to dump_stack of CSD waiters Date: Mon, 17 Jul 2023 11:36:01 -0700 Message-Id: <20230717183602.1099773-1-paulmck@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <96818440-a922-4b43-8871-50358e18b523@paulmck-laptop> References: <96818440-a922-4b43-8871-50358e18b523@paulmck-laptop> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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: Imran Khan If a waiter is waiting for CSD lock, its call stack will not change between first and subsequent hang detection for the same CSD lock. Therefore, do dump_stack only for first-time detection for a given waiter. This avoids excessive logging on systems with hundreds of CPUs where repetitive dump_stack from hundreds of CPUs would otherwise flood the console. Signed-off-by: Imran Khan Cc: Peter Zijlstra Cc: Juergen Gross Cc: Valentin Schneider Cc: Yury Norov Signed-off-by: Paul E. McKenney --- kernel/smp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/smp.c b/kernel/smp.c index 385179dae360..1d41a0cb54f1 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -259,7 +259,8 @@ static bool csd_lock_wait_toolong(struct __call_single_data *csd, u64 ts0, u64 * arch_send_call_function_single_ipi(cpu); } } - dump_stack(); + if (firsttime) + dump_stack(); *ts1 = ts2; return false; -- 2.40.1