From patchwork Thu Jan 11 18:49:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Cheng-mean Liu (SOCCER)" X-Patchwork-Id: 10158341 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 8E55D601A1 for ; Thu, 11 Jan 2018 18:49:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7683328837 for ; Thu, 11 Jan 2018 18:49:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AD9A2883D; Thu, 11 Jan 2018 18:49:24 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no 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 E30A328837 for ; Thu, 11 Jan 2018 18:49:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 386992220D20A; Thu, 11 Jan 2018 10:44:09 -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=104.47.38.135; helo=nam02-bl2-obe.outbound.protection.outlook.com; envelope-from=soccerl@microsoft.com; receiver=linux-nvdimm@lists.01.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0135.outbound.protection.outlook.com [104.47.38.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 59C3C2220D200 for ; Thu, 11 Jan 2018 10:44:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=gpAqHhpbAvPvZU/juTD0rce9qJUw/+H0DT6kxw0PYBw=; b=N08F1d6cLs/0YVgG2kx3oMiYK+p5ovtRdS+KkYqNn60W7wE16/53ioFG9z2AXCb5esIIhEZR7IuZ8bTCg3DVILzMAhcnDYwiBIzBhIW1zHdMoOMEm59NzcNHB6AKBO/C1mB7GnVS469EofneKoxRH1Vvzhn4iW1THWiTzEiSqs0= Received: from MWHPR21MB0749.namprd21.prod.outlook.com (10.173.51.11) by MWHPR21MB0832.namprd21.prod.outlook.com (10.173.51.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.428.4; Thu, 11 Jan 2018 18:49:18 +0000 Received: from MWHPR21MB0749.namprd21.prod.outlook.com ([10.173.51.11]) by MWHPR21MB0749.namprd21.prod.outlook.com ([10.173.51.11]) with mapi id 15.20.0428.002; Thu, 11 Jan 2018 18:49:17 +0000 From: "Cheng-mean Liu (SOCCER)" To: "linux-nvdimm@lists.01.org" , Dan Williams Subject: [PATCH] NVDIMM: Reduced-the-ND_MIN_NAMESPACE_SIZE-from-4MB-to-4KB Thread-Topic: [PATCH] NVDIMM: Reduced-the-ND_MIN_NAMESPACE_SIZE-from-4MB-to-4KB Thread-Index: AdOLDFGEV32jLGhrSN6hhFrPyZtuGQ== Date: Thu, 11 Jan 2018 18:49:17 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [2001:4898:80e8:8::499] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR21MB0832; 7:BU0vj5Ej4GyqFB9nyYI3rjCQ0OB5Xudg6gnAVVh44eSW1VoP41e75AcVecTPGltBeE9XU7p8Ayq/fiCP9O+8Uyok9pWftRXMhl67e7yiZKkIvdb3aUbNkjX177dnHI99VNpgF2PeHlpOQJtDb8oAnSFtIP7YtFU1DROB7m5FnDGLu0JWRZ4dyVyJZR+qeS0LoTHiE+22FSXbkxYkcSUgHbf/tczz21pTsGpDrmwuDX7cGMJ3zj+3WUyfppgnmRNv x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10019020)(396003)(346002)(39860400002)(39380400002)(376002)(366004)(189003)(199004)(8676002)(7696005)(6116002)(81156014)(14454004)(81166006)(59450400001)(3660700001)(68736007)(10090500001)(53546011)(7736002)(6506007)(102836004)(33656002)(8936002)(2501003)(97736004)(2900100001)(230783001)(74316002)(2906002)(3280700002)(478600001)(106356001)(6306002)(4326008)(55016002)(54896002)(86362001)(316002)(575784001)(39060400002)(6436002)(73180200002)(77096006)(25786009)(5660300001)(99286004)(53936002)(8990500004)(86612001)(110136005)(105586002)(10290500003)(790700001)(22452003)(9686003)(54906003)(584604001); DIR:OUT; SFP:1102; SCL:1; SRVR:MWHPR21MB0832; H:MWHPR21MB0749.namprd21.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; x-ms-office365-filtering-correlation-id: 044f6bf7-166b-48a8-9b5c-08d5592404c6 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020070)(4652020)(4534100)(4602075)(4627196)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7193020); SRVR:MWHPR21MB0832; x-ms-traffictypediagnostic: MWHPR21MB0832: authentication-results: spf=none (sender IP is ) smtp.mailfrom=soccerl@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(61425038)(6040470)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231023)(944501134)(93006095)(93001095)(6055026)(61426038)(61427038)(6041268)(20161123562045)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR21MB0832; BCL:0; PCL:0; RULEID:(100000803126)(100110400120); SRVR:MWHPR21MB0832; x-forefront-prvs: 0549E6FD50 received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: A2Tv7WXXeKjpIRRxyqYo3ETCCzegnucU+rUVXW/GluYdbDTAQSHSFDQm22dxX4uUx4EjVF59DC9okgqZyGcdww== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 044f6bf7-166b-48a8-9b5c-08d5592404c6 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jan 2018 18:49:17.4671 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR21MB0832 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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: , Cc: Matthew Wilcox , Matthew Wilcox Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP In the case of emulated NVDIMM devices in the VM environment, there are scenarios that NVDIMM device with much smaller sizes are desired, for example, we might use a single enumerated NVDIMM DAX device for representing each container layer, which in some cases could be just a few KBs size.The current ND_MIN_NAMESPACE_SIZE is 4MB. To avoid wasting address and inefficient zero padding for meeting this 4MB min requirement, the proposed change is to reduce it to 4KB, a single page size, is a size good for all platforms. Two patches are included in this request : 1. A patch for Linux kernel changes 2. A patch for ndctl project to keep it in sync with the Linux kernel header file From 29e173c32661d976cda073438979991167ee13fc Mon Sep 17 00:00:00 2001 From: Cheng-mean Liu Date: Thu, 11 Jan 2018 10:06:13 -0800 Subject: [PATCH] reduced the ND_MIN_NAMESPACE_SIZE from 4MB to 4KB Signed-off-by: Cheng-mean Liu --- include/uapi/linux/ndctl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/uapi/linux/ndctl.h b/include/uapi/linux/ndctl.h index 3f03567631cb..e63c201ed1ef 100644 --- a/include/uapi/linux/ndctl.h +++ b/include/uapi/linux/ndctl.h @@ -263,7 +263,7 @@ enum nd_driver_flags { }; enum { - ND_MIN_NAMESPACE_SIZE = 0x00400000, + ND_MIN_NAMESPACE_SIZE = 0x00001000, }; enum ars_masks { -- 2.11.0 From 2bf3e2bbfae81ab50d141571414c0e6556bc0e0c Mon Sep 17 00:00:00 2001 From: Cheng-mean Liu Date: Thu, 11 Jan 2018 10:02:52 -0800 Subject: [PATCH] reduced the ND_MIN_NAMESPACE_SIZE from 4MB to 4KB Signed-off-by: Cheng-mean Liu --- ndctl/ndctl.h | 2 +- test/dpa-alloc.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ndctl/ndctl.h b/ndctl/ndctl.h index 5e6905c..8c14d90 100644 --- a/ndctl/ndctl.h +++ b/ndctl/ndctl.h @@ -263,7 +263,7 @@ enum nd_driver_flags { }; enum { - ND_MIN_NAMESPACE_SIZE = 0x00400000, + ND_MIN_NAMESPACE_SIZE = 0x00001000, }; enum ars_masks { diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c index d13cf5d..ba3deed 100644 --- a/test/dpa-alloc.c +++ b/test/dpa-alloc.c @@ -237,6 +237,12 @@ 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_invalidate(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); -- 2.11.0