All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "msys.mizuma@gmail.com" <msys.mizuma@gmail.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCHv4] ndctl: Use max_available_extent for namespace
Date: Fri, 3 Aug 2018 17:09:33 +0000	[thread overview]
Message-ID: <1533316172.8557.70.camel@intel.com> (raw)
In-Reply-To: <c8fdf822-edd6-f87f-f191-965fff9f5f36@gmail.com>


On Fri, 2018-08-03 at 12:26 -0400, Masayoshi Mizuma wrote:
> Hi Vishal,
> 
> On 08/02/2018 04:42 PM, Masayoshi Mizuma wrote:
> ...
> > > If you also wanted to package up this script as a unit test, I'd be
> > > happy to include it. Would be gated on KVER=4.19
> > 
> > Sounds great :-) 
> > Here is the patch for unit test:
> > 
> > --------
> > From: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > Date: Thu, 2 Aug 2018 16:20:45 -0400
> > Subject: [PATCH] ndctl, test: add a new unit test for max_available_extent
> >  namespace
> > 
> > Add a new unit test to test max_available_extent namespace.
> > This function is implemented by the following patches.
> > 
> >   kernel side:
> >     https://lists.01.org/pipermail/linux-nvdimm/2018-July/016731.html
> >     https://lists.01.org/pipermail/linux-nvdimm/2018-July/016732.html
> > 
> >   ndctl side:
> >     https://lists.01.org/pipermail/linux-nvdimm/2018-July/017176.html
> > 
> > Signed-off-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com>
> > ---
> >  test/Makefile.am                |  3 ++-
> >  test/max_available_extent_ns.sh | 43 +++++++++++++++++++++++++++++++++
> >  2 files changed, 45 insertions(+), 1 deletion(-)
> >  create mode 100755 test/max_available_extent_ns.sh
> > 
> > diff --git a/test/Makefile.am b/test/Makefile.am
> > index 8c55056..9af2464 100644
> > --- a/test/Makefile.am
> > +++ b/test/Makefile.am
> > @@ -22,7 +22,8 @@ TESTS =\
> >  	firmware-update.sh \
> >  	ack-shutdown-count-set \
> >  	rescan-partitions.sh \
> > -	monitor.sh
> > +	monitor.sh \
> > +	max_available_extent_ns.sh
> >  
> >  check_PROGRAMS =\
> >  	libndctl \
> > diff --git a/test/max_available_extent_ns.sh b/test/max_available_extent_ns.sh
> > new file mode 100755
> > index 0000000..4a44625
> > --- /dev/null
> > +++ b/test/max_available_extent_ns.sh
> > @@ -0,0 +1,43 @@
> > +#!/bin/bash -Ex
> > +
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright(c) 2018, FUJITSU LIMITED. All rights reserved.
> > +
> > +rc=77
> > +
> > +. ./common
> > +
> > +trap 'err $LINENO' ERR
> > +
> > +check_min_kver "4.19" || do_skip "kernel $KVER may not support max_available_size"
> > +
> > +init()
> > +{
> > +	$NDCTL disable-region -b $NFIT_TEST_BUS0 all
> > +	$NDCTL zero-labels -b $NFIT_TEST_BUS0 all
> > +	$NDCTL enable-region -b $NFIT_TEST_BUS0 all
> > +}
> > +
> > +do_test()
> > +{
> > +	region=$($NDCTL list -b nfit_test.0 -R -t pmem | jq -r .[].dev | head -1)
> 
> nfit_test.0 here should be changed to $NFIT_TEST_BUS0.
> Please let me know if I should send the v2 patch.

Ah yes good catch. I hadn't gotten around to applying it yet, so yeah
please send a v2

Thanks,
	-Vishal

> 
> Thanks!
> Masa
> 
> > +
> > +	available_sz=$($NDCTL list -r $region | jq -r .[].available_size)
> > +	size=$(( available_sz/4 ))
> > +
> > +	NS1=$($NDCTL create-namespace -r $region -t pmem -s $size | jq -r .dev)
> > +	NS2=$($NDCTL create-namespace -r $region -t pmem -s $size | jq -r .dev)
> > +	NS3=$($NDCTL create-namespace -r $region -t pmem -s $size | jq -r .dev)
> > +
> > +	$NDCTL disable-namespace $NS2
> > +	$NDCTL destroy-namespace $NS2
> > +
> > +	$NDCTL create-namespace -r $region -t pmem
> > +}
> > +
> > +modprobe nfit_test
> > +rc=1
> > +init
> > +do_test
> > +_cleanup
> > +exit 0
> > 
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

      reply	other threads:[~2018-08-03 17:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-24 22:31 [ndctl PATCHv4] ndctl: Use max_available_extent for namespace Keith Busch
2018-08-02 19:49 ` Masayoshi Mizuma
2018-08-02 19:53   ` Verma, Vishal L
2018-08-02 20:42     ` Masayoshi Mizuma
2018-08-03 16:26       ` Masayoshi Mizuma
2018-08-03 17:09         ` Verma, Vishal L [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=1533316172.8557.70.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=msys.mizuma@gmail.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.