From patchwork Fri Aug 26 15:07:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Potapenko X-Patchwork-Id: 12956183 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 7F09BECAAD6 for ; Fri, 26 Aug 2022 15:08:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 15805940011; Fri, 26 Aug 2022 11:08:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E0D7940007; Fri, 26 Aug 2022 11:08:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9C4A940011; Fri, 26 Aug 2022 11:08:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id D7710940007 for ; Fri, 26 Aug 2022 11:08:42 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id B40D3140F2D for ; Fri, 26 Aug 2022 15:08:42 +0000 (UTC) X-FDA: 79842075684.07.289AD38 Received: from mail-ed1-f74.google.com (mail-ed1-f74.google.com [209.85.208.74]) by imf01.hostedemail.com (Postfix) with ESMTP id 4F47C40015 for ; Fri, 26 Aug 2022 15:08:42 +0000 (UTC) Received: by mail-ed1-f74.google.com with SMTP id x9-20020a05640226c900b00447e004ea4cso1241807edd.8 for ; Fri, 26 Aug 2022 08:08:42 -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; bh=KyITLg/74GrhViHFJeQt7QU8AnVbkb7jycJ7NufNBUo=; b=JGLI1XVMHG2i60SDAlQT0tbexjKijbMvRCyJBm7rqKpNb8F4aYTTCeDzdw3DZRTTY9 9aBJI5GzvyT5OHahe6P/FLulT47ZG48jaSm51uWVpeEM2anno2pVkr/HWnEaP4dzX2sF twstPsWzst1+5uhmUIC538U8YzMDGMv8YPX1agG8mT4BMvYcmTbtHBdrbhp45twT7nWE nz3m1f2/FPyxoUBD0WCWPwU+2VcI0cRXIUlw4UKcnV2+HEz4YBqOj5X/pB0YMkzOfjBA Gfm4kLyCfYg0BuipDD2uTTZ9O06RAPnTfMpt3Cr9PpAqZlkS4Eal6zCfjZiQC/y2Ypav PWuw== 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; bh=KyITLg/74GrhViHFJeQt7QU8AnVbkb7jycJ7NufNBUo=; b=ggA2f6Wa4xUvoaKiHK+NVLHMxNXlY8RktJ8tvYhEmgrzi9YXuOIOznwuEuIRmIR0Rc r07RO8/bMbebSeVpBJ5EbvhzEdY+KIjgK1bQnFxlMYYF92JJiEevlsIo4IEF34xOhCPI ze1qMKYax+5aeaGzYSlZiaxiZKUT8gooZI3MpOe8ksVvY8E/BBPXqlkpzmMunCJUj2pU qdpiEeHK1oRtTjLZw8ogWrNMfEvBW9zhVKQN1Ad0nVynvu/64Mvcyq47t0EU3/G2Z/jT 1cIpF7ofm/edHFsTgGtKtCwNtY5AOJaBl5y+wUgAWNzGEkzDuMyMc5622ODqWOMeuHlR vocg== X-Gm-Message-State: ACgBeo1PwHFihFZE+Krfoys+onA6TKZJHk9PHQhY56Ehv62NM/TE/Rwj jnF1b7Iqv+i6HoArIlefskLOxw3UUvY= X-Google-Smtp-Source: AA6agR4pAyh98UW17iINAKOiWgkXvBjhtWUMPuOGGFy1IcJGaEVoMCTj1DvlVljTnjKpWwFAIOs4GvCri44= X-Received: from glider.muc.corp.google.com ([2a00:79e0:9c:201:5207:ac36:fdd3:502d]) (user=glider job=sendgmr) by 2002:a17:907:a04e:b0:73d:8419:3d88 with SMTP id gz14-20020a170907a04e00b0073d84193d88mr5498703ejc.616.1661526521065; Fri, 26 Aug 2022 08:08:41 -0700 (PDT) Date: Fri, 26 Aug 2022 17:07:33 +0200 In-Reply-To: <20220826150807.723137-1-glider@google.com> Mime-Version: 1.0 References: <20220826150807.723137-1-glider@google.com> X-Mailer: git-send-email 2.37.2.672.g94769d06f0-goog Message-ID: <20220826150807.723137-11-glider@google.com> Subject: [PATCH v5 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-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661526522; a=rsa-sha256; cv=none; b=asgedusdawP2p33nUGJuzSD/3eA4BgChR5ow31+Uyg8GQKU/TLJpV94QDF1I+sim10/P78 AyoULFSvSZyNOu545rJ7N07glyKPDht5tsfY2dDBzCJiOFtYVpTYQaTpaRA4TkluuKhxVX 3rQWETXQNIBpE4BtSevA9BaRZRfbLts= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=JGLI1XVM; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of 3-eEIYwYKCP4mrojkxmuumrk.iusrot03-ssq1giq.uxm@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3-eEIYwYKCP4mrojkxmuumrk.iusrot03-ssq1giq.uxm@flex--glider.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661526522; 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=KyITLg/74GrhViHFJeQt7QU8AnVbkb7jycJ7NufNBUo=; b=nkmSwb6lm3iby8/h0vSi0bBUpiBau4UDKrpnqYSuBbglLCntEVOVzDxXIO76RDEFRqQWDr 1nRSL25vl8+DSizc2vqEUzXMEIqEL3WO4AsmPNA+4jNBZOW5gwnpCXSpUmZXqzl00wZ7D2 +KhVz3MXGEl2FU6WjPuWZIhXR7qeCpo= X-Rspamd-Server: rspam11 X-Rspam-User: X-Rspamd-Queue-Id: 4F47C40015 Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=JGLI1XVM; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf01.hostedemail.com: domain of 3-eEIYwYKCP4mrojkxmuumrk.iusrot03-ssq1giq.uxm@flex--glider.bounces.google.com designates 209.85.208.74 as permitted sender) smtp.mailfrom=3-eEIYwYKCP4mrojkxmuumrk.iusrot03-ssq1giq.uxm@flex--glider.bounces.google.com X-Stat-Signature: hstjor4xwghiiq4zpyeqwge43ik1yjig X-HE-Tag: 1661526522-478412 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