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 8765BA09FF; Thu, 7 Jan 2021 09:07:14 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2DDFF140ECE; Thu, 7 Jan 2021 09:07:14 +0100 (CET) Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) by mails.dpdk.org (Postfix) with ESMTP id A61BD140ECA for ; Thu, 7 Jan 2021 09:07:12 +0100 (CET) Received: by mail-oi1-f177.google.com with SMTP id p5so6526338oif.7 for ; Thu, 07 Jan 2021 00:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0ZdJcIzF87Iy26bEpy8hvE7kommJVToo45X/pladsGE=; b=RUAiL0pTTvmvxroEEjgFfyCrwsArtQKuwlWonASuQYFWV05vOssRQ60LGBEbsgs7h7 1zFQREYTbkd2sJAXYa3NZPyrLloR1eRPcsb7Ys+j2ULY1p7QEv4zhUT7UlwIYxC3KUpW shjQfvb6joN6Voya0v8ENBKMwT1CrWzYORXcjqMvYKfhGN6u6qJensIGLUQrDx5tMOnU OMqkMYRkjpMUtzV95GahzqQ+ZkTYsLapxt4LvEOmJJQ1pL6292AtEHrv9MdGyS+0Oujo 6eppbXspfkZCGcGz/oRJex05H9jTfqseU3PhNcXgaW3tc9NJrpHtTv7iQPZYTGofLTQ4 lYqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0ZdJcIzF87Iy26bEpy8hvE7kommJVToo45X/pladsGE=; b=CXtWRtuCOR07LfeS+eqFDVF+a4VjVAGJvmYDE+sUCPCt9eFwSn3MH5DAe42qOoi1UE eZpIzqxTOCIQXDb2nHmwrOS8IYTh/6cacxLWODkQmvwuKtubEa0Q1texmm4eG3w7VKxe ZS0kY5aSqByLygnAFiGH8c7uBEv3MeWPWFJW5CkxqjVFxsMzSyoRhQn701KjoRgSIfBh rbyiWU5SIro1m92huoLif3Q45fdmPo+yDe/cgWUYk05q5d6ShlxEv3ge6IwQlfRJPDVl AgLHpmrCcZhE5xlrhvgLs3BdZsIPa0nH5JTLWeLirivHrGqjTqO42c7k5hCxIPgu0u+h No7w== X-Gm-Message-State: AOAM533ZQ2MF34xTAGirQojB9VJwY6SYYenukEYsgsQyFGxqV7w8zpIb znnbhwy1+PsBpzss+RfJpHD19Y/SWs5yv/5hyWeaCg== X-Google-Smtp-Source: ABdhPJwnH/5APT9qQeT2r7dRjF9fh79BUWF6H3qki/OlMlHIaVjbCbgJTK6ZJAa5LFqhsK5cV3geLN59rinQ6BUB0cw= X-Received: by 2002:aca:c3c3:: with SMTP id t186mr649193oif.53.1610006831959; Thu, 07 Jan 2021 00:07:11 -0800 (PST) MIME-Version: 1.0 References: <20201130124533.23341-1-sarosh.arif@emumba.com> <20201217111616.24057-1-sarosh.arif@emumba.com> <20201217101552.670926d0@hermes.local> In-Reply-To: <20201217101552.670926d0@hermes.local> From: Sarosh Arif Date: Thu, 7 Jan 2021 13:06:35 +0500 Message-ID: To: Stephen Hemminger Cc: sthemmin@microsoft.com, dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [v2 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" On Thu, Dec 17, 2020 at 11:19 PM Stephen Hemminger wrote: > > On Thu, 17 Dec 2020 16:16:16 +0500 > Sarosh Arif wrote: > > > + if get_hugepages(path) != pages: > > + print("Unable to reserve required pages. The pages reserved are:") > > + global SHOW_HUGEPAGES > > + SHOW_HUGEPAGES = True > > > Please don't add global's to this script. > > The script is close to being clean according to pylint, and globals > are considered bad style and shouldn't be used. > > I would just exit if huge pages could not be setup. How about if we just print a warning message such as "Unable to reserve required pages" before exiting, in case the pages are not reserved due to lack of space in RAM? Then leave it upon the user to query how many pages are actually reserved. > > The script should leave it up to the user to do another query about > status if they care about what the result is.