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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5EACC54EED for ; Mon, 30 Jan 2023 08:35:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 397DA6B0072; Mon, 30 Jan 2023 03:35:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 347126B0073; Mon, 30 Jan 2023 03:35:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E7818E0001; Mon, 30 Jan 2023 03:35:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 0BB166B0072 for ; Mon, 30 Jan 2023 03:35:34 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CF0041402F4 for ; Mon, 30 Jan 2023 08:35:33 +0000 (UTC) X-FDA: 80410806546.14.83EBD63 Received: from mail-vs1-f50.google.com (mail-vs1-f50.google.com [209.85.217.50]) by imf28.hostedemail.com (Postfix) with ESMTP id 27825C0007 for ; Mon, 30 Jan 2023 08:35:31 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ev6TkzkN; spf=pass (imf28.hostedemail.com: domain of glider@google.com designates 209.85.217.50 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675067732; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SDsKqyepeY63ocyMIwF8lZiaR+pOTU94INwLNWf/i/Q=; b=SFdgsW8lQ0mY+ymfEUmBV12HPVUChdpZEJDbQN5MTqCbkjuKx8w0Q77IRDzDkiGFJRyJFr 2CtcA8t3zN5v83jpIlKXNDiG8JLma7+afg/eJdmw48OQej3qxFS6GBtHe3S8oNeTWWJ9z6 n8F84P0Z7tuizxSB/i7dFgZh0oDF2Ls= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=ev6TkzkN; spf=pass (imf28.hostedemail.com: domain of glider@google.com designates 209.85.217.50 as permitted sender) smtp.mailfrom=glider@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675067732; a=rsa-sha256; cv=none; b=d085Gkbt2kwuG8p9yaClmgFMGXW65bigsVnksp40IG9bju2WtA0DqbsAijei3JXa+xQuxO eeyjT2ru74apGLukPkR2bBRAm7GC+eNGwk5bLZayJh8R+OitEHaUOBBa2Np9nlhjwMx/wV cIfSYzI3PP0ZF5AwTuNE9wrEfkYN6H0= Received: by mail-vs1-f50.google.com with SMTP id h19so9883773vsv.13 for ; Mon, 30 Jan 2023 00:35:31 -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=SDsKqyepeY63ocyMIwF8lZiaR+pOTU94INwLNWf/i/Q=; b=ev6TkzkN+oz3Pn2cqYjBSUtXogA5QDLvcoqgoNESO5OALKcVKunZ5BNPhAn9OKgoB4 J+T2sBUxdpcZpAOJxcBhw9LmGzLnIsuD+ImGdOHtBunOYmz3lYKdbYyejff7ZcgAY+bw LkIsBZ92PhyspTXo6Srnts7ZiMcO5R56TMmQyT+qGF9OZiSEqCGgJ+PxI8h7Z558UBj6 jezwKhML1nM20ptbwlF2YOAHFlYT6yTh+fwWxDjDUZPX+xMMV3RGMZbEdfxD9ZOujRmy o2HXcwknMXLTfXxJIbeKJlOkDTI9wxjXOB2dwo3wGGsHwPRjtPmqZPYbDHLdJ6B/OUGH gjwQ== 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=SDsKqyepeY63ocyMIwF8lZiaR+pOTU94INwLNWf/i/Q=; b=MJOPfdJwQe9YMW/F3R8Tf3R+sxBZCYTDBVYb8uvapR0nnejUsDKiHEMU1yoG4uxYo4 rWl+d4rXydyMH+BmpSms2W1XbT7d5YFSkYtBwymlzoyh3kNT2MSItQMudUhAXLOznlD7 3aMwcuG+qPH+tDDsCDvLHtNljyH5LIOgunvUDN9v6VnQ6D1btZ97KEFy2TGD+WmFqIjb A+jowyO7AZ41qD6lM8ig7cD8948CvNdo7osq9LhTyD++SOcLJqSh9XrWi0jPyU4PTbQS e7kQd5mSdMCKj2URrtEfVI2jqxeHB/VzMOOAATwqAKnHbbyCI4+XXuBD63gq6FUhRTRZ jdTg== X-Gm-Message-State: AO0yUKV8+6CfR1lOo+YRLTb0RZv1UlMWTFI7+BihDqB/QjPZ++ELb32a +hbLBM+2R0RXELmtHuUSvNVTGolojRfJePc9Wog3kQ== X-Google-Smtp-Source: AK7set87heiUfKYTTgXopGPXqNCq9oqyYQ7M4JyNrCHVP6v7DUboxKAd6easHm0O08SmEKEthX056v5+58w841VaRu0= X-Received: by 2002:a05:6102:3237:b0:3f4:eee1:d8c4 with SMTP id x23-20020a056102323700b003f4eee1d8c4mr514404vsf.19.1675067731131; Mon, 30 Jan 2023 00:35:31 -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> In-Reply-To: <63b74a6e6a909_c81f0294a5@dwillia2-xfh.jf.intel.com.notmuch> From: Alexander Potapenko Date: Mon, 30 Jan 2023 09:34:54 +0100 Message-ID: Subject: Re: [PATCH v4 10/45] libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE To: Dan Williams Cc: Marco Elver , Alexander Viro , Alexei Starovoitov , Andrew Morton , Andrey Konovalov , Andy Lutomirski , Arnd Bergmann , Borislav Petkov , Christoph Hellwig , Christoph Lameter , David Rientjes , Dmitry Vyukov , Eric Dumazet , Greg Kroah-Hartman , 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-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: 9jzm8qafh6x7sxeg61ju11irxirz7mr3 X-Rspamd-Queue-Id: 27825C0007 X-HE-Tag: 1675067731-5478 X-HE-Meta: U2FsdGVkX18+4gflGN6o3bIgisS8Wmj4XGrSk3mjwxVQ7uVEszuIig+IH37TYK0WU1t+46tR7wyoHAbnxzLrfuBs8iQqg6LXtWbNV1Buf82Hc/2lDOQaXcvzkALk2eOWF1w6VLMVBe87JT1nJx5KbaNhdDqWSRo+hSiTvn+OIuMAcwx6Hov69m5mbGY/WIKwePQD3g+lJ1VoaOs1JFFIoemyc//aS2ocnqJnPNuRGRQY+9fUcgl2+X941I/5QWGTgRzb/T4WxFq8DBHWuLynBpJeMyR7ETasgWLr2IZiudiafYfobZ79JMdDELjGgFET2WtudCS0q47Kwzgd6h5xBY9f3F4vWeszNEAaow2ovmDorsuylcrgjm89mPv9vId40X46XFaFbG7CEpcKv9lpPIClXUERQDWKBUy9ILT+rQ3ChzNf9pCyw335+Fj+vonPB7kaXOX71Cs344V/mfq/v0f8W3AmmaC4FgfzlPRlUxa+WBqSqwzF1kHuC6xmctNjpTM66ABEzwg2PHvuoqIQssHsJwtdqoNCyN9lYWg490EcyeVhW1bVd5GUkocn56qDai6blzT0mMfYrmybrPP7I7NddCiPJ9dW3w1JuhcqWpJUyfx1qcl84NgJfshXvuwWKvkTv6sdFDGRtGG8F2rTvLv3s7sdYNxITt1hklbqiIVgNRNgDHIS6ZMpIjkzec4Kx+ppnoBer7N4qoHJ2JNR1pzSzVYMivXvWqc5we0KmK2aHU2NRIx3VtqpR5hA+xYekM/M3JLOM51tWVuLYSIL2yHpc7ztKasmkS3v2G8XSTIqIOlimkjZlT4IB3uTuLOz8kR0JWAfhDxszVPsgqueQGXS8HsWmehFVFyK62SGHuC/DB3iN5IEU16KsbeJpUzdM7bl2DyX1iUthkiUycsg8ysZ/epnckATJBtxPpSlYN8v8lWkn62TmKH7zKYSwZ2V+CM0ivOTtOjUIHOKFut tvBhJqZ4 7j9Ve/bdhETKubUK0HL7VNQcO/0Y5ZXaXkyjDoanvLl9U93gbo1/XICc+5NWv7EZuosQBGRPuuFPmZhFMUmI5/h8UWv5HcJibNvHCVmFLHSdh66GTfYZIak5wdH9kAImZ9PDIMh/8Q+4C0YN16ufbysJ3MYhkXlHjr83T5dc7QG4xzFWsPNlJm7k+8cCh9SoAYRF+6wTu8AtR2MzvkVPnb8JJvqp/Im4oG2umOryf0ak92W/Za9xTqlcAUV5ps1RFgQorGpAhr2UQkJmx9578gFQVXrJx6CKcfdvzFrC+Soii/v1qX+j+f6A7MbfgzAp41rvLwYoAwdom2H+Bo9lxgriYaw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 5, 2023 at 11:09 PM Dan Williams wrote: > > Alexander Potapenko wrote: > > (+ Dan Williams) > > (resending with patch context included) > > > > On Mon, Jul 11, 2022 at 6:27 PM Marco Elver wrote: > > > > > > On Fri, 1 Jul 2022 at 16:23, Alexander Potapenko wrote: > > > > > > > > KMSAN adds extra metadata fields to struct page, so it does not fit into > > > > 64 bytes anymore. > > > > > > Does this somehow cause extra space being used in all kernel configs? > > > If not, it would be good to note this in the commit message. > > > > > I actually couldn't verify this on QEMU, because the driver never got loaded. > > Looks like this increases the amount of memory used by the nvdimm > > driver in all kernel configs that enable it (including those that > > don't use KMSAN), but I am not sure how much is that. > > > > Dan, do you know how bad increasing MAX_STRUCT_PAGE_SIZE can be? > > Apologies I missed this several months ago. The answer is that this > causes everyone creating PMEM namespaces on v6.1+ to lose double the > capacity of their namespace even when not using KMSAN which is too > wasteful to tolerate. So, I think "6e9f05dc66f9 libnvdimm/pfn_dev: > increase MAX_STRUCT_PAGE_SIZE" needs to be reverted and replaced with > something like: > > diff --git a/drivers/nvdimm/Kconfig b/drivers/nvdimm/Kconfig > index 79d93126453d..5693869b720b 100644 > --- a/drivers/nvdimm/Kconfig > +++ b/drivers/nvdimm/Kconfig > @@ -63,6 +63,7 @@ config NVDIMM_PFN > bool "PFN: Map persistent (device) memory" > default LIBNVDIMM > depends on ZONE_DEVICE > + depends on !KMSAN > select ND_CLAIM > help > Map persistent memory, i.e. advertise it to the memory > Looks like we still don't have a resolution for this problem. I have the following options in mind: 1. Set MAX_STRUCT_PAGE_SIZE to 80 (i.e. increase it by 2*sizeof(struct page *) added by KMSAN) instead of 128. 2. Disable storing of struct pages on device for KMSAN builds. , but if those are infeasible, we can always go for: 3. Disable KMSAN for NVDIMM and reflect it in Documentation. I am happy to send the patch if we decide this is the best option.