From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 92C35DF42 for ; Fri, 22 Dec 2023 09:30:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PBSph1q0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="omHPfUkR" From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1703237439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QEyEb4u/8xp+vv+XYt8VRVb3m0bgvQlT7o/+c64PqZU=; b=PBSph1q0PDgmtMStXRc65dh2bpBQtJWWYmSZPunDJHf+6XlZP1TYLnlSpCCQUrJRQIrJjS gH+wj6EPwHEsVL9Sviy4RbmIFfCHiFff7aFClIFnMOnCVKTKEgHIbCGF/pZ5Eq+WkxuDQZ h5uyIRclGDx8GcsBf+SzrRiyyryLL83sI5gJQu69mYaEOixZVm2pJbfIEVjZoLAIdJ1FMR iGxA8A+/wrQAC/JwAIVnJJNLA9xS39bPoLf1PpAjbHAB6of7WRMWRstbmB23ezoJWGyMDV UiTrfyzwoQoqdC4kHMbcRRGtl8AnGClaMXUKaAyyFCLuDv6HjSmX7XE+evP+mA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1703237439; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QEyEb4u/8xp+vv+XYt8VRVb3m0bgvQlT7o/+c64PqZU=; b=omHPfUkRisLufNO/lGu829A3yoMxzYg+fTcPV/L4a/y1gw6KSFGOK/PK+JwugYDGRPURIM tihysJegaPEeSSAw== To: Douglas Anderson , Andrew Morton Cc: Petr Mladek , Li Zhe , Pingfan Liu , Lecopzer Chen , Douglas Anderson , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] watchdog/softlockup: Use printk_cpu_sync_get_irqsave() to serialize reporting In-Reply-To: <20231220131534.2.Ia5906525d440d8e8383cde31b7c61c2aadc8f907@changeid> References: <20231220211640.2023645-1-dianders@chromium.org> <20231220131534.2.Ia5906525d440d8e8383cde31b7c61c2aadc8f907@changeid> Date: Fri, 22 Dec 2023 10:36:37 +0106 Message-ID: <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 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. Hopefully one day we will get to implementing printk contexts [0] [1] so that message blocks can be inserted atomically. > Signed-off-by: Douglas Anderson Reviewed-by: John Ogness [0] https://lore.kernel.org/lkml/1299043680.4208.97.camel@Joe-Laptop [1] https://lore.kernel.org/lkml/b17fc8afc8984fedb852921366190104@AcuMS.aculab.com