From patchwork Mon Sep 5 12:24:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12966041 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 C8F14ECAAD3 for ; Mon, 5 Sep 2022 12:25:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6A49F8D0071; Mon, 5 Sep 2022 08:25:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6546F8D0050; Mon, 5 Sep 2022 08:25:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4CF0A8D0071; Mon, 5 Sep 2022 08:25:26 -0400 (EDT) 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 3CAAF8D0050 for ; Mon, 5 Sep 2022 08:25:26 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 16D7C81427 for ; Mon, 5 Sep 2022 12:25:26 +0000 (UTC) X-FDA: 79877952252.21.85B5A31 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) by imf17.hostedemail.com (Postfix) with ESMTP id B232540069 for ; Mon, 5 Sep 2022 12:25:25 +0000 (UTC) Received: by mail-ed1-f74.google.com with SMTP id h6-20020aa7de06000000b004483647900fso5813668edv.21 for ; Mon, 05 Sep 2022 05:25:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=vmKBMF2McNFVJqtG6TmpI3MAJxV0RMGeKyj0ZsE0Fyg=; b=O96bjuI/kcNtVyq3944Z7ueCIaa9yuEsYJRsRqgSlHKcEXxmakhKDnaYm8bTJp/2Ie Y8UpnSRc1QETrs4Y8CaN2D+hdalbChXjb/iF/mgeJ2k74SyqLXaXBPgwOkNVKFXuAPnY ObphBlLVgrXRSkLKMQJGEtkwN+0KhcNeyBefvXOuILKIWJt/BEXyYI12bQA0Tlj44WO5 jxvyzRsqVQanRBcQxBYdjMDiO9F+YgLL1c8yza+3/ejeeXcU2k1NELaQsYeqOb0rYH3V N0CpyqXMVX3sGSh37mJH/qGJ8lKdXml50RvZ8I9e4hWM3iSgRSretp8awq1gK/fuIu3m Y1Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=vmKBMF2McNFVJqtG6TmpI3MAJxV0RMGeKyj0ZsE0Fyg=; b=2LONBWIf5xOyQvMcg4frQljU41d8YfVryzGU2w/4wMnglXJzaFy8KpGshrNTuNfsEf C2vniLLm4H96JbwrzTy8Y+67Ywg3Mo4SdFcR8DKoRsdrU79VjqLAwdQvm/94NGAPvHcH vsmg/1512t0r7xH5RwLA4llvqEjTfMAoYvpd//4fCGSgA9iUOiYTilJpzw6RTPh2JHpW pw2+6CBBJE0gjpvGBnIWKzz7a/ujfliJPMFKGzxABuP1R9POL5bpEo60y9UHS6ouNoO+ QAJNzM2K5PjcVYPoIvpynP+9Mr+7mJ12QXPAqlY81MFlMAE8eIvKZ2M++EnzPf15U2GM eDKA== X-Gm-Message-State: ACgBeo27Po6my+UHErD4ePswFZtwkXDsXbsxuAVqTTsTSspslpxhYvxs P+b9zkTZyTFIje8MyAmU9CuA1QrXzvw= X-Google-Smtp-Source: AA6agR66RFT7ULInIZdaLxzEB+W3njrb9ZsrwOKlCCrjmsBFRCEDn3xMmeOMxizX3qE5C/AOVlfkrTghefs= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:b808:8d07:ab4a:554c]) (user=glider job=sendgmr) by 2002:a17:907:b13:b0:73f:d86a:6e3c with SMTP id h19-20020a1709070b1300b0073fd86a6e3cmr31127618ejl.132.1662380725053; Mon, 05 Sep 2022 05:25:25 -0700 (PDT) Date: Mon, 5 Sep 2022 14:24:18 +0200 In-Reply-To: <20220905122452.2258262-1-glider@google.com> Mime-Version: 1.0 References: <20220905122452.2258262-1-glider@google.com> X-Mailer: git-send-email 2.37.2.789.g6183377224-goog Message-ID: <20220905122452.2258262-11-glider@google.com> Subject: [PATCH v6 10/44] libnvdimm/pfn_dev: increase MAX_STRUCT_PAGE_SIZE From: Alexander Potapenko To: glider@google.com Cc: 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 , Marco Elver , 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@googlegroups.com, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="O96bjuI/"; spf=pass (imf17.hostedemail.com: domain of 3teoVYwYKCAIinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3teoVYwYKCAIinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662380725; a=rsa-sha256; cv=none; b=IIavuyhLdp39kAkqpzTtOG8pw7D1Kq/8pVrj+ApirCWQSELm/N7ap/MY2KW8DbNcW8tEpQ ATQLG+F9iI6F5Vd1wk5idaLToSHnlsnVRlKMIXLwMFtp9utHVerAdTypHiN7C6mGj2Mmbf 0o53qa5O9kdxaR0ATstF4G/KQHYNsTw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662380725; 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=vmKBMF2McNFVJqtG6TmpI3MAJxV0RMGeKyj0ZsE0Fyg=; b=pNPOemWJRAYKA4q1W2Spp04WRkAkbB3Q/qrbLrnR6rG0cuqPbpHeOlyHtwYbFWfdgSNBo8 dT0NAV/g8VAPmoAQxmhyZy78CsycMCLzRZ6Qt2ospNkskg/nFrWhoLLoXu3Wl3W+2IrGmv G2Tlz+HGyh1Nm6oi9Q/c+9R0elg/zf0= X-Rspamd-Server: rspam02 X-Rspam-User: Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b="O96bjuI/"; spf=pass (imf17.hostedemail.com: domain of 3teoVYwYKCAIinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3teoVYwYKCAIinkfgtiqqing.eqonkpwz-oomxcem.qti@flex--glider.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: bhp53scrsaqbe9izampdhqq3kud1ge4n X-Rspamd-Queue-Id: B232540069 X-HE-Tag: 1662380725-542170 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: KMSAN adds extra metadata fields to struct page, so it does not fit into 64 bytes anymore. This change leads to increased memory consumption of the nvdimm driver, regardless of whether the kernel is built with KMSAN or not. Signed-off-by: Alexander Potapenko Reviewed-by: Marco Elver --- Link: https://linux-review.googlesource.com/id/I353796acc6a850bfd7bb342aa1b63e616fc614f1 --- drivers/nvdimm/nd.h | 2 +- drivers/nvdimm/pfn_devs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nvdimm/nd.h b/drivers/nvdimm/nd.h index ec5219680092d..85ca5b4da3cf3 100644 --- a/drivers/nvdimm/nd.h +++ b/drivers/nvdimm/nd.h @@ -652,7 +652,7 @@ void devm_namespace_disable(struct device *dev, struct nd_namespace_common *ndns); #if IS_ENABLED(CONFIG_ND_CLAIM) /* max struct page size independent of kernel config */ -#define MAX_STRUCT_PAGE_SIZE 64 +#define MAX_STRUCT_PAGE_SIZE 128 int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap); #else static inline int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 0e92ab4b32833..61af072ac98f9 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c @@ -787,7 +787,7 @@ static int nd_pfn_init(struct nd_pfn *nd_pfn) * when populating the vmemmap. This *should* be equal to * PMD_SIZE for most architectures. * - * Also make sure size of struct page is less than 64. We + * Also make sure size of struct page is less than 128. We * want to make sure we use large enough size here so that * we don't have a dynamic reserve space depending on * struct page size. But we also want to make sure we notice