Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp474207rwb; Tue, 4 Oct 2022 06:39:30 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tYCZk+Bqmc8utom3HzYdt7DCLiJ78KqIDxu9NfYWM6sHQ1ejhBp28r0jVnZ95NGzdQnGN X-Received: by 2002:a17:907:9495:b0:787:84e9:35c3 with SMTP id dm21-20020a170907949500b0078784e935c3mr19599891ejc.701.1664890769618; Tue, 04 Oct 2022 06:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664890769; cv=none; d=google.com; s=arc-20160816; b=A4Ikpela12QEp7EiBAVit9mTpqZiCfgUziUmjMfZzUSLDBv+n6Vm08dzyzlfrU998t g+fBmQwnPFp1R4EkF41GAE5WKmDpYw5RWGqUyGTKj3+mwoqdJ4+Q3WUG7+G48txQMtIW +5MMu9IY5kTZL5o+aPnTX3HBix6OEKHvBd0UD8FwcrXcjBLAzHbwYIVuFRi47xTWYPHn W5Udrp35915klhFZBBROPVoeeKPK4OFTbjmLW1/tPlRoiHPaRkT1vmZ9NhwJJcjvU43B CHYbLyBgFkaIXHYE5YuJ62A2wbFaVGGopqLi1o578fYrvq1aPR52IfUNHJWESKmEcBXL nn0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=ARqzLCUGK9oxipjgV/TP0dhqnyFoncnYQ36iiV2KnPc=; b=dKzhzokp+HFuHt//tmIDcAz7cuRj2/nKrP8JXNwbSP0vjGADEKDasFdJHlFRutODFM +/uRnH+WhKBKQt6BDW3HQZqPaFBwepogLXKIOefD5G8ughJGnnQ0U2df58iytGgYEFZi HVamPIt6i00xG0JI3GAGJErj1lm6/geNz+lrBtO1kVLimykhGil3qDEP9x5TKBa6bQ3I 6Kx49X13LyHQpOXHH8+TouzDkIrQCxIKdMTsXVfzs55RZZkXxfKSWc8CkZ3VP2V2L+yW +p2Thq/6/S8hVTdyVgCeZgRhqlbQ5ZCNwG93dWubJQ4KQUYc47JJvgMuRh0TFSirbUBp nTUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bj3j42Z1; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr42-20020a1709073faa00b0077cc5693fe3si12820347ejc.682.2022.10.04.06.39.04; Tue, 04 Oct 2022 06:39:29 -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=@redhat.com header.s=mimecast20190719 header.b=Bj3j42Z1; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229530AbiJDMc4 (ORCPT + 99 others); Tue, 4 Oct 2022 08:32:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbiJDMcx (ORCPT ); Tue, 4 Oct 2022 08:32:53 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CC578580B1 for ; Tue, 4 Oct 2022 05:32:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664886769; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ARqzLCUGK9oxipjgV/TP0dhqnyFoncnYQ36iiV2KnPc=; b=Bj3j42Z1UFJxAf6YnYiq7NJ3NO9F4UlDsMIq/7WYaWkpoVrynneqQ4mr6cmd8P35wooo+5 YZikVsJClDnsIlB4/Pq/SufLkKeAPtSRu2ZnjjVHRF5aQOrXEaeBt1id4GngKaVoV67Uyk y+uh0YZd8vEipXD3A8r7trk4I9m0sI4= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-386-1jxZrTzxNr6fwaHv_9FWPA-1; Tue, 04 Oct 2022 08:32:48 -0400 X-MC-Unique: 1jxZrTzxNr6fwaHv_9FWPA-1 Received: by mail-wr1-f70.google.com with SMTP id d22-20020adfa356000000b0022e224b21c0so2421393wrb.9 for ; Tue, 04 Oct 2022 05:32:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=ARqzLCUGK9oxipjgV/TP0dhqnyFoncnYQ36iiV2KnPc=; b=7d0oDiOw837yZLRObYHTd0p9UMhSRtwVPnct9Heq2RUlKhA+G6embjRdyKgun79Lhq +C6aify7gsFFHCEmD/qVstYTX2tTGjOXuPdFtUM1ug2DBk4jAJzyZ7/rNqndEgGkO/hW l0krOoV7kCJfCkx9dCJwz+1ix9Jftk8oRewfotIAeGJNsGmZ+YVC2RBKUeS7+ETfBlKi /9zKdMl9J+hSDffHk/5KORimIy9toj8P2RIu72BG3u7K8dudeviuXS6/5RfSO5qkvQ5g zSskP84G4C8a7AIiuB1W+RX2AwkWPZeM62CEJ8PrcChSU0NTIfsu2BSFc6JRqdNyY0qf jyxg== X-Gm-Message-State: ACrzQf0598Bn08fOg8j60ORkrSMZrU+SuXzNIWXgUjx4ET7usHPE0sku HGUKWvEpZRlgQI7/EXXd6pMJk0snlsuiOIhORdoT0RDxkeDgTPIbKplumfnD4oEIfj6Y2HD0Wzg KQRWu88mmvJVTlXbF6wlDe58P X-Received: by 2002:adf:fb84:0:b0:21a:10f2:1661 with SMTP id a4-20020adffb84000000b0021a10f21661mr15777348wrr.2.1664886767406; Tue, 04 Oct 2022 05:32:47 -0700 (PDT) X-Received: by 2002:adf:fb84:0:b0:21a:10f2:1661 with SMTP id a4-20020adffb84000000b0021a10f21661mr15777319wrr.2.1664886767130; Tue, 04 Oct 2022 05:32:47 -0700 (PDT) Received: from ?IPV6:2003:cb:c706:5000:4fff:1dd6:7868:a36? (p200300cbc70650004fff1dd678680a36.dip0.t-ipconnect.de. [2003:cb:c706:5000:4fff:1dd6:7868:a36]) by smtp.gmail.com with ESMTPSA id k5-20020adff5c5000000b0022afbd02c69sm10360655wrp.56.2022.10.04.05.32.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 04 Oct 2022 05:32:46 -0700 (PDT) Message-ID: <31f20ddf-cd41-69b5-2875-2d738b166ae2@redhat.com> Date: Tue, 4 Oct 2022 14:32:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: [PATCH v1 1/3] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") Content-Language: en-US To: Kalle Valo 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 References: <20220920122302.99195-1-david@redhat.com> <20220920122302.99195-2-david@redhat.com> <87pmfp8hnj.fsf@kernel.org> <87leq64m20.fsf@kernel.org> From: David Hildenbrand Organization: Red Hat In-Reply-To: <87leq64m20.fsf@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE 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 On 26.09.22 09:44, Kalle Valo wrote: > 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." Hi Kalle, sorry for the late reply. Jonathan already queued v2 and sent it upstream. I think that's it is already covered by the statement and that the additional example isn't required -- most of us learned the hard way that "excessive logging turns into its own problem" includes all weird kinds of kernel crashes. A panic/reboot due to a watchdog not firing is one such possible outcome. Thanks! -- Thanks, David / dhildenb