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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 591BCC87FDC for ; Tue, 23 May 2023 07:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235725AbjEWHqf (ORCPT ); Tue, 23 May 2023 03:46:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235322AbjEWHqF (ORCPT ); Tue, 23 May 2023 03:46:05 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A69E1119 for ; Tue, 23 May 2023 00:46:03 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3D5F820400; Tue, 23 May 2023 07:46:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1684827962; h=from:from:reply-to: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=HE8Z1r+4tl2uPWUmoH+B2Mu5/vsobbHlaWuGe2SIGH0=; b=fdDAJd9CyqjSrnt3PsKFrRrefe+mjo30LoRyztAS20x9AjqcNg0GWxXukwc7b7Mec4DBU4 H2vA0ca3ogceMD5R470OfC6cnigF7Zs4pCd0kXnpxTxrWqW/elZntnFtZf6bKqamEiGKab 59gKyP6W/faL+zy8JQV+buAk5mtGmmY= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0386B13588; Tue, 23 May 2023 07:46:01 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id lSB7OTlvbGSPJwAAMHmgww (envelope-from ); Tue, 23 May 2023 07:46:01 +0000 Date: Tue, 23 May 2023 09:46:01 +0200 From: Michal Hocko To: Linus Torvalds Cc: David Rientjes , David Hildenbrand , Andrew Morton , Alex Shi , Johannes Weiner , Matthew Wilcox , Alexander Duyck , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [patch] mm, debug: allow suppressing panic on CONFIG_DEBUG_VM checks Message-ID: References: <53dd9df8-e88f-f466-89f9-3fa141a10267@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 22-05-23 11:48:52, Linus Torvalds wrote: > On Mon, May 22, 2023 at 11:39 AM David Rientjes wrote: > > > > I think VM_BUG_ON*() and friends are used to crash the kernel for > > debugging so that we get a crash dump and because some variants don't > > exist for VM_WARN_ON(). > > I do think that from a VM developer standpoint, I think it should be > fine to just effectively turn VM_BUG_ON() into WARN_ON_ONCE() together > with panic_on_warn. This is a very good idea. VM_BUG_ON has always been rather special and from my past experience people are not really sure when to use it. It is a conditional thing so it cannot be really used for really BUG_ON cases. Turning them into VM_WARN (not sure about ONCE) makes a lot of sense because as you say you can make them panic easily. -- Michal Hocko SUSE Labs