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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F9F3C07E9D for ; Mon, 26 Sep 2022 07:44:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9961900011; Mon, 26 Sep 2022 03:44:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2198900002; Mon, 26 Sep 2022 03:44:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BEA76900011; Mon, 26 Sep 2022 03:44:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A85FE900002 for ; Mon, 26 Sep 2022 03:44:35 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 7DCE716045E for ; Mon, 26 Sep 2022 07:44:35 +0000 (UTC) X-FDA: 79953449310.07.B90E924 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf18.hostedemail.com (Postfix) with ESMTP id 0728A1C000A for ; Mon, 26 Sep 2022 07:44:33 +0000 (UTC) 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 Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Linus Torvalds , Andrew Morton , Ingo Molnar , David Laight , Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Baoquan He , Vivek Goyal , Dave Young , Jani Nikula , Michael Ellerman , Nicholas Piggin , Christophe Leroy 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1664178274; a=rsa-sha256; cv=none; b=XqKFmPf5xIiwdIKDtXLxOtzm+8P31rsvYeWCaY93kdx5YSRnVVF+agWsqs2AGNMu+4AaYH 4NjQYFNiiaRvT/HrOgJW36lUBeRY3Db6C5hbQSvOBlFqBVCGJMWbaoi/lzYQMWzPEgjTra vpt4JNX7HlC0+oCK5mp8gBJiQ6TSjWA= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="mevbU99/"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of kvalo@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kvalo@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1664178274; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=cekSXfgHQlX/RFiCPP8intIscQpw9kugdFdvueMMnG8=; b=OkyNP1R47p51ztFGPNj0guBHdqi9FjzzT6NTHZrfdTHZSDSGhoPLgbsICGvz79tqe3vfNa M6uap7UZeQmi7MYBdawrdQEhvZT5oudNz7v8uPPhSA8yeDuAQc06cnLBtjHRhsjWJw6ze7 rEj1PLHphh1yPv5gKSkMTD65p2eS7gQ= Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b="mevbU99/"; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf18.hostedemail.com: domain of kvalo@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=kvalo@kernel.org X-Rspam-User: X-Stat-Signature: weikkwafzzz8475enr7dgadotx4jgbch X-Rspamd-Queue-Id: 0728A1C000A X-Rspamd-Server: rspam09 X-HE-Tag: 1664178273-263970 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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