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 1F820C38142 for ; Tue, 31 Jan 2023 15:18:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233192AbjAaPSY (ORCPT ); Tue, 31 Jan 2023 10:18:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233179AbjAaPSB (ORCPT ); Tue, 31 Jan 2023 10:18:01 -0500 Received: from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com [IPv6:2607:f8b0:4864:20::e31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9445A59B4F for ; Tue, 31 Jan 2023 07:16:14 -0800 (PST) Received: by mail-vs1-xe31.google.com with SMTP id e9so8536225vsj.3 for ; Tue, 31 Jan 2023 07:16:14 -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=hqSkLxxkS4WxXckkEqwqJ2FoqZVZdDRCF2SZ/0LGP88=; b=JtZQ/lBmt1byjRUtXNuodezmFLI68Y4U1n9cV4QC89Jrp7zRN+opOXcshCLau26tiK Nd7XZH0XhmPh/ylPrymz6yitRCTAk77brQH6Y7T9Rwe3+PBn1kmbTPPEa5n39WSpbPC/ 3UVWX2vsjw2pYxx03h0V6D3FqfEWNxMiI4V+1HfBhQ7IPqlBbu3/6JtPVaSx9TOUQRxf 2mhIwkexBZz2BsG43yqbCb10cc/be7/cOMguEs3i6vHqPgytYuZugK70wSwuExWwjz2Y zsQhqw+EG63ShEJ2r0cpRtXL/S2Fd3ulNRqK5Gi2R4vnSEqOzBBhRqgx2w0+r7or3E81 nYJQ== 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=hqSkLxxkS4WxXckkEqwqJ2FoqZVZdDRCF2SZ/0LGP88=; b=V9dQrKFCw4Z3dD3D0Sfa0SsVGe8FOtOPxqkwYlmr9/HyaOk7d2/201Exq8457HEWsB tllNUz6xw88V7QS77vnMVgKSYBOYcxujxtHqSM72DU+9+rA8121Z/FKzNAMev2XOkFdQ Luubr04/20QDRyMsEbqsjt3PCiCCoVH7n86oWjo+3P3uOEuaNhJBV9Gh89RoNrI1uGLW KfYEMwHg5EU3RIP9I+LhnYFZqrEt3c+SyssK00+XyUnrVk48EHTiJh9ANA/jEKB9AMaR R7eZ1KMTDoBdEHDSWPbIt1CguhqVMgZeUlHTO8OY1CQkHDhTYSqxwi3HBYRzkKTJIhm/ ZcPA== X-Gm-Message-State: AO0yUKWBUl0c7N8vsgMRBNQDEsn4cW5YCYtf+nnSGTlZxhj5ptQ6Fyf2 /tXKIag0ceHZT9/CU4UiA8qUMt1RrzpOVKXj6eadbw== X-Google-Smtp-Source: AK7set9TuI801MQUIobSqj1yTStH7qsNvDVpmcS4/LrfPrPNvx2T47lNeSF2Vu2NdDktr05dS0mA/2X+cH7Q7NH14kc= X-Received: by 2002:a67:c31e:0:b0:3ed:1e92:a87f with SMTP id r30-20020a67c31e000000b003ed1e92a87fmr2427528vsj.1.1675178173210; Tue, 31 Jan 2023 07:16:13 -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: Alexander Potapenko Date: Tue, 31 Jan 2023 16:15:36 +0100 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, 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 9: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 Acked-by: Alexander Potapenko