From: Dan Williams <dan.j.williams@intel.com>
To: Ross Zwisler <ross.zwisler@linux.intel.com>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>
Subject: Re: [ndctl PATCH] ndctl: fail NUMA filtering when unsupported
Date: Fri, 23 Mar 2018 16:31:44 -0700 [thread overview]
Message-ID: <CAPcyv4ht8h=upoJCN4j4jVm89=ZQ9Huq10ahmVsTEMuB4sporw@mail.gmail.com> (raw)
In-Reply-To: <20180323230849.3754-1-ross.zwisler@linux.intel.com>
On Fri, Mar 23, 2018 at 4:08 PM, Ross Zwisler
<ross.zwisler@linux.intel.com> wrote:
> For systems that don't support NUMA, numactl gives a loud and fatal error:
>
> # numactl -N 0 ls
> numactl: This system does not support NUMA policy
>
> Follow this model in ndctl for NUMA based filtering:
>
> # ./ndctl/ndctl list --numa-node=0
> Error: This system does not support NUMA
>
> This is done instead of just quietly filtering out all dimms, regions and
> namespaces because the NUMA node they were trying to match didn't exist in
> the system.
>
> libnuma tests whether NUMA is enabled via the get_mempolicy() syscall,
> passing in all NULLs and 0s for arguments to always get the default policy.
> See numa_available() in numa(3) and in the numactl source.
>
> ndctl checks sysfs for the existence of the /sys/devices/system/node
> directory to avoid a dependency on libnuma. If we had a dependency on
> libnuma we would have to choose whether this was fulfilled or not at
> compile time, which would potentially mean that we could be on a
> NUMA-enabled kernel but with an ndctl where NUMA support was disabled.
> It's better to always have NUMA support in ndctl and only depend on the
> kernel config.
>
> I've inspected the code for both get_mempolicy() and the code that creates
> the /sys/devices/system/node directory, and they both seem to completely
> rely on CONFIG_NUMA being defined. If CONFIG_NUMA is set, get_mempolicy()
> will always be able to return a default policy and /sys/devices/system/node
> will always exist. Otherwise, both checks will always fail. So, numactl
> and ndctl should always agree on whether NUMA is supported on a given
> system.
>
> Signed-off-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Suggested-by: Dan Williams <dan.j.williams@intel.com>
> ---
>
> v3: Changed back to checking /sys/devices/system/node instead of using
> libnuma, and added more info to the changelog.
Looks good, applied.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm
next prev parent reply other threads:[~2018-03-23 23:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-23 23:08 [ndctl PATCH] ndctl: fail NUMA filtering when unsupported Ross Zwisler
2018-03-23 23:31 ` Dan Williams [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-03-09 23:34 Ross Zwisler
2018-03-09 23:47 ` Verma, Vishal L
2018-03-10 0:20 ` 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='CAPcyv4ht8h=upoJCN4j4jVm89=ZQ9Huq10ahmVsTEMuB4sporw@mail.gmail.com' \
--to=dan.j.williams@intel.com \
--cc=linux-nvdimm@lists.01.org \
--cc=ross.zwisler@linux.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
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;
as well as URLs for NNTP newsgroup(s).