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 10565C6FA69 for ; Mon, 29 Aug 2022 17:19:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4A900940008; Mon, 29 Aug 2022 13:19:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 456BB940007; Mon, 29 Aug 2022 13:19:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3466C940008; Mon, 29 Aug 2022 13:19:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 25D2C940007 for ; Mon, 29 Aug 2022 13:19:56 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 03C75160B2A for ; Mon, 29 Aug 2022 17:19:55 +0000 (UTC) X-FDA: 79853292792.05.7AFD4BF Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by imf12.hostedemail.com (Postfix) with ESMTP id A7E774003E for ; Mon, 29 Aug 2022 17:19:55 +0000 (UTC) Received: by mail-ed1-f52.google.com with SMTP id e18so3500221edj.3 for ; Mon, 29 Aug 2022 10:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=gXzsOE1CShzICjrF5qGy2ierXGFwu1QBu0gbN37zalE=; b=Ut/Yn1l3ZfKq3kllusnwCW49U1+1e9wmphOxJZL9GkGYiMI92RHLiKlBhN3oEZvanI 7JYgCGOtlhsspYwQS7VYStSwZpo7WvkVcklDEeY8RpOVreWefdxEoXKv29L7rmxzpHKR /hWDL1eQgn7kgPaex1M/knUHaYiw/VvWxr2uY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=gXzsOE1CShzICjrF5qGy2ierXGFwu1QBu0gbN37zalE=; b=V7R6MpnwHcoQazRrvzr0Zjhc1jJViKLecxArIvMCR2fKpZrA9jpCvExIoChm/tqQbg EdFS2lkD11bT1Hds0J3bob+nNa7nPe0S1g7tivnf+CUeRBDS79Kv9yVt9KAHMbseoXHR XUmCLmoy89gNs2ZRrtS+peFyNFkrnS8en7n3FLuI8MW9zONsmuCBOxGQN8tZ1j5vKkEY 9B8CgoyOcDkdNs+g0Q5db+rqf55kRIqpaDVo1kh3jiuqUxb+QwKvilmp9dYBZhoplpip vWoBPaGhn1tLGLQg5v9QcEDvRCgTNbj8I/fmy9ID3AZQpWOjEQqmZ3gbkZneBjpsUUia s5hw== X-Gm-Message-State: ACgBeo0C5DZ/E0wxdlg7y5wIryG54mX8oKZubssu/3avhha+df0XdjpN L9H2Leped0HH6XFW9nf5JUqg/+JMSVhFYgvl X-Google-Smtp-Source: AA6agR5eIc0MVWt8njGvMTAZo4FLPLx+06vZ6girD23JIEUN+HnLRncJm/WV14kuLExH2mWHZPCgoQ== X-Received: by 2002:a05:6402:530c:b0:43b:c6bf:a496 with SMTP id eo12-20020a056402530c00b0043bc6bfa496mr136704edb.282.1661793593948; Mon, 29 Aug 2022 10:19:53 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id l1-20020a1709063d2100b0072f1d8e7301sm4708794ejf.66.2022.08.29.10.19.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Aug 2022 10:19:53 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id j26so4587551wms.0 for ; Mon, 29 Aug 2022 10:19:53 -0700 (PDT) X-Received: by 2002:a05:600c:657:b0:3a5:e4e6:ee24 with SMTP id p23-20020a05600c065700b003a5e4e6ee24mr7189742wmm.68.1661793592665; Mon, 29 Aug 2022 10:19:52 -0700 (PDT) MIME-Version: 1.0 References: <20220824163100.224449-1-david@redhat.com> <20220824163100.224449-2-david@redhat.com> <0db131cf-013e-6f0e-c90b-5c1e840d869c@nvidia.com> <29fb251b-4622-4eb6-538d-bab6ac6a76f6@nvidia.com> In-Reply-To: <29fb251b-4622-4eb6-538d-bab6ac6a76f6@nvidia.com> From: Linus Torvalds Date: Mon, 29 Aug 2022 10:19:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC 1/2] coding-style.rst: document BUG() and WARN() rules ("do not crash the kernel") To: John Hubbard Cc: Dave Young , David Hildenbrand , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, kexec@lists.infradead.org, Andrew Morton , Ingo Molnar , David Laight , Jonathan Corbet , Andy Whitcroft , Joe Perches , Dwaipayan Ray , Lukas Bulwahn , Baoquan He , Vivek Goyal , Stephen Johnston , Prarit Bhargava Content-Type: text/plain; charset="UTF-8" ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b="Ut/Yn1l3"; spf=pass (imf12.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.52 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661793595; 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=gXzsOE1CShzICjrF5qGy2ierXGFwu1QBu0gbN37zalE=; b=D5XiqqEXCCcGQ7wamWV7x4sZf6nDeEUL8/RSAK92JI7LnVMT6SouZLiMChx2SBWye761Gt ENM+8uX795emhlS0jNqY7chBORPy09Wqu3/tSHVoOHo9U3UW5Y1UJ6Ot3l93k7+OJEiVLu npf+BCPWeoPyGRow7IFngn+rP1At76M= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661793595; a=rsa-sha256; cv=none; b=B5Qa81M6hoMY2OkJKyqB9OR/T9wLncX3x2pgcpPbBpC+p8o+6zmGa0w2TC36mwS09LYqc5 v5nRWDWQ+Jy6JiS8tkg2JTpyTusUb5A85eCbTwCx6IEnFLAmP+0LsIhV95wACHKE7DBvTc EvZyoW1R7dwbnPCocxywx74uB5qKtYs= X-Stat-Signature: 96fr9reu5btqdiiemrtb7ywpjqsj4ffm X-Rspamd-Queue-Id: A7E774003E Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b="Ut/Yn1l3"; spf=pass (imf12.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.52 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1661793595-236671 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: On Sun, Aug 28, 2022 at 9:49 PM John Hubbard wrote: > > ...here. I count ~1000 calls to panic() in today's kernel, to a > function in kernel/panic.c that shows no hint of being removed, nor > even deprecated. Heh. I guess we never finished the panic() removal. It's been decades, I suspect we ended up deciding that the bootup failures might as well continue to panic. Anyway, please don't use it. It's one of those things that should never ever trigger, and mainly for something like "oops, I ran out of memory during boot" etc. Oh, I'm sure it's crept into other places too, but that doesn't make it ok. Linus