From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CABB9A0524; Thu, 3 Jun 2021 21:36:14 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4350A410EA; Thu, 3 Jun 2021 21:36:10 +0200 (CEST) Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) by mails.dpdk.org (Postfix) with ESMTP id C9F12410E8 for ; Thu, 3 Jun 2021 21:36:09 +0200 (CEST) Received: by mail-pj1-f54.google.com with SMTP id k5so4270753pjj.1 for ; Thu, 03 Jun 2021 12:36:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VlpcdfmvrGon85VhKG9XE3fatS/TMNNJtgIufBrp/Cs=; b=EgZSrPLQFotG8B99oS/KyjHHli6lSY01EAzN3dLIADHvG4GZd6BMiK8b/VMqbi9usc HB6Vm9YlcCighSAPnMGC+SKuUk8Je3ATSsEja38abzayig9kYiclF2sPu6PYBlg9cdVu 971CDw7LGzTV8QDLX7tH6OyM7xYY/nGmoiXVwYqxwv0v9tLxw+fMLyTcpVIwo3FIBMRz GdUVdbXQQDnPQRVALlnCs2oBIXn6bnwm7yWJlu4NW/EbAC8E7NKDPulE7FNaXU9mCXUL q9E3jbj+mQdu4Uv5AZ3MzQIOu6st6ujMHR6J7KQDlAlTRIr6AzAwVvKf9GuUHWY2ghl8 x/2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VlpcdfmvrGon85VhKG9XE3fatS/TMNNJtgIufBrp/Cs=; b=UlvgKpHkegPZRrEnU0qG6VdMRponH779K0BiqFQYOn8sKJ1bM0vtxgcI6XqFITu6Xz h8TaGGc1nIq0uGIRZFIjwNROPHTCA7zJiVh5jPHdNss9XfR5yzHzAsBZM/ZJu7iCUevM Y4yimQZEE+6hHmmDBQ+9YILWpUwb57e4+biP7zoS26/VL3mqp8BmLsfwy8ohlaf2Brl5 QYoAYdFaHvCMgISqyZIC4XxGYk8hb/7mjVVt8WH9QxyJI9fWI6MGYV81F6ZIXgMynG/C BEWATXUEn8oudzvsE0719zDe0h3OYIv44Wwgyd/cS2lcb8BUatr9h12mPEXDWVHqM0DI J6UQ== X-Gm-Message-State: AOAM532yzSy8QYcq+EMEcQ6q9HrBO7PZ/1qo6uPHd4M5vsslWuQItOBC MeIBoqS4J77ORE1QiymjrEdjtQ== X-Google-Smtp-Source: ABdhPJzlzPlUtb0N+HXlkNAE+sjHsCRe52Jle7euxTHQJYPguZbVvZ7ZjrYgUqNJQ1cScX95TV/QRA== X-Received: by 2002:a17:90a:390d:: with SMTP id y13mr875847pjb.52.1622748968818; Thu, 03 Jun 2021 12:36:08 -0700 (PDT) Received: from hermes.local (76-14-218-44.or.wavecable.com. [76.14.218.44]) by smtp.gmail.com with ESMTPSA id f2sm3206585pgl.67.2021.06.03.12.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 12:36:08 -0700 (PDT) Date: Thu, 3 Jun 2021 12:36:05 -0700 From: Stephen Hemminger To: bugzilla@dpdk.org Cc: dev@dpdk.org Message-ID: <20210603123605.51b80994@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [Bug 725] hugepages.py script broken 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, 03 Jun 2021 15:08:52 +0000 bugzilla@dpdk.org wrote: > https://bugs.dpdk.org/show_bug.cgi?id=725 > > Bug ID: 725 > Summary: hugepages.py script broken > Product: DPDK > Version: unspecified > Hardware: All > OS: All > Status: UNCONFIRMED > Severity: normal > Priority: Normal > Component: other > Assignee: dev@dpdk.org > Reporter: harry.van.haaren@intel.com > Target Milestone: --- > > Hi Folks, > > It seems like the usertools/dpdk-hugepages.py script has changed/broken for > certain systems. I've applied the below patch to see why it was calling > "sys.exit()", which provides the following output; > > $ usertools/dpdk-hugepages.py -p1G --setup 2G > num pages 0 and pages 0 > num pages 1 and pages 0 > Unable to reserve required pages. > num pages 0 and pages 0 > num pages 2 and pages 0 > Unable to reserve required pages. > num pages 4 and pages 2 > Unable to reserve required pages. > num pages 2 and pages 2 > > As we can see, it attempts multiple things, and then succeeds (DPDK runs and > allocs hugepages as required after this). > > Today the behavior will "fail" on the first "unable to reserve required pages" > as 1 != 0, and does *not* continue attempting other pages sizes/things. > > This check and "sys.exit()" was introduce in this commit: > b25f0a7df80b620bab09dcb34bf4547d31ddede1 > > I'm not familiar with this script/hugepage reservation, so don't know what's a > good fix. No owner of this script in MAINTAINERS either. > > > diff --git a/usertools/dpdk-hugepages.py b/usertools/dpdk-hugepages.py > index fb368b6933..0ef667c5f9 100755 > --- a/usertools/dpdk-hugepages.py > +++ b/usertools/dpdk-hugepages.py > @@ -68,8 +68,10 @@ def set_hugepages(path, pages): > except FileNotFoundError: > sys.exit("Invalid page size. Valid page sizes: {}".format( > get_valid_page_sizes(path))) > - if get_hugepages(path) != pages: > - sys.exit('Unable to reserve required pages.') > + num_pages = get_hugepages(path) > + print("num pages {0} and pages {1}".format(num_pages, pages)) > + if num_pages != pages: > + print('Unable to reserve required pages.') If the number of hugepages is incorrect, please keep the exit call. It is not correct to return success if there is an error in setup.