From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A05DA09DF; Wed, 2 Dec 2020 19:20:11 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 78533C99C; Wed, 2 Dec 2020 19:20:09 +0100 (CET) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 63360C988 for ; Wed, 2 Dec 2020 19:20:07 +0100 (CET) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B2I38Bp109905; Wed, 2 Dec 2020 13:20:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=OPqc8JKVdufXcdeTsMtr5ZzB2ReQRN8tmsjQfmRRRLE=; b=JKoOczwpSbyOVaZtyYzzbP0JHSU6RGGozmPqOY1ZUKJZ41Jc0rIiDw3xvvzmU1IO769q tqYkfn7fEZFiGkvnOO3pe2bGXx77mjzG5ekMc8ZDU9K5vvwb4bN2x0frBV2EBkoCsVtM DoVhcDfMnTG6fdbSS31lRdwXGkkb1PTvlX/VoWmvANlmfagoBU6xyHBH5KMF92UvIeyj X8ciyw6BvrHxFBDS/r6DEFH2wN0OcTyG02Kku1+6MOQV5SWwY2PSeFlMckMK5mBk1P3h tp7WN36iXKxS5P61nKySo1F9RLiCBiZaqwymWM54bQCbv6P+nd/fcF8+cnCtbz7iP7Q9 tA== Received: from ppma03dal.us.ibm.com (b.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.11]) by mx0a-001b2d01.pphosted.com with ESMTP id 356ceu7q2j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 13:20:03 -0500 Received: from pps.filterd (ppma03dal.us.ibm.com [127.0.0.1]) by ppma03dal.us.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0B2I8P7f021327; Wed, 2 Dec 2020 18:20:02 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03dal.us.ibm.com with ESMTP id 353e69k0gc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 02 Dec 2020 18:20:02 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0B2IK1IE4653648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 2 Dec 2020 18:20:01 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C6479AE06D; Wed, 2 Dec 2020 18:20:01 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B6CACAE066; Wed, 2 Dec 2020 18:20:01 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.224.51]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 2 Dec 2020 18:20:01 +0000 (GMT) From: David Christensen To: dev@dpdk.org, stephen@networkplumber.org Cc: David Christensen Date: Wed, 2 Dec 2020 10:19:59 -0800 Message-Id: <20201202181959.13753-1-drc@linux.vnet.ibm.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-12-02_10:2020-11-30, 2020-12-02 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 suspectscore=2 bulkscore=0 phishscore=0 adultscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012020107 Subject: [dpdk-dev] [PATCH 1/1] usertools: show hugepages on POWER systems X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The IBM PowerNV systems include NUMA nodes that don't have associated CPUs or hugepage memory. Here is an example on an IBM AC922 system: $ lscpu ... NUMA node0 CPU(s): 0-63 NUMA node8 CPU(s): 64-127 NUMA node252 CPU(s): ... $ numastat -m ... Node 0 Node 8 Node 252 --------------- --------------- --------------- MemTotal 126763.19 130785.06 0.00 MemFree 119513.38 125294.44 0.00 MemUsed 7249.81 5490.62 0.00 ... HugePages_Total 4.00 1734.00 0.00 HugePages_Free 0.00 4.00 0.00 HugePages_Surp 4.00 1730.00 0.00 ... Modify dpdk-hugepages.py to test for the ../hugepages directory before attempting to parse the hugepage entries. Signed-off-by: David Christensen --- usertools/dpdk-hugepages.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 1be100ca3..89945f187 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -70,13 +70,14 @@ def show_numa_pages(): for numa_path in glob.glob('/sys/devices/system/node/node*'): node = numa_path[29:] # slice after /sys/devices/system/node/node path = numa_path + '/hugepages' - for hdir in os.listdir(path): - pages = get_hugepages(path + '/' + hdir) - if pages > 0: - kb = int(hdir[10:-2]) # slice out of hugepages-NNNkB - print('{:<4} {:<5} {:<6} {}'.format(node, pages, - fmt_memsize(kb), - fmt_memsize(pages * kb))) + if os.path.exists(path): + for hdir in os.listdir(path): + pages = get_hugepages(path + '/' + hdir) + if pages > 0: + kb = int(hdir[10:-2]) # slice out of hugepages-NNNkB + print('{:<4} {:<5} {:<6} {}'.format(node, pages, + fmt_memsize(kb), + fmt_memsize(pages * kb))) def show_non_numa_pages(): -- 2.27.0