mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dexuan Cui <decui@microsoft.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Josh Poulson <jopoulso@microsoft.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michael Kelley <mikelley@microsoft.com>,
	Sasha Levin <Alexander.Levin@microsoft.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	Ross Zwisler <zwisler@kernel.org>,
	Stephen Hemminger <sthemmin@microsoft.com>,
	KY Srinivasan <kys@microsoft.com>, Len Brown <lenb@kernel.org>
Subject: RE: [PATCH v2] nfit: add Hyper-V NVDIMM DSM command set to white list
Date: Sat, 2 Feb 2019 02:17:19 +0000	[thread overview]
Message-ID: <PU1P153MB0169FBCCB5639054FC0E6DB6BF930@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CAPcyv4iEcCG0h+HLPkfSC0aNDLq9hdoO00XErF93PHTmEgO-TQ@mail.gmail.com>

> From: Dan Williams <dan.j.williams@intel.com>
> Sent: Friday, February 1, 2019 5:29 PM
> > ...
> > The "size" and "mode" still don't look right, but the improvement is that
> > now I can see a good descriptive "name", which I suppose is retrieved
> > from Hyper-V.
> 
> Mode is right, there is no way for Hyper-V to create Linux fsdax mode
> namespaces it requires some setup using variables only Linux knows.
> Can you send the output of:
> 
> ndctl read-labels -j all

The output is from a kernel built with the libnvdimm-pending branch plus
the one-line patch (label->flags &= ~NSLABEL_FLAG_LOCAL) in 
init_active_labels():

root@decui-gen2-u1904:~# ndctl read-labels -j all
[
  {
    "dev":"nmem1",
    "index":[
      {
        "signature":"NAMESPACE_INDEX",
        "major":1,
        "minor":2,
        "labelsize":256,
        "seq":1,
        "nslot":2
      },
      {
        "signature":"NAMESPACE_INDEX",
        "major":1,
        "minor":2,
        "labelsize":256,
        "seq":2,
        "nslot":2
      }
    ],
    "label":[
      {
        "uuid":"c258aaab-f72b-e546-bfa5-be5e07761dbc",
        "name":"Microsoft Hyper-V NVDIMM 1 Label",
        "slot":0,
        "position":0,
        "nlabel":1,
        "isetcookie":708891662257476870,
        "lbasize":0,
        "dpa":0,
        "rawsize":137438953472,
        "type_guid":"79d3f066-f3b4-7440-ac43-0d3318b78cdb",
        "abstraction_guid":"00000000-0000-0000-0000-000000000000"
      }
    ]
  },
  {
    "dev":"nmem0",
    "index":[
      {
        "signature":"NAMESPACE_INDEX",
        "major":1,
        "minor":2,
        "labelsize":256,
        "seq":1,
        "nslot":2
      },
      {
        "signature":"NAMESPACE_INDEX",
        "major":1,
        "minor":2,
        "labelsize":256,
        "seq":2,
        "nslot":2
      }
    ],
    "label":[
      {
        "uuid":"9f0497a7-4453-7c40-ad35-21a791e00345",
        "name":"Microsoft Hyper-V NVDIMM 0 Label",
        "slot":0,
        "position":0,
        "nlabel":1,
        "isetcookie":708891619307803909,
        "lbasize":0,
        "dpa":0,
        "rawsize":34359738368,
        "type_guid":"79d3f066-f3b4-7440-ac43-0d3318b78cdb",
        "abstraction_guid":"00000000-0000-0000-0000-000000000000"
      }
    ]
  }
]
read 2 nmems

> > With Ubuntu 19.04 (4.18.0-11-generic), I get this:
> > (Note: the "mode" and "size" are correct. The "uuid" is different from
> > the above "9f0497a7-4453-7c40-ad35-21a791e00345" -- this is weird.)
> >
> > root@decui-gen2-u1904:~# ndctl list
> > [
> >   {
> >     "dev":"namespace1.0",
> >     "mode":"raw",
> >     "size":137438953472,
> >     "blockdev":"pmem1"
> >   },
> >   {
> >     "dev":"namespace0.0",
> >     "mode":"fsdax",
> >     "map":"dev",
> >     "size":33820770304,
> >     "uuid":"35018886-397e-4fe7-a348-0a4d16eec44d",
> >     "blockdev":"pmem0"
> >   }
> > ]
> 
> This is because the Ubuntu kernel has the bug that causes _LSR to fail
> so Linux falls back to a namespace defined by the region boundary. On
> that namespace there is an "fsdax" info block located at the region
> base +4K. That info block is tagged with the uuid of
> "35018886-397e-4fe7-a348-0a4d16eec44d".
Thanks for the explanation!
 
> > I'm trying to find out the correct solution. I apprecite your insights!
> 
> It's a mess. First we need to figure out whether the label is actually
> specifying a size of zero, or there is some other bug.
I agree.
 
> However, the next problem is going to be adding "fsdax" mode support
> on top of the read-only defined namespaces. The ndctl reconfiguration
> flow:
> 
>    ndctl create-namespace -e namespace0.0 -m fsdax -f

> 
> ...will likely fail because deleting the previous namespace in the
> labels is part of that flow. It's always that labels are writable.
> 
> Honestly, the quickest path to something functional for Linux is to
> simply delete the _LSR support and use raw mode defined namespaces.
> Why have labels if they are read-only and the region is sufficient for
> defining boundaries?

Just now Hyper-V team confirmed _LSW is not supported.

But with Ubuntu 19.04 kernel (4.18.0-11-generic), I'm able to run the commands
without any issue:

root@decui-gen2-u1904:~# ndctl list
[
  {
    "dev":"namespace1.0",
    "mode":"raw",
    "size":137438953472,
    "blockdev":"pmem1"
  },
  {
    "dev":"namespace0.0",
    "mode":"fsdax",
    "map":"dev",
    "size":33820770304,
    "uuid":"35018886-397e-4fe7-a348-0a4d16eec44d",
    "blockdev":"pmem0"
  }
]

root@decui-gen2-u1904:~# ndctl destroy-namespace "namespace0.0"
  Error: namespace0.0 is active, specify --force for re-configuration

error destroying namespaces: Device or resource busy
destroyed 0 namespaces

root@decui-gen2-u1904:~# ndctl destroy-namespace "namespace0.0" --force
destroyed 1 namespace

root@decui-gen2-u1904:~# ndctl list
[
  {
    "dev":"namespace1.0",
    "mode":"raw",
    "size":137438953472,
    "blockdev":"pmem1"
  }
]

root@decui-gen2-u1904:~# ndctl create-namespace -e namespace0.0 -m fsdax -f
{
  "dev":"namespace0.0",
  "mode":"fsdax",
  "map":"dev",
  "size":"31.50 GiB (33.82 GB)",
  "uuid":"9e4e819b-e2eb-4796-8f9e-15f96f63b5c2",
  "sector_size":512,
  "blockdev":"pmem0",
  "numa_node":1
}

root@decui-gen2-u1904:~# ndctl list
[
  {
    "dev":"namespace1.0",
    "mode":"raw",
    "size":137438953472,
    "blockdev":"pmem1"
  },
  {
    "dev":"namespace0.0",
    "mode":"fsdax",
    "map":"dev",
    "size":33820770304,
    "uuid":"9e4e819b-e2eb-4796-8f9e-15f96f63b5c2",
    "blockdev":"pmem0"
  }
]


The above commands can also run fine with an upstream kernel that
doesn't have 
11189c1089da ("acpi/nfit: Fix command-supported detection")
or
1194c4133195 ("nfit: Add Hyper-V NVDIMM DSM command set to white list")

Thanks
-- Dexuan

  reply	other threads:[~2019-02-02  2:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  0:56 Dexuan Cui
2019-01-30  6:23 ` Dan Williams
2019-02-01 17:14   ` Dexuan Cui
2019-02-01 17:29     ` Dan Williams
2019-02-01 23:17       ` Dexuan Cui
2019-02-01 23:47         ` Dan Williams
2019-02-02  0:34           ` Dexuan Cui
2019-02-02  0:47             ` Dan Williams
2019-02-02  1:06             ` Dexuan Cui
2019-02-02  1:28               ` Dan Williams
2019-02-02  2:17                 ` Dexuan Cui [this message]
2019-02-02  5:27                   ` Dan Williams
2019-02-02  3:32                 ` Dexuan Cui
2019-02-02  5:26                   ` Dan Williams
2019-02-03  1:13     ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dan Williams
2019-02-03 14:31       ` kbuild test robot
2019-02-03 17:39         ` Dexuan Cui
2019-02-03 14:38       ` kbuild test robot
2019-02-03 17:40         ` Dexuan Cui
2019-02-03 17:21       ` Dexuan Cui
2019-02-03 17:49         ` Dan Williams
2019-02-03 18:13           ` Dexuan Cui
2019-02-03 19:13             ` Dan Williams
2019-02-03 19:28               ` [PATCH] acpi/nfit: Require opt-in for read-only label configurations Dan Williams
2019-02-04  5:45                 ` Dexuan Cui
2019-02-05 16:53               ` [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family Dexuan Cui
2019-02-05 17:11                 ` Dan Williams
2019-02-06  0:57                   ` Dexuan Cui
2019-02-13  4:14       ` [PATCH v2] " Dan Williams
2019-02-13  9:41         ` Johannes Thumshirn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=PU1P153MB0169FBCCB5639054FC0E6DB6BF930@PU1P153MB0169.APCP153.PROD.OUTLOOK.COM \
    --to=decui@microsoft.com \
    --cc=Alexander.Levin@microsoft.com \
    --cc=dan.j.williams@intel.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=jopoulso@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=mikelley@microsoft.com \
    --cc=rjw@rjwysocki.net \
    --cc=sthemmin@microsoft.com \
    --cc=zwisler@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®