Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp450966rwb; Mon, 26 Sep 2022 00:47:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6JlVAdKAgTVl6ICpT6sRnW8nnyMzH4apsFQEWY3al3LRTDSDUHgpisUsCc1RdwsZAQfQJY X-Received: by 2002:a17:90a:1617:b0:200:9da5:d0ed with SMTP id n23-20020a17090a161700b002009da5d0edmr23222630pja.90.1664178429660; Mon, 26 Sep 2022 00:47:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664178429; cv=none; d=google.com; s=arc-20160816; b=ji4bG2ZyhQ0R4TQDw8NTypeWFaiUkcUAqc1FBt3sU12ICEI2MrrgreNTC2Ky/rV2Lo vRdiwt3X8/ECw/++QeNxJgiKa3QV2VULQahl9PiEWyOWDgPs/ovHVo9pyMP+Csf4NI1m rbWIjAiOaWCIMNn/5KXeZr0f/290SnvEvWPu7zYkOWb8sEUCwaNia+oZR6zYTOllF5z/ UmWk7tZ+CrZjC5FvRFh1uo0hZ/Q/COGtpCacUwItdZQf9XhQbT1y+0GOYM6bxQx+QFXU BYa8EBTWty90HblXn6Js3COgBH090/axfvx5LBW8PWh+SYnexB2AHU8WI+RTBGH/IQtb c0aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=cekSXfgHQlX/RFiCPP8intIscQpw9kugdFdvueMMnG8=; b=W9qTB4SuxDtNfTcgkAJ1+2AXVxQIcshH7buJQgMI2fb8xHZRlomqNIvysinjN7N62X 2J8Ey54RDaU9aD0EdHlBX9bMCOqrE8NvwFoJZybeprT+euTYZFNxYODmDVmk3FKdds/g OrpdJIMsIdOPKfWZA8sxsAaoyJ16iTAOIhKgiVIEq85d7Ns1v8RVvXwH1hWREmmaU4hm r8xnymbPJ+76M3KA8v0QjfBg/4JpMJwxKsDbaGDBUa5DoCSb6+06TNUCEF9TW9Oq7QqJ SAl5HnU9/lwF6/2PJct8HR+M02CkoPDYUALnXtTNUO5jfRpLVCnODtLlYkc6u4kBQRVi fe7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mevbU99/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j3-20020a170903028300b0016bf8021664si12569443plr.203.2022.09.26.00.46.58; Mon, 26 Sep 2022 00:47:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="mevbU99/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233459AbiIZHpO (ORCPT + 99 others); Mon, 26 Sep 2022 03:45:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234138AbiIZHof (ORCPT ); Mon, 26 Sep 2022 03:44:35 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5570E18; Mon, 26 Sep 2022 00:44:34 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 77D37B80E0E; Mon, 26 Sep 2022 07:44:33 +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 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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