Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6663158ybv; Wed, 12 Feb 2020 17:04:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzIvKU8zkejA37TSfB0mpoWYSh5PNnE+c1IO1pYEZFCXrZUYUBTwfgW8ut7uBcsdK7cScpA X-Received: by 2002:a9d:588d:: with SMTP id x13mr11006840otg.6.1581555897091; Wed, 12 Feb 2020 17:04:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581555897; cv=none; d=google.com; s=arc-20160816; b=U9Jlted82BiefUuq95+wf+Aj15XwFBCJr3gnSgkNb6XlI1W84w8uuB3L71gQvFlqY+ is9QCfmrK/TIfW19Qb5Gno29uk6NTSyoDEGD3KVvVEruFSRe8R9HpTnq6Ns0W8SDNHL1 60JE+OAZLlTHi43NOx/ESCajkYtfAbuAtp8S6sSvZxgNzav+rUvmTPD7dDwRtZl0UKFS 0e+WLPhnJQZUQZHcHck547L56GT8LkojSMIMkfjbCcxWSugCeDQc47yLLwm83JOYuGJt GqGzXiZ7ua5ZL3T6m9QjiTPV3PjCZwe2FwY/A8JvOrLiZxWcCAy0TJVyL+HsnXl+f4mR 3AaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject; bh=Cb7u8aTZNJVrtxRl18M05f8/SOTN8E9DGXFtBHn1ZPA=; b=ObjY2cqwa9TcxDJTj3BWLL2wk1azX/d9uIaE0Q2Rbbi7HJidGTF0u4tRVnZv8RR8er UOwCZ6KFy67zJ4OmqclyGJ0uDPvs56/pvIdOs2xW50oj+gLoUO7alX60Unzyqaa8XUj+ rxr/35L2I2NYyDjYkVcygU/1MKeZpQePixC/GagPRuDdH/D7zbti8Ca9Ysn9HX14pEZW d4MfUnEANX9q261o2LMozGSCHyfVnGGssKxwQnbZsedY9+OX/oiaUTqqJtF1XHdm0LYa FlW7FANPETWNBiBQIWIJttLNg9/pkXiMEnyXIAEIRPNChO7Boi943GZBr5DHBYQdwsbe mwow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e20si402338oig.199.2020.02.12.17.04.32; Wed, 12 Feb 2020 17:04:57 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729329AbgBMBEX (ORCPT + 99 others); Wed, 12 Feb 2020 20:04:23 -0500 Received: from mga12.intel.com ([192.55.52.136]:16308 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729185AbgBMBEX (ORCPT ); Wed, 12 Feb 2020 20:04:23 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2020 17:04:23 -0800 X-IronPort-AV: E=Sophos;i="5.70,434,1574150400"; d="scan'208";a="406480973" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Feb 2020 17:04:22 -0800 Subject: [PATCH v2 0/4] libnvdimm: Cross-arch compatible namespace alignment From: Dan Williams To: linux-nvdimm@lists.01.org Cc: Oliver O'Halloran , Vishal Verma , Benjamin Herrenschmidt , Paul Mackerras , Jeff Moyer , "Aneesh Kumar K.V" , linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 12 Feb 2020 16:48:18 -0800 Message-ID: <158155489850.3343782.2687127373754434980.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-3-g996c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1 [1]: - Fix build errors with the PowerPC override for memremap_compat_align() - Move the memremap_compat_align() override definition to arch/powerpc/mm/ioremap.c (Aneesh) [1]: http://lore.kernel.org/r/158041475480.3889308.655103391935006598.stgit@dwillia2-desk3.amr.corp.intel.com --- Explicit review requests, but any other feedback is of course appreciated: Patch1 needs an ack from ppc arch maintainers, and I'd like a tested-by from Aneesh that this still works to solve the ppc issue. Jeff, does this look good to you? --- Aneesh reports that PowerPC requires 16MiB alignment for the address range passed to devm_memremap_pages(), and Jeff reports that it is possible to create a misaligned namespace which blocks future namespace creation in that region. Both of these issues require namespace alignment to be managed at the region level rather than padding at the namespace level which has been a broken approach to date. Introduce memremap_compat_align() to indicate the hard requirements of an arch's memremap_pages() implementation. Use the maximum known memremap_compat_align() to set the default namespace alignment for libnvdimm. Consult that alignment when allocating free space. Finally, allow the default region alignment to be overridden to maintain the same namespace creation capability as previous kernels. The ndctl unit tests, which have some misaligned namespace assumptions, are updated to use the alignment override where necessary. Thanks to Aneesh for early feedback and testing on this improved alignment handling. --- Dan Williams (4): mm/memremap_pages: Introduce memremap_compat_align() libnvdimm/namespace: Enforce memremap_compat_align() libnvdimm/region: Introduce NDD_LABELING libnvdimm/region: Introduce an 'align' attribute arch/powerpc/Kconfig | 1 arch/powerpc/mm/ioremap.c | 12 +++ arch/powerpc/platforms/pseries/papr_scm.c | 2 drivers/acpi/nfit/core.c | 4 + drivers/nvdimm/dimm.c | 2 drivers/nvdimm/dimm_devs.c | 95 +++++++++++++++++---- drivers/nvdimm/namespace_devs.c | 21 ++++- drivers/nvdimm/nd.h | 3 - drivers/nvdimm/pfn_devs.c | 2 drivers/nvdimm/region_devs.c | 132 ++++++++++++++++++++++++++--- include/linux/libnvdimm.h | 2 include/linux/memremap.h | 8 ++ include/linux/mmzone.h | 1 lib/Kconfig | 3 + mm/memremap.c | 13 +++ 15 files changed, 260 insertions(+), 41 deletions(-) -- base-commit: 543506a2936aaced94bcc8731aae5d29d0442e90