Linux-NVDIMM Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: Dan Williams <dan.j.williams@intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH ndctl v1 0/8] daxctl: Add device align and range mapping allocation
Date: Wed, 16 Dec 2020 21:35:14 +0000	[thread overview]
Message-ID: <0d77da52-c84f-5753-b55b-e510e807f151@oracle.com> (raw)
In-Reply-To: <CAPcyv4gWry3r8a46X9pnobFNwjQLqG-N2MyvKsx7abJhjadYTQ@mail.gmail.com>

On 12/16/20 7:13 PM, Dan Williams wrote:
> On Wed, Dec 16, 2020 at 3:41 AM Joao Martins <joao.m.martins@oracle.com> wrote:
>>
>> On 7/16/20 7:46 PM, Joao Martins wrote:
>>> Hey,
>>>
>>> This series builds on top of this one[0] and does the following improvements
>>> to the Soft-Reserved subdivision:
>>>
>>>  1) Support for {create,reconfigure}-device for selecting @align (hugepage size).
>>>  Here we add a '-a|--align 4K|2M|1G' option to the existing commands;
>>>
>>>  2) Listing improvements for device alignment and mappings;
>>>  Note: Perhaps it is better to hide the mappings by default, and only
>>>        print with -v|--verbose. This would align with ndctl, as the mappings
>>>        info can be quite large.
>>>
>>>  3) Allow creating devices from selecting ranges. This allows to keep the
>>>    same GPA->HPA mapping as before we kexec the hypervisor with running guests:
>>>
>>>    daxctl list -d dax0.1 > /var/log/dax0.1.json
>>>    kexec -d -l bzImage
>>>    systemctl kexec
>>>    daxctl create -u --restore /var/log/dax0.1.json
>>>
>>>    The JSON was what I though it would be easier for an user, given that it is
>>>    the data format daxctl outputs. Alternatives could be adding multiple:
>>>       --mapping <pgoff>:<start>-<end>
>>>
>>>    But that could end up in a gigantic line and a little more
>>>    unmanageable I think.
>>>
>>> This series requires this series[0] on top of Dan's patches[1]:
>>>
>>>  [0] https://lore.kernel.org/linux-nvdimm/20200716172913.19658-1-joao.m.martins@oracle.com/
>>>  [1] https://lore.kernel.org/linux-nvdimm/159457116473.754248.7879464730875147365.stgit@dwillia2-desk3.amr.corp.intel.com/
>>>
>>> The only TODO here is docs and improving tests to validate mappings, and test
>>> the restore path.
>>>
>>> Suggestions/comments are welcome.
>>>
>> There's a couple of issues in this series regarding daxctl-reconfigure options and
>> breakage of ndctl with kernels (<5.10) that do not supply a device @align upon testing
>> with NVDIMMs. Plus it is missing daxctl-create.sh unit test for @align.
> 
> What's the breakage with older kernels, is it the kernel regressing
> old daxctl, or is it new daxctl being incompatible with old kernels?
> If it's the latter, it needs a fixup, if it's the former it needs a
> kernel compat change.

It's the latter i.e. new daxctl being incompatible with old kernels, because of a change
in the first patch. Essentially a wrong assumption of device align being always available
in add_dax_dev().

The fixup would be this snip below to the first patch. But I will respin the first four
patches today or my morning tomorrow, with a test.

diff --git a/daxctl/lib/libdaxctl.c b/daxctl/lib/libdaxctl.c
index 14bf48dd00bf..b01cc916eb6e 100644
--- a/daxctl/lib/libdaxctl.c
+++ b/daxctl/lib/libdaxctl.c
@@ -498,10 +498,12 @@ static void *add_dax_dev(void *parent, int id, const char *daxdev_base)
                goto err_read;
        dev->size = strtoull(buf, NULL, 0);

+       /* Device align attribute is only available in v5.10 or up */
        sprintf(path, "%s/align", daxdev_base);
-       if (sysfs_read_attr(ctx, path, buf) < 0)
-               goto err_read;
-       dev->align = strtoull(buf, NULL, 0);
+       if (!sysfs_read_attr(ctx, path, buf))
+               dev->align = strtoull(buf, NULL, 0);
+       else
+               dev->align = 0;

        dev->dev_path = strdup(daxdev_base);
        if (!dev->dev_path)
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

      reply	other threads:[~2020-12-16 21:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16 18:46 [PATCH ndctl v1 0/8] daxctl: Add device align and range mapping allocation Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 1/8] daxctl: add daxctl_dev_{get,set}_align() Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 2/8] util/json: Print device align Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 3/8] daxctl: add align support in reconfigure-device Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 4/8] daxctl: add align support in create-device Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 5/8] libdaxctl: add mapping iterator APIs Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 6/8] daxctl: include mappings when listing Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 7/8] libdaxctl: add daxctl_dev_set_mapping() Joao Martins
2020-07-16 18:47 ` [PATCH ndctl v1 8/8] daxctl: Allow restore devices from JSON metadata Joao Martins
2020-12-16 11:39 ` [PATCH ndctl v1 0/8] daxctl: Add device align and range mapping allocation Joao Martins
2020-12-16 18:42   ` Verma, Vishal L
2020-12-16 21:49     ` Joao Martins
2020-12-16 22:31       ` Dan Williams
2020-12-16 22:53         ` Joao Martins
2020-12-16 23:42           ` Dan Williams
2020-12-17 11:23             ` Joao Martins
2020-12-17 20:18               ` Verma, Vishal L
2020-12-16 19:13   ` Dan Williams
2020-12-16 21:35     ` Joao Martins [this message]

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=0d77da52-c84f-5753-b55b-e510e807f151@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-nvdimm@lists.01.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