From patchwork Thu Mar 8 23:57:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Zwisler X-Patchwork-Id: 10269451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A70E6016D for ; Thu, 8 Mar 2018 23:57:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66E91299D2 for ; Thu, 8 Mar 2018 23:57:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5A46029B3B; Thu, 8 Mar 2018 23:57:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C9E26299D2 for ; Thu, 8 Mar 2018 23:57:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 723412256862D; Thu, 8 Mar 2018 15:51:06 -0800 (PST) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: None (no SPF record) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=ross.zwisler@linux.intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 74BC522568613 for ; Thu, 8 Mar 2018 15:51:05 -0800 (PST) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Mar 2018 15:57:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,443,1515484800"; d="scan'208";a="35781928" Received: from theros.lm.intel.com (HELO linux.intel.com) ([10.232.112.164]) by fmsmga004.fm.intel.com with ESMTP; 08 Mar 2018 15:57:21 -0800 Date: Thu, 8 Mar 2018 16:57:20 -0700 From: Ross Zwisler To: Vishal Verma Subject: Re: [PATCH v2 3/3] ndctl: add filtering based on numa_node Message-ID: <20180308235720.GA14624@linux.intel.com> References: <20180307185355.4425-1-ross.zwisler@linux.intel.com> <20180308210809.GA11622@vverma7-desk1.amr.corp.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180308210809.GA11622@vverma7-desk1.amr.corp.intel.com> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-nvdimm Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP On Thu, Mar 08, 2018 at 02:08:09PM -0700, Vishal Verma wrote: > On 03/07, Ross Zwisler wrote: > > Add support to 'ndctl list' so that we can filter DIMMs, regions and > > namespaces based on numa node. > > > > Signed-off-by: Ross Zwisler > > --- > > v2: Use NUMA_NO_NODE intead of hard coding -1 (Dan). > > --- > > Documentation/ndctl/ndctl-list.txt | 4 ++++ > > ndctl/list.c | 2 ++ > > util/filter.c | 40 ++++++++++++++++++++++++++++++++++++-- > > util/filter.h | 1 + > > 4 files changed, 45 insertions(+), 2 deletions(-) > > > > Here is the bash completion update for this option. > I've tested it on my single-node VM, but Ross, can you test it on your > setup and let me know if it completes for the available nodes fine? > > Thanks, > -Vishal > > 8<----- > > From c744e77f26a27e10cc9dd8ca9b1092a45d9d9dcd Mon Sep 17 00:00:00 2001 > From: Vishal Verma > Date: Thu, 8 Mar 2018 13:56:59 -0700 > Subject: [ndctl PATCH] ndctl, bash-completion: add completion for --numa-node > > ndctl list can now accept a --numa-node option for filtering by numa > node. Use the nodes in /sys/devices/system/node to provide completion > options for available nodes. > > Cc: Ross Zwisler > Signed-off-by: Vishal Verma Yep, this works like a charm. You can add: Tested-by: Ross Zwisler For v3 of my patch which changed numa_node to numa-node I had to make the following changes to your patch (just s/numa_node/numa-node/ in 2 places): diff --git a/contrib/ndctl b/contrib/ndctl index b1f5e59..a3a8675 100755 --- a/contrib/ndctl +++ b/contrib/ndctl @@ -91,7 +91,7 @@ __ndctlcomp() COMPREPLY=( $( compgen -W "$1" -- "$2" ) ) for cword in "${COMPREPLY[@]}"; do - if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count|--firmware|--media-temperature|--ctrl-temperature|--spares|--media-temperature-threshold|--ctrl-temperature-threshold|--spares-threshold|--media-temperature-alarm|--ctrl-temperature-alarm|--spares-alarm|--numa_node) ]]; then + if [[ "$cword" == @(--bus|--region|--type|--mode|--size|--dimm|--reconfig|--uuid|--name|--sector-size|--map|--namespace|--input|--output|--label-version|--align|--block|--count|--firmware|--media-temperature|--ctrl-temperature|--spares|--media-temperature-threshold|--ctrl-temperature-threshold|--spares-threshold|--media-temperature-alarm|--ctrl-temperature-alarm|--spares-alarm|--numa-node) ]]; then COMPREPLY[$i]="${cword}=" else COMPREPLY[$i]="${cword} " @@ -232,7 +232,7 @@ __ndctl_comp_options() --spares-alarm) opts="on off" ;; - --numa_node) + --numa-node) opts=$(__ndctl_get_nodes) ;; *)