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 295B8C61D97 for ; Wed, 25 Jan 2023 20:55:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236634AbjAYUzW (ORCPT ); Wed, 25 Jan 2023 15:55:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236621AbjAYUzU (ORCPT ); Wed, 25 Jan 2023 15:55:20 -0500 Received: from mail-vs1-xe2c.google.com (mail-vs1-xe2c.google.com [IPv6:2607:f8b0:4864:20::e2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 843E948A39 for ; Wed, 25 Jan 2023 12:55:19 -0800 (PST) Received: by mail-vs1-xe2c.google.com with SMTP id i185so21064545vsc.6 for ; Wed, 25 Jan 2023 12:55:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GW5QetboOjp/W1DGCPKlZRb9/ODQzueiI/Kp5ewpL8w=; b=q1Y43sVBV67a+pTMXgzYdcgrIM1+jDEVyQDrYIY2VqgPCBA4gLIrVelM5WvsaRU6FT apqIDYl5nTydWmXdWFsHHzEmnUi9ucbdv/eGaDFY+/ikPxP7rpgjg23TSKdKRNG75RfF hOJWv6YDiJCYWInMiKfmSvisKfQHceB412aHHLyIH4laJZDnAhdUA/gwrmMFaTmYP4wI JasXHanhpujv7dWFati3LIBFZ6AJQSVfl11oMManr2Pa9YA9E34Bt+wQcOsCwX3M2nO1 aPfT/BNnaT1wPwl1xWgGhrkDfqq/B+t3Phb8hSkCfWokWCUfGMVgTTrWzsij4Z4mDYa4 4IoA== 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:subject:date:message-id :reply-to; bh=GW5QetboOjp/W1DGCPKlZRb9/ODQzueiI/Kp5ewpL8w=; b=3UJDn9RhzhL+QT4h4hBucJFzxBrxDYgbwXAmpwwpZDlMRsq42ikWFfe0axL86/LIGA GIKUVzdU48QBD21czaX4I3PlEOHEdJ2EPsGRwqVES8d4HNAYtrNMrQ4NOJMc1kruX6Gf Br4r9guu9lrwHY5ERRHsAZum8VOhS4tOi++xJ4/d1DlHArrgPLAEEXLLOu++xhJTM3AQ n/tBWSzTxlXLT6GJ7IpiYfnLq9hAVDrl4OOm8GK+sYkymgqFwSGtaCkf5DyNyGr7+9Fd Tl8kX3f6+3ifF1xjYnhHWQOQhhrwz7WH3xbZp0b/mXGu/U/crAa+rzkcmOdZxWuv71fQ LKqQ== X-Gm-Message-State: AFqh2ko0NfWR+e/ngRY0MxAQ5omWMFkxJhVcRDnQXf18MZt8UpJlx4ld tOEnRPtTMDszO5odOR2h88w49HJwJWjeHsyHGoKBWQ== X-Google-Smtp-Source: AMrXdXviSBQt/EVgkIYc2P8tOGvMYorzKUR4KlpF038mvQhGE7AGWByUE0GqDBCYz0ZD4Keh/l4cAHpGGwW9DuqqjQA= X-Received: by 2002:a67:f650:0:b0:3d3:db6b:e761 with SMTP id u16-20020a67f650000000b003d3db6be761mr4768562vso.46.1674680118522; Wed, 25 Jan 2023 12:55:18 -0800 (PST) MIME-Version: 1.0 References: <167467815773.463042.7022545814443036382.stgit@dwillia2-xfh.jf.intel.com> In-Reply-To: <167467815773.463042.7022545814443036382.stgit@dwillia2-xfh.jf.intel.com> From: Yu Zhao Date: Wed, 25 Jan 2023 13:54:42 -0700 Message-ID: Subject: Re: [PATCH v2] nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE To: Dan Williams Cc: nvdimm@lists.linux.dev, stable@vger.kernel.org, Alexander Potapenko , Marco Elver , Jeff Moyer , linux-mm@kvack.org, kasan-dev@googlegroups.com, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 25, 2023 at 1:23 PM Dan Williams wrote: > > Commit 6e9f05dc66f9 ("libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE") > > ...updated MAX_STRUCT_PAGE_SIZE to account for sizeof(struct page) > potentially doubling in the case of CONFIG_KMSAN=y. Unfortunately this > doubles the amount of capacity stolen from user addressable capacity for > everyone, regardless of whether they are using the debug option. Revert > that change, mandate that MAX_STRUCT_PAGE_SIZE never exceed 64, but > allow for debug scenarios to proceed with creating debug sized page maps > with a compile option to support debug scenarios. > > Note that this only applies to cases where the page map is permanent, > i.e. stored in a reservation of the pmem itself ("--map=dev" in "ndctl > create-namespace" terms). For the "--map=mem" case, since the allocation > is ephemeral for the lifespan of the namespace, there are no explicit > restriction. However, the implicit restriction, of having enough > available "System RAM" to store the page map for the typically large > pmem, still applies. > > Fixes: 6e9f05dc66f9 ("libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE") > Cc: > Cc: Alexander Potapenko > Cc: Marco Elver > Reported-by: Jeff Moyer Thanks -- that BUILD_BUG_ON() has been a nuisance for some of my debug configs. Acked-by: Yu Zhao