On Thu, Mar 22, 2018 at 11:40 AM, Ross Zwisler
<[email protected]> wrote:
> Instead of just failing to find namespaces when trying to filter by NUMA
> node when CONFIG_NUMA wasn't enabled in the kernel, instead fail loudly as
> numactl does:
>
> # numactl --cpunodebind=0 ls
> numactl: This system does not support NUMA policy
>
> Signed-off-by: Ross Zwisler <[email protected]>
> ---
>
> This enabling requires numactl to create a pkg-config file, which it
> currently does not. This support is added by the following patch which
> I just sent out:
>
> https://patchwork.kernel.org/patch/10302135/
Hmm, it's going to be a while for that to be picked up and filter out
into all the distributions so we can either wait for the next numactl
release to become commonly available, or rework this ndctl change to
be independent of pkgconfig dependency.
The other concern is that this affects the numa-node filtering, but it
doesn't effect the numa-node json field reported by 'ndctl list'. I
think it would be confusing to see numa-nodes in the listing, but
filtering fails just because of the way ndctl was configured at build
time.
[..]
> diff --git a/util/filter.c b/util/filter.c
> index 291d7ed..512f927 100644
> --- a/util/filter.c
> +++ b/util/filter.c
> @@ -10,6 +10,7 @@
> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> * General Public License for more details.
> */
> +#include <numa.h>
> #include <stdio.h>
> #include <string.h>
> #include <stdlib.h>
> @@ -328,6 +329,16 @@ int util_filter_walk(struct ndctl_ctx *ctx, struct
> util_filter_ctx *fctx,
> }
>
> if (param->numa_node && strcmp(param->numa_node, "all") != 0) {
> +#ifdef WITH_NUMA
> + if (numa_available() < 0) {
> + error("This system does not support NUMA");
> +#else
> + {
> + error("ndctl was not configured with NUMA support");
> +#endif
> + return -EINVAL;
> + }
> +
Please push this #ifdef'ery into a header file.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm