Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1689201rwo; Sat, 22 Jul 2023 21:04:54 -0700 (PDT) X-Google-Smtp-Source: APBJJlGDbKExNOWx+gYVwgJXa+jS3FjfhBFvspzkMoepdgvzFklz5uAkco284ih0Zr6SdrDPO9sZ X-Received: by 2002:a17:906:189:b0:991:f207:411e with SMTP id 9-20020a170906018900b00991f207411emr5495652ejb.69.1690085094429; Sat, 22 Jul 2023 21:04:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690085094; cv=none; d=google.com; s=arc-20160816; b=1K/eKMxlf8UBUn9f4pTvFMwKmnGDLWPZhHVtZ685Ir0MvKQWQodcGMKAr6qXTQXYnZ w31+MthOKfaFZGQTqP4nzDqFAERWzT9FLd35A47nPG455hY5kfpjE/lUEELNfqDL3/iV 1wg7j7RGsIg+lChtZ3100wuhIL9ho+bC2iDniPGvv+VuJMo/zyyGqGgJ/OxZTi/3uotQ 1AcCQf+7uiYidKzbJyc3JdQb8WoNZ0wnU1Ol1k4qGxJyZ/QJzPgRCO/mguKgS/z0NKic V+5y6MaBRLIKsPUd2whhbsR6Ihu0QkMgMde9GdYJfj/haPpexpNSdpdBq0u58+IRwS6c nQqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=44TAO7fZz6hxR8n6K1VxaF5RLJ5K1lVta2e75naOYuI=; fh=LNkgj42+Iu47Mz8c/9FbozjHpRfqwQnZ4aIvXu458fY=; b=PejVZuBN1GwJ4vFfVSnvMm7rOsu6XqjS7BdzYxoeRJcj3YUAp8MykOC4p9KziVSiEw RzSGjqYQVDFsAfmQOv8cdg6TiUXATlgD5u0Gy+U1gIp8+03tfcGihhWOM0XrrpzNNlI+ NjIJjEDO8CJ13zMOG96XVMqyLokqCxsA2WJTHBXBnyJX/7yMh/N21zOrixRPZ7XBeGGQ 8f1Xn8vRZ3C++X7U+/o/CBGHbIL+cGwj/8Zy08kbepPhwAgwzxnc/Wjg4+CnBsT4rhzW 2LA6fYed+GzzW8Z2/9wKN28KteKLUMRhZxzuwfc9ulU05QG3U+96XzgAWc86R0aDTvBg BuvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=fd471AmZ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pk7-20020a170906d7a700b00988e942e12csi4915423ejb.716.2023.07.22.21.04.30; Sat, 22 Jul 2023 21:04:54 -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=@infradead.org header.s=casper.20170209 header.b=fd471AmZ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbjGWB5G (ORCPT + 99 others); Sat, 22 Jul 2023 21:57:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjGWB5E (ORCPT ); Sat, 22 Jul 2023 21:57:04 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C6981BE6; Sat, 22 Jul 2023 18:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=44TAO7fZz6hxR8n6K1VxaF5RLJ5K1lVta2e75naOYuI=; b=fd471AmZbL4iL4EAIRqJ6GRP4x 1DRBJMV05Hv8AtPWVzmT5MKc2o9+fg/k5Tzv82JBd/Y4PwAOIreWpiNU03lRIyz+2opZg3LQ6mRW0 AbfzfVl9af5hZ5ig33UqNxgBP0g6dVgv8QYoqMzcScH2CRzSHEU/qraRu4zwaoHUdWvhh3XPhsZ01 Yd/8N0SkiwOOGKfBRGuMAOZluMw52E4zd3lRM/TVhuKIgdTiX9k6AWqOZRZWsnO6GIbFfEz/Zk1U4 vHUH0/OHR6Q4StDW01CP6YIsl6DD0JU70A5nZG+/oAUnQYzix4NizMqw3+z7NDsx90DuW49x5222B TpnUF3+A==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qNOL5-002bdT-7n; Sun, 23 Jul 2023 01:56:51 +0000 Date: Sun, 23 Jul 2023 02:56:51 +0100 From: Matthew Wilcox To: Pasha Tatashin Cc: akpm@linux-foundation.org, corbet@lwn.net, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, rick.p.edgecombe@intel.com Subject: Re: [PATCH v2 1/3] mm/page_table_check: Do WARN_ON instead of BUG_ON Message-ID: References: <20230722231508.1030269-1-pasha.tatashin@soleen.com> <20230722231508.1030269-2-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230722231508.1030269-2-pasha.tatashin@soleen.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 Sat, Jul 22, 2023 at 11:15:06PM +0000, Pasha Tatashin wrote: > static struct page_table_check *get_page_table_check(struct page_ext *page_ext) > { > - BUG_ON(!page_ext); > + PAGE_TABLE_CHECK_WARN(!page_ext); > + > return (void *)(page_ext) + page_table_check_ops.offset; > } [...] > @@ -137,15 +144,15 @@ void __page_table_check_zero(struct page *page, unsigned int order) > struct page_ext *page_ext; > unsigned long i; > > - BUG_ON(PageSlab(page)); > + PAGE_TABLE_CHECK_WARN(PageSlab(page)); > > page_ext = page_ext_get(page); > - BUG_ON(!page_ext); > + PAGE_TABLE_CHECK_WARN(!page_ext); > for (i = 0; i < (1ul << order); i++) { > struct page_table_check *ptc = get_page_table_check(page_ext); Seems like we're going to warn about !page_ext twice? Or more than twice -- once per tail page? But then we'll crash because page_ext was NULL and offset was small?