From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4BB53A0524; Fri, 8 Jan 2021 10:09:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 34E0E140ECB; Fri, 8 Jan 2021 10:09:17 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id D30D0140EC2 for ; Fri, 8 Jan 2021 10:09:15 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id e25so7785030wme.0 for ; Fri, 08 Jan 2021 01:09:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0ZtWtrIt9nsS7aR/qVp2Fsf+zK8yNKvVxsyDl5MD4l4=; b=hyzks2muo45HCtqHJNEhk/zv7+1zJ1oVEESkRjaFOyK/yGr62H8q9ME7cvO/cCUu1g RFlSiO6h0JrE6k7bMtvpeI0Ugmta9AOxu8pnGsITn5I2MW2E7fN6X5KrXf8yY/kUOs9n YnIwAxMrcupFXZV1ZoH17aQnUwD3vD/6+VZoI1vXR/mJnQ4IIFR3+/XywJ/CXTaPGUuk OReYpMOBtti7B5up09qnVcPiomgPcPE2F5cGzuM/tdE6JmdjmQ22OX0rPvFwNzjexEGG 54iS1UG+UQZwz2PE62Gog4O/5LUXuzQDH9UIvEgFIVRmnb3/pZEt8FhPZPG1ys6rCWLY zL0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0ZtWtrIt9nsS7aR/qVp2Fsf+zK8yNKvVxsyDl5MD4l4=; b=KVe5tUd92tGUA5rf5EOiX+i7YdW2dU5F+bCSVnIPxm+cm57otn+CJxOiW+wR0fHatb M/KMs4d1zPgyrB2wsKuFmA1xJGZDH4Bv+w9lJ7BlRtTL/9ZPRnBGG1ZIYKp1qYikiYw0 Z8d/54hDOnS4cUgDhoP23ozrBKA6tgRdZf4WWlmS7bROq+LQGKxfS3Hia3pkUXmif28w hcN2ejrm9MWS8Bk3NQg1sa9dXwxeHJy9Rni9VpRR3VTIDUwdCX5yUfmWbxddb4nReiiM EFOMIhSdDChQFO+OSJ3dIYeNWVIvnpMH/7nHW3rB3va9745srCmfSesEdlIsoRjZjlop AOvg== X-Gm-Message-State: AOAM533P56BYn2Htlrp5imhd/6jQi9CABF//TIrCV2CjesHReaTXubyr I9yXxSO0MSjh2al9foFVbPFPwA== X-Google-Smtp-Source: ABdhPJzO6OqlGwWuImmmIo29wbz/xw/vBPxNPZfRrau7wm2LQNacDcDx7dmBLhwUu8C1vUOUymhGlg== X-Received: by 2002:a05:600c:208:: with SMTP id 8mr2215324wmi.146.1610096955487; Fri, 08 Jan 2021 01:09:15 -0800 (PST) Received: from localhost.localdomain ([101.50.108.146]) by smtp.gmail.com with ESMTPSA id l5sm12724431wrv.44.2021.01.08.01.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Jan 2021 01:09:14 -0800 (PST) From: Sarosh Arif To: sthemmin@microsoft.com Cc: dev@dpdk.org, Sarosh Arif Date: Fri, 8 Jan 2021 14:06:27 +0500 Message-Id: <20210108090627.17365-1-sarosh.arif@emumba.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201130124533.23341-1-sarosh.arif@emumba.com> References: <20201130124533.23341-1-sarosh.arif@emumba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [v3 PATCH] usertools: show an error message if unable to reserve requested hugepages X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" Sometimes the system is unable to reserve the requested hugepages because enough space is not available in the RAM. In that case, currently the script displays no error message hence the user can be under the delusion that the hugepages requested are all successfully reserved. This patch displays an error message if the pages reserved are different from the requested pages. Signed-off-by: Sarosh Arif --- v2: use a global variable SHOW_HUGEPAGES to remove linter warnings v3: only print an error message if unable to reserve hugepages. --- usertools/dpdk-hugepages.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py index 1be100ca3..1523be20a 100755 --- a/usertools/dpdk-hugepages.py +++ b/usertools/dpdk-hugepages.py @@ -62,6 +62,8 @@ def set_hugepages(path, pages): filename = os.path.basename(path) size = filename[10:] sys.exit('{} is not a valid system huge page size'.format(size)) + if get_hugepages(path) != pages: + sys.exit("Unable to reserve required pages.") def show_numa_pages(): -- 2.25.1