Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp679757rdb; Fri, 22 Dec 2023 01:30:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IGFXtkCstS3Bj9NaproGL0WjIw2EhvsW4UK+k7JyT/MKZcD1D3jxwgq/YZG/EKxpu/PMtrX X-Received: by 2002:a17:90a:4588:b0:28b:eec7:8d34 with SMTP id v8-20020a17090a458800b0028beec78d34mr791957pjg.90.1703237449552; Fri, 22 Dec 2023 01:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703237449; cv=none; d=google.com; s=arc-20160816; b=SC8CqM2iCPZYyh4RsXvMPothx+LRDznXvyvJMF8RU8Jgm53U3FxFsAeIav4L49XwGH 1R5zACLl/6jPrOCLUOOV0nxWFoMgFJG63H01GPoClev6YiSWdvv7vISnncpfa7D/ymB1 37msIyjiIa484o4v5kXH8tk7mTkqIUWa/bGXTHZV0/VYHJTqMjQq1SeEjbTTMEWRqUKE F6fTh1+Nne131qQQkFGJUD2vBqOOHu412g2/ptonPJ8rfQotIexpQTJmBiIU3FrI1F1F ErXk5K4u8KFJp+TT687bw6POzWV+p8zKXm7RbPAy1keGzeAgdD4C0frlLBHvklu1iKzq HIZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=QEyEb4u/8xp+vv+XYt8VRVb3m0bgvQlT7o/+c64PqZU=; fh=wfSJNVaTzrk53dJ2d2V9dp0O9DWNCaTMB/gKf0zu0vE=; b=vPiabDr+QVQulioPdvcHu8Zxy8HJNzgqLy43RI5pDaZk7wUckrYumcn+OqCFZAJGgL IrNeAejJdJoAf9s3fZbkC+CDj2UKdSSu0Es7pTRRQMy9GnBrEQIh8TwHxhMI+w80Dst9 7fzjAijbPMr663t1dyNDKgduofkjJAyoe3NEFvIS0BB/O4sce0az6ODcnw7Ut1At55B6 aXE6l7fowgxAVC+kuF8IHPeL6w6Y7462bxoB+AwesupXnNEYMOHOMf6JEjEPT1SS0lE+ pLRZMKTh/ChqR+EejWcbmqUKsv9I0H2dKJ9kN1krl8jTtxh9l0b7hm6THnGnE/pktUXp LQFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PBSph1q0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=omHPfUkR; spf=pass (google.com: domain of linux-kernel+bounces-9543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id mt10-20020a17090b230a00b0028bcdcb2d0csi4717603pjb.175.2023.12.22.01.30.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 01:30:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=PBSph1q0; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=omHPfUkR; spf=pass (google.com: domain of linux-kernel+bounces-9543-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de 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 10041286F18 for ; Fri, 22 Dec 2023 09:30:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA1F8F9DA; Fri, 22 Dec 2023 09:30:43 +0000 (UTC) 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" X-Original-To: linux-kernel@vger.kernel.org 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 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