DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Aaron Conole <aconole@redhat.com>
Cc: dev@dpdk.org, David Marchand <david.marchand@redhat.com>,
	anatoly.burakov@intel.com
Subject: Re: [dpdk-dev] [PATCH] test: make hugepage check more robust under Linux
Date: Wed, 17 Mar 2021 15:57:31 +0100	[thread overview]
Message-ID: <2080877.JXBMkDg2Jp@thomas> (raw)
In-Reply-To: <20210317144409.288346-1-aconole@redhat.com>

17/03/2021 15:44, Aaron Conole:
> The hugepage test really needs to check multiple things on Linux:
> 
> 1. Are hugepages reserved in the system?
> 
> 2. Is the hugepage mountpoint available so that we can allocate them?
> 
> 3. Do we have permissions to write into the hugepage mountpoint?
> 
> The existing hugepage check only verifies the first.  On some setups,
> a non-root user won't have access to the mountpoint for hugepages to
> be allocated and that needs to be reflected in the test as well.  Add
> such checks for Linux OS to give a more check when running test suites.

Requirements 2 & 3 are optional.
You don't need a mount point if using the option --in-memory.

[...]
> +	perm=""

perm= should do the same.

> +	for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do

Please prefer $() syntax.
Are spaces in awk required?

> +		test ! -w $mount/. || perm="$mount"

Why /. ?

> +	done
> +	if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then

= "" can be replaced with -z
"0" can be simply 0

> +		echo 0
> +	else
> +		echo $nr_hugepages
> +	fi




  reply	other threads:[~2021-03-17 14:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-17 14:44 Aaron Conole
2021-03-17 14:57 ` Thomas Monjalon [this message]
2021-04-06 12:33   ` Aaron Conole
2021-04-06 12:58     ` Bruce Richardson
2021-04-06 14:20       ` Aaron Conole
2021-04-06 14:50         ` Bruce Richardson
2021-04-09 15:06           ` Aaron Conole
2021-04-09 15:33             ` Thomas Monjalon
2021-04-12 11:33               ` David Marchand
2021-04-09 15:40             ` Bruce Richardson
2021-03-19 13:41 ` David Marchand
2021-03-19 14:34   ` Aaron Conole
2023-06-29 16:30     ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2080877.JXBMkDg2Jp@thomas \
    --to=thomas@monjalon.net \
    --cc=aconole@redhat.com \
    --cc=anatoly.burakov@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).