Re: [PATCH] libnvdimm/dimm: Add a no-BLK quirk based on NVDIMM family

From: Dan Williams
Date: Sun Feb 03 2019 - 12:49:36 EST


On Sun, Feb 3, 2019 at 9:22 AM Dexuan Cui <decui@xxxxxxxxxxxxx> wrote:
>
> > From: Dan Williams <dan.j.williams@xxxxxxxxx>
> > Sent: Saturday, February 2, 2019 5:13 PM
> > ...
> > As Dexuan reports the NVDIMM_FAMILY_HYPERV platform is incompatible with
> > the existing Linux namespace implementation because it uses
> > NSLABEL_FLAG_LOCAL for x1-width PMEM interleave sets. Quirk it as an
> > platform / DIMM that does not provide BLK-aperture access. Allow the
> > libnvdimm core to assume no potential for aliasing. In case other
> > implementations make the same mistake, provide a "noblk" module
> > parameter to force-enable the quirk.
>
> Hi Dan,
> Thanks very much for the patch! With it, "ndctl list" can show the below:
>
> root@decui-gen2-u1904:~/ndctl# ndctl list
> [
> {
> "dev":"namespace1.0",
> "mode":"raw",
> "size":137438953472,
> "uuid":"c258aaab-f72b-e546-bfa5-be5e07761dbc",
> "blockdev":"pmem1",
> "name":"Microsoft Hyper-V NVDIMM 1 Label"
> },
> {
> "dev":"namespace0.0",
> "mode":"raw",
> "size":34359738368,
> "uuid":"9f0497a7-4453-7c40-ad35-21a791e00345",
> "blockdev":"pmem0",
> "name":"Microsoft Hyper-V NVDIMM 0 Label"
> }
> ]
>
> And /dev/pmem0 can appear, but /dev/pmem0p1 can not appear, and the "mode" of
> "namespace0.0" is not correct. With the Ubuntu 19.04 4.18 kenel, I get the below:
>
> root@decui-gen2-u1904:~/ndctl# ndctl list
> [
> {
> "dev":"namespace1.0",
> "mode":"raw",
> "size":137438953472,
> "blockdev":"pmem1"
> },
> {
> "dev":"namespace0.0",
> "mode":"fsdax",
> "map":"dev",
> "size":33820770304,
> "uuid":"ef028c4e-2b1f-4bf8-b92a-1109d7a1c914",
> "blockdev":"pmem0"
> }
> ]
> and /dev/pmem0p1 can appear.
>
> It looks the namespace created by Ubuntu 19.04 (4.18) is incompatible with
> the libnvdimm-pending branch + this patch.

This is correct, the configuration switched from label-less by default
to labeled.

> It looks we need to completely disable the label usage for NVDIMM_FAMILY_HYPERV
> due to compability?

It's either going to be a quirk in Linux or a quirk in the Hyper-V
configuration. I think it's more manageable for Hyper-V to ship a
"label disable" switch than to try to ship a workaround in Linux. The
"noblk" quirk in Linux works around the LOCAL bit in the labels.
However, the namespace mode regression can only be resolved by hiding
the label capability until the administrator manually switches from
label-less to labeled operation.