Linux-NVDIMM Archive on lore.kernel.org
 help / color / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: "Verma, Vishal L" <vishal.l.verma@intel.com>
Cc: "Olson, Ben" <ben.olson@intel.com>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"dave.hansen@linux.intel.com" <dave.hansen@linux.intel.com>,
	"Biesek, Michal" <michal.biesek@intel.com>
Subject: Re: [ndctl PATCH 04/10] libdaxctl: add an API to determine if memory is movable
Date: Fri, 18 Oct 2019 13:40:48 -0700
Message-ID: <CAPcyv4hf8rW7D3o6ZaVKcgvG1iQ+H0pZyaz5wjrfzPSyA2Th2g@mail.gmail.com> (raw)
In-Reply-To: <dfd1bdbaa41c3f6e97834d592b32bb10ba562c6a.camel@intel.com>

On Fri, Oct 18, 2019 at 12:57 PM Verma, Vishal L
<vishal.l.verma@intel.com> wrote:
>
>
> On Fri, 2019-10-18 at 11:54 -0700, Dan Williams wrote:
> > On Wed, Oct 2, 2019 at 4:49 PM Vishal Verma <vishal.l.verma@intel.com> wrote:
> > > By default, daxctl always attempts to online new memory sections as
> > > 'movable' so that routine kernel allocations aren't serviced from this
> > > memory, and the memory is later removable via hot-unplug.
> > >
> > > System configuration, or other agents (such as udev rules) may race
> > > 'daxctl' to online memory, and this may result in the memory not being
> > > 'movable'. Add an interface to query the movability of a memory object
> > > associated with a dax device.
> > >
> > > This is in preparation to both display a 'movable' attribute in device
> > > listings, as well as optionally allowing memory to be onlined as
> > > non-movable.
> > >
> > > Cc: Dan Williams <dan.j.williams@intel.com>
> > > Reported-by: Ben Olson <ben.olson@intel.com>
> > > Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> > > ---
> > >  daxctl/lib/libdaxctl-private.h | 20 +++++++++
> > >  daxctl/lib/libdaxctl.c         | 77 ++++++++++++++++++++++++++++++++--
> > >  daxctl/lib/libdaxctl.sym       |  5 +++
> > >  daxctl/libdaxctl.h             |  1 +
> > >  4 files changed, 100 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/daxctl/lib/libdaxctl-private.h b/daxctl/lib/libdaxctl-private.h
> > > index 7ba3c46..82939bb 100644
> > > --- a/daxctl/lib/libdaxctl-private.h
> > > +++ b/daxctl/lib/libdaxctl-private.h
> > > @@ -44,6 +44,25 @@ enum memory_op {
> > >         MEM_SET_ONLINE,
> > >         MEM_IS_ONLINE,
> > >         MEM_COUNT,
> > > +       MEM_FIND_ZONE,
> >
> > This is private so the naming is not too big a concern, but isn't this
> > a MEM_GET_ZONE? A find operation to me is something that can succeed
> > to find nothing, whereas a get operation fail assumes the association
> > can always be retrieved barring exceptional conditions.
>
> Hm, my personal view of find vs. get was that 'get' grabs a reference
> (or similar) to something which we know how to get to (have a pointer
> directly) etc.

Oh, that's get as in get/put. I'm talking about get/set. Where the
zone is a property memblock that can set and retrieved.

> 'Find' is more of a 'go searching for' something - and it
> may involve walking and looping over data structures.
>
> But I'm not too opposed to this, and can change to 'get' if that follows
> convention better.

Like I said it's private, so it's not a big deal (i.e. API users won't
see it), but ndctl does have a few apis that walk and loop over data
structures using a get verb, or the ones that retrieve the dynamic
state of a sysfs attribute.

I will grant you that in hindsight some of the "get_by" apis might
have been better named "find".
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

  reply index

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02 23:49 [ndctl PATCH 00/10] fixes and movability for system-ram mode Vishal Verma
2019-10-02 23:49 ` [ndctl PATCH 01/10] libdaxctl: refactor path construction in op_for_one_memblock() Vishal Verma
2019-10-18 18:43   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 02/10] libdaxctl: refactor memblock_is_online() checks Vishal Verma
2019-10-18 18:45   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 03/10] daxctl/device.c: fix json output omission for reconfigure-device Vishal Verma
2019-10-18 18:46   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 04/10] libdaxctl: add an API to determine if memory is movable Vishal Verma
2019-10-18 18:54   ` Dan Williams
2019-10-18 19:57     ` Verma, Vishal L
2019-10-18 20:40       ` Dan Williams [this message]
2019-10-02 23:49 ` [ndctl PATCH 05/10] libdaxctl: allow memblock_in_dev() to return an error Vishal Verma
2019-10-18 19:15   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 06/10] daxctl: show a 'movable' attribute in device listings Vishal Verma
2019-10-18 19:16   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 07/10] daxctl: detect races when onlining memory blocks Vishal Verma
2019-10-18 19:26   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 08/10] Documentation: clarify memory movablity for reconfigure-device Vishal Verma
2019-10-18 20:46   ` Dan Williams
2019-10-18 20:50     ` Verma, Vishal L
2019-10-02 23:49 ` [ndctl PATCH 09/10] libdaxctl: add an API to online memory in a non-movable state Vishal Verma
2019-10-18 20:54   ` Dan Williams
2019-10-02 23:49 ` [ndctl PATCH 10/10] daxctl: add --no-movable option for onlining memory Vishal Verma
2019-10-18 20:58   ` Dan Williams
2019-10-18 21:04     ` Verma, Vishal L
2019-10-18 21:25       ` Dan Williams

Reply instructions:

You may reply publically 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=CAPcyv4hf8rW7D3o6ZaVKcgvG1iQ+H0pZyaz5wjrfzPSyA2Th2g@mail.gmail.com \
    --to=dan.j.williams@intel.com \
    --cc=ben.olson@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-nvdimm@lists.01.org \
    --cc=michal.biesek@intel.com \
    --cc=vishal.l.verma@intel.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

Linux-NVDIMM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-nvdimm/0 linux-nvdimm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-nvdimm linux-nvdimm/ https://lore.kernel.org/linux-nvdimm \
		linux-nvdimm@lists.01.org
	public-inbox-index linux-nvdimm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.01.lists.linux-nvdimm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git