Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp354442rwb; Thu, 22 Sep 2022 19:44:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Z3hyuR2f/vVCliBWkU/8RPacP56+WuCDd0Kc1qL6BzI7AbqcxAr+p1HIxJGblIpU+Ek0t X-Received: by 2002:a05:6402:538f:b0:444:c17b:1665 with SMTP id ew15-20020a056402538f00b00444c17b1665mr6280022edb.98.1663901059667; Thu, 22 Sep 2022 19:44:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1663901059; cv=pass; d=google.com; s=arc-20160816; b=mjaEYx0NKbhKSq+A3TtDod8zLFXb6l4zL0weys0lK2EGIX4F0sYpH0qvDjJy3su9/w H7snmaDDQ48MKauQkF9ATG6VkMrkN6i62FF2kAmX/0UZpF+NpiLkx2JYkVFN3TsCTa3d 0FqmY+B1pyb5eNtWHeuFiWChP96hzZ5Yegf7y4umsHPSvqJqfytwj0uicpK8RTslzqfu TfWsfRPlynd/KIqZSRWwYRk4O6yOhsQEL2UytAlAioepyUaEk2/BFoQ5JmlSfFBggAmr YIRLetJRXnAaqh+oQ16VZQPmmVHkDx41+z6/oQj2KVNhFcWnLf1O143q9ZvvQKLejXhN AuGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=N8iioLFs6B92++I0DhPs9LAeQLfXw03cABUKMTkRccE=; b=mnBD9v0mI/rQ8DL7N4xFyUFqBGsX7aMCXtQByGXxvbed2guUlOK0rYIOG4dnRkczVb y/O2uHwq3+DPEObhhhio+KRSKWZhQAyjBDmO9ZwjPDuWii5ua3Jm1yiCvbeySeFvN99W m2zcbWtsltszNcSgjpGpKmPbF6vLKODHC98P19m0kPpyqxdDJjDxHOU06r/QMa5ZS/J0 khnHKHlntppJ1WrFmUkNELz1ptxJOiqOCiNzGSsBbbPNg3+uuxdRvCLB3S7pbffPHvO3 oY7n3VsvSesZGGOT5T/gLF6ZSLxb4qi3y/G5sugEiUUGVddFpgIvqPbFu7acZGSXbYZm lp3g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=DHqAZ4CP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm10-20020a170907948a00b007700c3ad033si6951772ejc.565.2022.09.22.19.43.47; Thu, 22 Sep 2022 19:44:19 -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=@Nvidia.com header.s=selector2 header.b=DHqAZ4CP; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230211AbiIWCVL (ORCPT + 99 others); Thu, 22 Sep 2022 22:21:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229779AbiIWCVI (ORCPT ); Thu, 22 Sep 2022 22:21:08 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2068.outbound.protection.outlook.com [40.107.244.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 576621181CA; Thu, 22 Sep 2022 19:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SDYOz74rPWZLbwKe57CRQ6O/66rwXEVfrtWsgqWM83toDZg+fYTHG/YmAHhto6zNYT2zppJEGJEbPJxXkkO0+lR/6VsXO+6crux9w5WK80nGjXFZnjLXCypkEGNZbViYHw2awWNxUVjrtTwMnFZE5RSB2vX4m72/29ksmJYZvfLLLDHqLgF9Q1pfn7aLk8N/qJYTjTltXHv9Hu9UoeP1NNd4PbcssU3voaTtH2t1zAyeHo2BDer8HWMK3RGtbU+Zt8YesfMexN0B10OJvhP3/sZ2THB6g4tiaF7OheYbwdY/V4gJx/DUmR2tN1yAlXLlWwR7SX+NFisMi3pGyedENQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=N8iioLFs6B92++I0DhPs9LAeQLfXw03cABUKMTkRccE=; b=hJbaKrg6keBmq1ubA++mAzzB6BUb6aqZwNOldfl/gNFX2rv3X9q5a8thB5B5yP81dzzpKIiv9xmL5PNNA0ybMWYOq8E3l8sSxRdGIDNmElu3Hvu3Uf8D5EmPliucCRggTtZVlUt8EWixr3sk8ZNW0QhhqQE1vtwriZCNd3Fo7LQV9TSeYz672X72Ab2y+Qb0Njju1Ct+jVF91hjwBXp/nDwqRiqEojRPdi8x42JFYMobhsfftdrVAwownqq1uB0gX7/Ws4hVUhwXLGO++6GmyAKUeYixhVYC5akjR5WlLTZUgzWm237iIQb9I0bZ+SbqjImtT/Vb5uVBRS6xydJdtw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N8iioLFs6B92++I0DhPs9LAeQLfXw03cABUKMTkRccE=; b=DHqAZ4CPhMaA2lRIukd9d/+LgMrKHOtEa2HsoBvbqsnmJB0QDMCekfRAOb2eqMMme8Oei4W7PE67rBM9oVKoKzMY0ZRlgpqpTvy4lO67kKlQbh+XbBrkYN1K3tj+0ILtypTp4y4X96eYCQG1Mubkiy9MiR25d2iT4QGyWzAMz3wYlI9AIqm+GSrZ5gaeTVYhfzHdWI8fWHuRreBd71SynHys7EuSl3tW2USbESc5V4Jmb3cSIaAGJ/kNf3LLwVllZK9gKwCTs5iYU0w5o6zVPMtZgAu+ccHmqxSOBHDviQ1drgdUl266lBVap3XL+z4iNZzzNoZ0VzCnwzrtvBfAYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from DM6PR12MB4140.namprd12.prod.outlook.com (2603:10b6:5:221::13) by BL1PR12MB5898.namprd12.prod.outlook.com (2603:10b6:208:396::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.18; Fri, 23 Sep 2022 02:20:59 +0000 Received: from DM6PR12MB4140.namprd12.prod.outlook.com ([fe80::e0c5:bb15:a743:7ddb]) by DM6PR12MB4140.namprd12.prod.outlook.com ([fe80::e0c5:bb15:a743:7ddb%3]) with mapi id 15.20.5654.020; Fri, 23 Sep 2022 02:20:59 +0000 Message-ID: <60fa5b16-021e-1e54-7e06-39bbb871eaef@nvidia.com> Date: Thu, 22 Sep 2022 19:20:56 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 3/3] checkpatch: warn on usage of VM_BUG_ON() and other BUG variants Content-Language: en-US To: Joe Perches , David Hildenbrand , linux-kernel@vger.kernel.org Cc: 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 , 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-4-david@redhat.com> <3179f4545d3f71358da3e6c6ee18085af601b2eb.camel@perches.com> From: John Hubbard In-Reply-To: <3179f4545d3f71358da3e6c6ee18085af601b2eb.camel@perches.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR07CA0036.namprd07.prod.outlook.com (2603:10b6:a02:bc::49) To DM6PR12MB4140.namprd12.prod.outlook.com (2603:10b6:5:221::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6PR12MB4140:EE_|BL1PR12MB5898:EE_ X-MS-Office365-Filtering-Correlation-Id: 656eeae4-ef55-4292-2707-08da9d0a4129 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +xOLqGb4p1VKLVTGD21TQU6Bq4wNvaw4KTI8gOG7l/Yk+5wb4bhGu2dQEJe8aLIskop+JDzu9hah49vXnmifCpYebnaQOmrX7XQ2TKYM6b7VIrdVleSjm73BgbARqkwcDyjMTKVWkv3SKgPGuqaak+fAX+0XjvrjqPuxDGJqcKU6gj8Dz1kaGkwoKoaZbfGyka0PZmbsD2jcYJ1oNEw41q208pUvyqSf4WGMXJNh0n2K6t6/trc1So8EyFX+1Me3HCwOFb5shboaFWlEDCyekkpb1QepGOwLgiF9uvp26I9nF0I3dUri0UX5jBZlZc0TAjSUMND15/ZlXdXFdA3VxNaBEEWAZtIwD8iI0qnlk0ubhSrgJ0SKbshipKC3hkl3abqNhnhvfboJ2vNb9WIqjJ4adBfaYi3NSLaeHXox39oriE6FFtxHEDur4CycqqGz28Noq2egnQWik5KRrMG+f96eoREbiDyVShDJgbBdii9uDWFAFtXvQbqRYF5VwEoiaasYv2kC8hTUheUreA77L8q6rwayTKICzjAQenuoofBellX6riUAMeSfDqv1N4U8ApbLXa1z9S/Gy5Y+QvpDzuzrG5pR+WPoeLxdGBEydlrHXixWStj0DtpJRIFXSB0Nd2uSlg5JEChQm4SmvAeYh/pasIIL9ZT4BoRfv05Pu0WiXLIQ8PvqbxiJBE3UiNns/q9gF0B5VSQIptS4AQ4+vgt1Ro8Ystuicgq9+M+dJfbWT+n3GQJayw0FtARcNnajTV/xpSoNtDincQosTrbbUlbc3vvhs53OiJRsb677F5Y= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4140.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(346002)(39860400002)(136003)(366004)(396003)(376002)(451199015)(6506007)(26005)(53546011)(6666004)(6486002)(41300700001)(6512007)(478600001)(2616005)(83380400001)(186003)(5660300002)(2906002)(7416002)(316002)(110136005)(8936002)(54906003)(66946007)(4326008)(8676002)(66476007)(66556008)(66899012)(38100700002)(31686004)(86362001)(31696002)(36756003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RnNPaGtGSjhjQ1d3VGlhNjVkVVRsQU96Rm4rc295eTJ4dFRyOUZYRlExTjBi?= =?utf-8?B?T2hNQlRObXVQZFhtNlBFckVXQXVFNDR1TURld010Wm96YU1ad1lEa2tjRjds?= =?utf-8?B?ODNObHM3NlJXZEt4K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B?eVpTT1cvdTNZcFdZMC9TK0tuL1Z2eGlEU01VSUZrUHFpTGtBMjFsdjlwZXp5?= =?utf-8?B?anN1eTV3d0RVamp2OTU5YzNiem5YUHQ3YzdLYmxDdzFWc3Z2TWRyZDZESmx0?= =?utf-8?B?YlJ2MlFRbFQzVnR0ZUFQQ1A3cUppd3U2SnRlRVdEUVRURWhYYTdkYU40eWpC?= =?utf-8?Q?wl5QOo/fHbq7/Qgzz577BLjMy?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 656eeae4-ef55-4292-2707-08da9d0a4129 X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4140.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2022 02:20:59.6670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 4Te6oJrffCtnTSwx97hzHDtGYOfEYDQxNqnZIZglKsfH5kYBcYqvW7K3yniZbDdSQohZYqLnINEda3LKPdJJUw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5898 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,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 9/22/22 19:11, Joe Perches wrote: >> Should this be a separate patch? Adding a bunch of exceptions to the BUG() rules is >> a separate and distinct thing from adding VM_BUG_ON() and other *BUG*() variants to >> the mix. > > Not in my opinion. OK, then. :) > >>> my $msg_level = \&WARN; >>> $msg_level = \&CHK if ($file); >>> &{$msg_level}("AVOID_BUG", >>> - "Avoid crashing the kernel - try using WARN_ON & recovery code rather than BUG() or BUG_ON()\n" . $herecurr); >>> + "Do not crash the kernel unless it is unavoidable - use WARN_ON_ONCE & recovery code (if reasonable) rather than BUG() or variants.\n" . $herecurr); >> >> Here's a requested tweak, to clean up the output and fix punctuation: >> >> "Avoid crashing the kernel--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants.\n" . $herecurr); > > Fixing punctuation here would be removing the trailing period as checkpatch > only has periods for multi-sentence output messages. OK, let's do that too. > > And I think that "Do not crash" is a stronger statement than "Avoid crashing" > so I prefer the original suggestion but it's not a big deal either way. Yes, stronger wording is better. So how about this: "Do not crash the kernel unless it is absolutely unavoidable--use WARN_ON_ONCE() plus recovery code (if feasible) instead of BUG() or variants\n" . $herecurr); thanks, -- John Hubbard NVIDIA