From patchwork Fri Feb 2 08:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10196397 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6708B60388 for ; Fri, 2 Feb 2018 08:38:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5138D28D75 for ; Fri, 2 Feb 2018 08:38:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45BD528E05; Fri, 2 Feb 2018 08:38:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D923128D75 for ; Fri, 2 Feb 2018 08:38:26 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 892402239363D; Fri, 2 Feb 2018 00:32:48 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.151; helo=mga17.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 8164D223CCF17 for ; Fri, 2 Feb 2018 00:32:46 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Feb 2018 00:38:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,447,1511856000"; d="scan'208";a="16447451" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by fmsmga002.fm.intel.com with ESMTP; 02 Feb 2018 00:38:24 -0800 Subject: [ndctl PATCH] ndctl: update minimum namespace size From: Dan Williams To: linux-nvdimm@lists.01.org Date: Fri, 02 Feb 2018 00:29:18 -0800 Message-ID: <151756015882.24501.9157437746399427723.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.17.1-9-g687f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP The kernel starting with version v4.16 supports a minimum namespace size as low as PAGE_SIZE. Update the dpa-alloc test to account for the fact that its 4K allocations may result in the namespace being activated with its parent region. Cc: Matthew Wilcox Reported-by: Cheng-mean Liu Signed-off-by: Dan Williams --- ndctl/ndctl.h | 3 ++- test/dpa-alloc.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h index 4cf373b2a5d4..eb5a9b387b3d 100644 --- a/ndctl/ndctl.h +++ b/ndctl/ndctl.h @@ -15,6 +15,7 @@ #include #include +#include struct nd_cmd_dimm_flags { __u32 status; @@ -210,7 +211,7 @@ enum nd_driver_flags { }; enum { - ND_MIN_NAMESPACE_SIZE = 0x00400000, + ND_MIN_NAMESPACE_SIZE = PAGE_SIZE, }; enum ars_masks { diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c index 7793650699da..8bb7dd7408a1 100644 --- a/test/dpa-alloc.c +++ b/test/dpa-alloc.c @@ -232,6 +232,11 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test) uuid_unparse(namespaces[i].uuid, uuid_str); size = ndctl_namespace_get_size(victim); + rc = ndctl_namespace_disable(victim); + if (rc) { + fprintf(stderr, "failed to disable %s\n", uuid_str); + return rc; + } rc = ndctl_namespace_delete(victim); if (rc) { fprintf(stderr, "failed to delete %s\n", uuid_str);