All of lore.kernel.org
 help / color / mirror / Atom feed
From: Santosh Sivaraj <santosh@fossix.org>
To: Dan Williams <dan.j.williams@intel.com>
Cc: Linux NVDIMM <linux-nvdimm@lists.01.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	Vaibhav Jain <vaibhav@linux.ibm.com>,
	Shivaprasad G Bhat <sbhat@linux.ibm.com>,
	Harish Sriram <harish@linux.ibm.com>
Subject: Re: [ndctl 5/5] Use page size as alignment value
Date: Thu, 25 Feb 2021 11:24:12 +0530	[thread overview]
Message-ID: <87mtvselq3.fsf@santosiv.in.ibm.com> (raw)
In-Reply-To: <CAPcyv4inaEKt4s5vNGsbfidCz+biWJk6QTLyOMWB05iFreOMfA@mail.gmail.com>

Dan Williams <dan.j.williams@intel.com> writes:

> On Mon, Dec 21, 2020 at 8:26 PM Santosh Sivaraj <santosh@fossix.org> wrote:
>>
>> The alignment sizes passed to ndctl in the tests are all hardcoded to 4k,
>> the default page size on x86. Change those to the default page size on that
>> architecture (sysconf/getconf). No functional changes otherwise.
>>
>> Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
>> ---
>>  test/dpa-alloc.c    | 23 ++++++++++++++---------
>>  test/multi-dax.sh   |  6 ++++--
>>  test/sector-mode.sh |  4 +++-
>>  3 files changed, 21 insertions(+), 12 deletions(-)
>>
>> diff --git a/test/dpa-alloc.c b/test/dpa-alloc.c
>> index 10af189..ff6143e 100644
>> --- a/test/dpa-alloc.c
>> +++ b/test/dpa-alloc.c
>> @@ -48,12 +48,13 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>         struct ndctl_region *region, *blk_region = NULL;
>>         struct ndctl_namespace *ndns;
>>         struct ndctl_dimm *dimm;
>> -       unsigned long size;
>> +       unsigned long size, page_size;
>>         struct ndctl_bus *bus;
>>         char uuid_str[40];
>>         int round;
>>         int rc;
>>
>> +       page_size = sysconf(_SC_PAGESIZE);
>>         /* disable nfit_test.1, not used in this test */
>>         bus = ndctl_bus_get_by_provider(ctx, NFIT_PROVIDER1);
>>         if (!bus)
>> @@ -134,11 +135,11 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>                         return rc;
>>                 }
>>                 ndctl_namespace_disable_invalidate(ndns);
>> -               rc = ndctl_namespace_set_size(ndns, SZ_4K);
>> +               rc = ndctl_namespace_set_size(ndns, page_size);
>>                 if (rc) {
>> -                       fprintf(stderr, "failed to init %s to size: %d\n",
>> +                       fprintf(stderr, "failed to init %s to size: %lu\n",
>>                                         ndctl_namespace_get_devname(ndns),
>> -                                       SZ_4K);
>> +                                       page_size);
>>                         return rc;
>>                 }
>>                 namespaces[i].ndns = ndns;
>> @@ -160,7 +161,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>                 ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns;
>>                 if (i % ARRAY_SIZE(namespaces) == 0)
>>                         round++;
>> -               size = SZ_4K * round;
>> +               size = page_size * round;
>>                 rc = ndctl_namespace_set_size(ndns, size);
>>                 if (rc) {
>>                         fprintf(stderr, "%s: set_size: %lx failed: %d\n",
>> @@ -176,7 +177,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>         i--;
>>         round++;
>>         ndns = namespaces[i % ARRAY_SIZE(namespaces)].ndns;
>> -       size = SZ_4K * round;
>> +       size = page_size * round;
>>         rc = ndctl_namespace_set_size(ndns, size);
>>         if (rc) {
>>                 fprintf(stderr, "%s failed to update while labels full\n",
>> @@ -185,7 +186,7 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>         }
>>
>>         round--;
>> -       size = SZ_4K * round;
>> +       size = page_size * round;
>>         rc = ndctl_namespace_set_size(ndns, size);
>>         if (rc) {
>>                 fprintf(stderr, "%s failed to reduce size while labels full\n",
>> @@ -279,8 +280,12 @@ static int do_test(struct ndctl_ctx *ctx, struct ndctl_test *test)
>>
>>         available_slots = ndctl_dimm_get_available_labels(dimm);
>>         if (available_slots != default_available_slots - 1) {
>> -               fprintf(stderr, "mishandled slot count\n");
>> -               return -ENXIO;
>> +               fprintf(stderr, "mishandled slot count (%u, %u)\n",
>> +                       available_slots, default_available_slots - 1);
>> +
>> +               /* TODO: fix it on non-acpi platforms */
>> +               if (ndctl_bus_has_nfit(bus))
>> +                       return -ENXIO;
>
> This change seems unrelated to page size fixups. Care to break it out?

This change is not required, I have already fixed this up. Refactoring residue.

Thanks,
Santosh
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  parent reply	other threads:[~2021-02-25  5:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22  4:22 [0/7] PMEM device emulation without nfit depenency Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 1/7] testing/nvdimm: Add test module for non-nfit platforms Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 2/7] ndtest: Add compatability string to treat it as PAPR family Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 3/7] ndtest: Add dimms to the two buses Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 4/7] ndtest: Add dimm attributes Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 5/7] ndtest: Add regions and mappings to the test buses Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 6/7] ndtest: Add nvdimm control functions Santosh Sivaraj
2020-12-22  4:22 ` [PATCH 7/7] ndtest: Add papr health related flags Santosh Sivaraj
2020-12-22  4:25 ` [ndctl 1/5] libndctl: test enablement for non-nfit devices Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 2/5] test: Don't skip tests if nfit modules are missing Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 3/5] papr: Add support to parse save_fail flag for dimm Santosh Sivaraj
2021-01-28  1:16     ` Dan Williams
2021-02-25  5:53       ` Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 4/5] test/libndctl: skip SMART tests on non-nfit devices Santosh Sivaraj
2020-12-22  4:25   ` [ndctl 5/5] Use page size as alignment value Santosh Sivaraj
2021-01-28  1:24     ` Dan Williams
2021-01-29  6:24       ` Santosh Sivaraj
2021-02-25  5:54       ` Santosh Sivaraj [this message]
2020-12-24 18:26 ` [0/7] PMEM device emulation without nfit depenency Dan Williams

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=87mtvselq3.fsf@santosiv.in.ibm.com \
    --to=santosh@fossix.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dan.j.williams@intel.com \
    --cc=harish@linux.ibm.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=sbhat@linux.ibm.com \
    --cc=vaibhav@linux.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.