Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2944332rdb; Tue, 6 Feb 2024 02:30:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHBwjyo8MOEiGQ8AV+vOxIr9KVft5HHoMr1UwR0/zgWhTo8AgdKsP6qH5ln/RogPWy+3Cuu X-Received: by 2002:a17:902:e74e:b0:1d9:5038:f10f with SMTP id p14-20020a170902e74e00b001d95038f10fmr1502500plf.46.1707215414325; Tue, 06 Feb 2024 02:30:14 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707215414; cv=pass; d=google.com; s=arc-20160816; b=NsfitybCd4MEC5N5soUqB38TMfDRKA0WzYUAaoxhZYkcQGWqi0T+a8QuwxbBFWOxnt VqTJwKKYrLA3ZO0yoSGerc0IA2IFR7ypG6Q5Rk5fCeQOL0R1IDvxwGjW0pFpRfYmoqBM JtjbpGws3uONIVf8ZwCT2WLfk1vhtiaXAHkUlz1e+OZroylWvnNoXOYI8Kv+8zk7ZS+U T5dnBjX3h5n53BsbFMqy683lJR8MpKbeHa23oq8fHLi7bPY5YvfyS2Z52mE41wplKOpg ffAhsckGZ9zNGPGAmGD8rkkymU7t38u2I2BfnQPRcKMBa8HgoObyDJg0H7u48wbJ1h88 DJJA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ddGPB+LLLc9/aN93b+elzzc4F9rC5w8WyII5OFv7+Lg=; fh=aMjc/BOOUtXTQsq5NqmWCLwSo1b8WgJ6A90THYXdps8=; b=I/I865QnBeaZW86H1DVupyVtb6LIBMLjfhqn/bHKY+dZ8VL2CvWYFazdJkU1Ir7+zs KkI2HzC/TRBqD45yGoyOzOLAveb4P3Ud0XJqOx00PNDzyLClLjq9YDXQrMXzfWV3Oa9F t0Qq4uysJOFTlsuIkEH3xmF6Ma1+t6mveFESdoAedvB+oSczBRFDNFjS+K7DPGWZmXLP Z52XW+G40oIJuOLQA5fXO9dXmQ6NvZYj19p54/PVkVZXJ50aOwlenMbMLsTe5dw2AQTa 5jWFZUQACtI8xKoRoBLHzR0wHmrIhPsAnmaYn21gqjwWTffdIptzzSdudpxhb3CZrPrt iJeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=CIwIaf1l; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-54682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com X-Forwarded-Encrypted: i=1; AJvYcCUN6TWSW4ei8Yt2Do8KWmaNMKTtSVg46ogDdMz5hD9k9kMGey5NRhRJDgd9iaGWmJOVSkTpEYvnSDCQ+RSxWDW25dBItoQSnoa+yhypOQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 10-20020a170902c20a00b001d94e5cfba6si1426861pll.370.2024.02.06.02.30.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:30:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=google header.b=CIwIaf1l; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-54682-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 45A9B28C990 for ; Tue, 6 Feb 2024 10:21:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5637012D777; Tue, 6 Feb 2024 10:21:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b="CIwIaf1l" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31EE812E1D8 for ; Tue, 6 Feb 2024 10:21:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707214872; cv=none; b=gtH/2V/n81W18A5KMNwhehD6niG8rAHhowrq1nNiJG6Kid1ORA5ge3J/Bwhy/Fa8CybXKxdIVYrbEINE/KTAr4DtEKZCZy2egXPf+IrSCIQJolph+mvMmjuXWUFxF4+Igz6nlDjw+DkwZlPuhRQiD7Li/TCqa5O/udyCouSYVhU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707214872; c=relaxed/simple; bh=zkrm7vWjb5TlNLl6ut2ZcpSsrkfaKSqBjDIajS6sOaM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Fcfd/IbUw9zUWqd/iKmvrVgJGdV5+IEfTfpfIHUNs3+kKxFlA6hJYweE56cstTlFBYBQXLtPU+0XF+g6anQOp6mY4aeuLivLYMHmVE8HJEqj+kG3fEX7j9NUlwSmT1D4AQHlWjT0jMuvkvOpxqwMaWLaAbGISateBHpCsjVkro0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=CIwIaf1l; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-511616b73ddso65615e87.0 for ; Tue, 06 Feb 2024 02:21:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1707214868; x=1707819668; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ddGPB+LLLc9/aN93b+elzzc4F9rC5w8WyII5OFv7+Lg=; b=CIwIaf1lQrjXkybR4tulB22dRdpnhmjkUhxyPYr/ySIq7xMIFE3bYnXAAY+gaJ3mv7 ornldEa0tEs2PTHqXEco+mggxPZBhM7FXwhqc9Bb5JJ0peJCPzBKZWOeevQ5sA2Lw3IT hQhjzuHxVcC71e8XRcu+ewgUI9EE3GNYriJFUPiovxPGNjNR6Sp3bdjrLeghwF72Rctp rp1OYC+GsYxpVEySUnOoM6AJ5wTPOS71sdT5aD6AFGIKuOn9v4eTF8TGsfCB9bgBMZvE o/9SCPkkk7TnMp5cFS6Z8XemE6iUB554N8fe8h7mK5BKzU6YKN7Apj9rDxBemSH5aa8r izhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707214868; x=1707819668; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ddGPB+LLLc9/aN93b+elzzc4F9rC5w8WyII5OFv7+Lg=; b=jwMpWzMdCes+5YIzwrIVVshtOQIdox2h0XT+t/hMBLsvsMDoLl0FL9BKnBywKW95dI Xu6VZt8WVwlmlHRDaW8mBFrdkchyhDRE2gwJzZSye/tXZVVFj7P0Uaeeti6q7swtf+t+ FXBN0byb0QAiFdiCZFKQa+ZQgq86bAKUGmsGccT+m/uFCA39l5TptEVfDT2y3k5dBCZB ESHgXeTll1yDFgCYYvaMO7eqmq5NS8oAnFEOF639d7FkzyKLnpcFR21ukRKtBqMyUYVs yQosSLDw3XaxwJwdXlrfPZTUpC4JdKGJXTP/SaMDymZFjh+VjDIjUS9DB8YvU4UY24Es L5Yw== X-Gm-Message-State: AOJu0YzdPTOa2zNw8bqTyNWerh6Qx8Fym/wBvnbfsFPX/CoGd5AoIV0L Vv6eFAhSAjdH94kR2VOgtCAGrSTvXG5C9k4ADF0sNbFsUfqlV1Wc/v9ZJzlUhOM= X-Received: by 2002:a05:6512:2091:b0:511:46f4:619b with SMTP id t17-20020a056512209100b0051146f4619bmr1258782lfr.22.1707214868107; Tue, 06 Feb 2024 02:21:08 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVLKKcBDpGTIyPEMV1ib/i/xPTMMLGy/Pf36OYW6TEme9I66HSsHPN+8TGGODltNTpe7AW/G+TyiSMxMeXjnpdpRcgsG71bcCzDt0lKnw5ewjZKMV105goPJyJgYJagK7DS3Rpf6DgvDLgujEeZ49e6JlR0PfrxnP1g9+0LSlXNr9reklxyEW6XYCiLLpjPCkbJItNQWjzF/UrhLjCBXjYoAq2mepouPdmNH47/log3+F8= Received: from alley ([176.114.240.50]) by smtp.gmail.com with ESMTPSA id sn24-20020a170906629800b00a38382c34c9sm333674ejc.120.2024.02.06.02.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:21:07 -0800 (PST) Date: Tue, 6 Feb 2024 11:21:06 +0100 From: Petr Mladek To: John Ogness Cc: Douglas Anderson , Andrew Morton , Li Zhe , Pingfan Liu , Lecopzer Chen , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] watchdog/softlockup: Use printk_cpu_sync_get_irqsave() to serialize reporting Message-ID: References: <20231220211640.2023645-1-dianders@chromium.org> <20231220131534.2.Ia5906525d440d8e8383cde31b7c61c2aadc8f907@changeid> <87le9mk2iq.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87le9mk2iq.fsf@jogness.linutronix.de> On Fri 2023-12-22 10:36:37, John Ogness wrote: > On 2023-12-20, Douglas Anderson wrote: > > Instead of introducing a spinlock, use printk_cpu_sync_get_irqsave() > > and printk_cpu_sync_put_irqrestore() to serialize softlockup > > reporting. Alone this doesn't have any real advantage over the > > spinlock, but this will allow us to use the same function in a future > > change to also serialize hardlockup crawls. > > Thanks for this change. For me, this is the preferred workaround to > best-effort serialize a particular type of output. I agree. The good thing is that dump_stack_lvl() and nmi_cpu_backtrace() use this lock on its known. Also nmi_trigger_cpumask_backtrace() prevents parallel calls. It means that the particular backtraces should be serialized for most callers. > Hopefully one day we > will get to implementing printk contexts [0] [1] so that message blocks > can be inserted atomically. I didn't think about this possibility. You are right. It might be even better than the printk_cpu_sync_put_irqrestore() because it allows passing the lock to a higher priority context and supports timeout. Best Regards, Petr