From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6743C07E9D for ; Mon, 26 Sep 2022 07:45:14 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4MbZY46stXz3bkm for ; Mon, 26 Sep 2022 17:45:12 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=mevbU99/; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=2604:1380:4641:c500::1; helo=dfw.source.kernel.org; envelope-from=kvalo@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=mevbU99/; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4MbZXP27fkz2xGS for ; Mon, 26 Sep 2022 17:44:37 +1000 (AEST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CE92360D30; Mon, 26 Sep 2022 07:44:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEC0DC4347C; Mon, 26 Sep 2022 07:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664178272; bh=zBd0nArrnoxpH7BK8G59CVIeT52Rmoc4NPF1f78MmAU=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=mevbU99/eYutUpCn1H9p1DPCf79291EqQRj1MRmDDpWnPEaMJbWCxqmKRWpB5ybmp rpKBvILUtYi4W6N7bI/kUmv6hlXNcML6Xs1ZD/ji012sDLEhQnDSAvdykmM+pNo1Km e5Y4yKJ+bM4AYYMisnkTeDOywfDt3lDHdavQAZeKvGAqWIzx+dokm3kTgGh6UmqnJ6 S7ujFPSP7OUAgWfuuelJvpMPsvNzaHRgUwq0EMN99C04k7RoM0OgViq/rYpTUw9j6R oUOVGx/siC1s4xEZNHjVksSgMnra1sLsRGB8FVIeh0qZeDVPISU6Pufpkx7u4yZfKY PJWIfK90Uud7Q== From: Kalle Valo To: David Hildenbrand Subject: Re: [PATCH v1 1/3] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") References: <20220920122302.99195-1-david@redhat.com> <20220920122302.99195-2-david@redhat.com> <87pmfp8hnj.fsf@kernel.org> Date: Mon, 26 Sep 2022 10:44:23 +0300 In-Reply-To: (David Hildenbrand's message of "Thu, 22 Sep 2022 16:12:05 +0200") Message-ID: <87leq64m20.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lukas Bulwahn , Baoquan He , linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Dave Young , Jonathan Corbet , Nicholas Piggin , linux-kernel@vger.kernel.org, Jani Nikula , linux-mm@kvack.org, David Laight , Dwaipayan Ray , Andy Whitcroft , Joe Perches , Andrew Morton , Linus Torvalds , Ingo Molnar , Vivek Goyal Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" David Hildenbrand writes: >>> +Use WARN_ON_ONCE() rather than WARN() or WARN_ON() >>> +************************************************** >>> + >>> +WARN_ON_ONCE() is generally preferred over WARN() or WARN_ON(), because it >>> +is common for a given warning condition, if it occurs at all, to occur >>> +multiple times. This can fill up and wrap the kernel log, and can even slow >>> +the system enough that the excessive logging turns into its own, additional >>> +problem. >> >> FWIW I have had cases where WARN() messages caused a reboot, maybe >> mention that here? In my case the logging was so excessive that the >> watchdog wasn't updated and in the end the device was forcefully >> rebooted. >> > > That should be covered by the last part, no? What would be your suggestion? I was just thinking that maybe make it more obvious that even WARN_ON() can crash the system, something along these lines: "..., additional problem like stalling the system so much that it causes a reboot." -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches