Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7564161rwl; Tue, 10 Jan 2023 02:27:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXsuIiJzHNWGpioxMGyRDVal9VCZc3WiIrBxLKRVcMMrEceoPabvXpHAFWZrQHkdV3Da/jVb X-Received: by 2002:a17:90a:8d0d:b0:226:e0da:fcc2 with SMTP id c13-20020a17090a8d0d00b00226e0dafcc2mr13865470pjo.47.1673346464151; Tue, 10 Jan 2023 02:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673346464; cv=none; d=google.com; s=arc-20160816; b=NVWpAiJqgwdF+Pim57tuJzl5I0YD2DWyyk8ztmwZaM22oY6Elb298vA8WBtpFq99Gl aPeniWTc3RPQWiNsotjlGue/w7gdYn3mDzUnno9X5ljyLqQcdZhmZIVvoLJZTn6eY+Oy 5FLAd+4SLs2TzkA83iuzMy+o5N/6Msfs8JvIpOKGJO9nrUNAkaqV4meVrRWbqNLdLJZ5 xPm1NExqF9w8OHqsUKxSRJQacWjpp/MoFhUiqZk9DdLpE4vm2kBi+Ki3i2lUo0boD6GT 2a4AaCIppEXNyU2+M4L0LmjCLybkRPHCcT6Y+uSaJ+w5RxMTNKmxuBak0vL6U0WbGixd P5hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=BZjVbZGCjv7A5kNPkNeLdv+wkjoamsJDXs8YegeL2T4=; b=qukUSBmwMVaZ2OaTwqMlrIyaUBT6HY5LLaux37s2RXvVKkg5mIUTBKH3DQ15w3AFX5 nRj7DqcymJTjpBQhq5VyfXMjT94DKLJ9co9lrjJqV+Vt9g2/Kem1dCD/TtlF/ynRdX8O 6wgXcWQ54e4za2V5ofiYh53IiZEsqhLk93ajN/bSZqTg7741Xdc+WNy6FZ0UdLhLrKb7 ghTV57sbIuEXneOEZLZOq+JKESUPe/KOaSXUCKRkIvUkj4A1323QXHLy+F/MuhJuPVKl CzRvO3cFYNPFzjGSu1D4R4K7radNT/4SXQZ4CU41Ch2pYU7FC29Wl0eZnNP5N0aJQwY4 ZXbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=G4FXz9pl; 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=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go13-20020a17090b03cd00b0022692bdf6c0si13991224pjb.49.2023.01.10.02.27.37; Tue, 10 Jan 2023 02:27:44 -0800 (PST) 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=@google.com header.s=20210112 header.b=G4FXz9pl; 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=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231874AbjAJJPq (ORCPT + 53 others); Tue, 10 Jan 2023 04:15:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231792AbjAJJPW (ORCPT ); Tue, 10 Jan 2023 04:15:22 -0500 Received: from mail-yw1-x1135.google.com (mail-yw1-x1135.google.com [IPv6:2607:f8b0:4864:20::1135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 766C4517FD for ; Tue, 10 Jan 2023 01:15:21 -0800 (PST) Received: by mail-yw1-x1135.google.com with SMTP id 00721157ae682-4c24993965eso140020327b3.12 for ; Tue, 10 Jan 2023 01:15:21 -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=BZjVbZGCjv7A5kNPkNeLdv+wkjoamsJDXs8YegeL2T4=; b=G4FXz9plsObMOuxdew9aUiYd8kNDrKlLcRdPP0D4TPErxFg5Flg+a0CragCj2tHf8J zBNc7Oz6wYgNDUlcVyMzvQV7VlzjvYaonI/LqykEnEQyLSCqWK44PmIDDdv3ftmLz4Kv hDHT9AS1cruTEgyD04PVuKT3yio0GXSlVlQeLXqZ2IdcLzS5sfs14/lHHQOc7L0SdV/+ DJYM2kYGgW6wZUPBfZDBUUvX0VpbAARkvO0WZqpkGMjQNssw+V+giAL3Z2atEAyyJTax 96mKg67KtxKOw3MV5aWOI8O8nGxJvEFPfn0aB2fycCC2ocv33CnczJf0AmLRlY0hyIIW Qo9Q== 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=BZjVbZGCjv7A5kNPkNeLdv+wkjoamsJDXs8YegeL2T4=; b=jOYKCZvn2srRGnHvp98hCL07RlMVvmWTXT7nzwa0K9/5fU3RlPlOAl/dyE3lxuUHPF sQPV0eZGsGOEF8YpQwNuSeVdgkPyV6H0mJsrYzKctBz5QiUXAJrKgWhByvqa6Ipwaw9f nAHZzovvq5J+J0Y/bEJCbmjzYytDGSvM/yGDfHQJHFNNEuOg9gV6sZJBJxAzmCblIFQQ bNpgN9bVM4tYgMphXV3fWoQsAysTmAdC9zuTOGVpfk0KJiXIXEQH6J5JivthtfRs4SWR QKAcTdKowdPW8tDocvO6Dr8HgG0+PBS0geS/J1wTw2wvuapLu9zeMWwPF9yy/08dj+R8 3s3g== X-Gm-Message-State: AFqh2krjf8/wWMYPCIprDyW2TV6rU0kdOypqEWTj7aec6j6ixlhyfS01 A4lMQjRBgldukH+46uimk8YasEcUlC0LuamlxPUlpQ== X-Received: by 2002:a0d:f084:0:b0:4c2:51b:796c with SMTP id z126-20020a0df084000000b004c2051b796cmr1329440ywe.144.1673342120546; Tue, 10 Jan 2023 01:15:20 -0800 (PST) MIME-Version: 1.0 References: <20220701142310.2188015-1-glider@google.com> <20220701142310.2188015-11-glider@google.com> <63b74a6e6a909_c81f0294a5@dwillia2-xfh.jf.intel.com.notmuch> <63bc8fec4744a_5178e29467@dwillia2-xfh.jf.intel.com.notmuch> <63bd0be8945a0_5178e29414@dwillia2-xfh.jf.intel.com.notmuch> In-Reply-To: From: Alexander Potapenko Date: Tue, 10 Jan 2023 10:14:44 +0100 Message-ID: Subject: Re: [PATCH v4 10/45] libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE To: Eric Dumazet , Dan Williams Cc: Greg Kroah-Hartman , Marco Elver , Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Herbert Xu , Ilya Leoshkevich , Ingo Molnar , Jens Axboe , Joonsoo Kim , Kees Cook , Mark Rutland , Matthew Wilcox , "Michael S. Tsirkin" , Pekka Enberg , Peter Zijlstra , Petr Mladek , Steven Rostedt , Thomas Gleixner , Vasily Gorbik , Vegard Nossum , Vlastimil Babka , kasan-dev , Linux Memory Management List , Linux-Arch , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 > > > Unfortunately, it can not be dynamically enabled because the size of > > > 'struct page' is unfortunately recorded in the metadata of the device. > > > Recall this is for supporting platform configurations where the capacity > > > of the persistent memory exceeds or consumes too much of System RAM. > > > Consider 4TB of PMEM consumes 64GB of space just for 'struct page'. So, > > > NVDIMM subsystem has a mode to store that page array in a reservation on > > > the PMEM device itself. > > > > Sorry, I might be missing something, but why cannot we have > > > > #ifdef CONFIG_KMSAN > > #define MAX_STRUCT_PAGE_SIZE 128 > > #else > > #define MAX_STRUCT_PAGE_SIZE 64 > > #endif > > > > Possibly because this needs to be a fixed size on permanent storage > (like an inode on a disk file system) > Ah, thank you, that makes sense. Then I'm assuming some contents of struct pages are also stored in the persistent memory. What happens if sizeof(struct page) stays below MAX_STRUCT_PAGE_SIZE, but the layout changes? E.g. doesn't it cause problems if the user enables/disables CONFIG_MEMCG?