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 48BA3A0546; Tue, 6 Apr 2021 14:33:18 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C602D406A2; Tue, 6 Apr 2021 14:33:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id EE3484067C for ; Tue, 6 Apr 2021 14:33:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617712395; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ZDeXoq0KCCyhM6BKGwr/lD+gHvihroAdJ4PTe5lcLcY=; b=KiM/5SlhLbdvrMLnhlZcZff4Yi/dXcil3taHQKf0/OpQkXom3s7shMBoObklH/DvC70QKj fJ5enTI8WwMfsl1SEIo9Cff2x43fLlArIcSHPQ2rlA34D0sEh9+ZNcaSeERwNvC4XKrcHf J3pJzG0Q8zMyYrWVcAlklyj36I8e9kM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-mnOmxnrrMXyEHAcU0haWNg-1; Tue, 06 Apr 2021 08:33:13 -0400 X-MC-Unique: mnOmxnrrMXyEHAcU0haWNg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2884C1800D50; Tue, 6 Apr 2021 12:33:12 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-113-108.rdu2.redhat.com [10.10.113.108]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 13EF55D6DC; Tue, 6 Apr 2021 12:33:07 +0000 (UTC) From: Aaron Conole To: Thomas Monjalon Cc: dev@dpdk.org, David Marchand , anatoly.burakov@intel.com, Bruce Richardson References: <20210317144409.288346-1-aconole@redhat.com> <2080877.JXBMkDg2Jp@thomas> Date: Tue, 06 Apr 2021 08:33:07 -0400 In-Reply-To: <2080877.JXBMkDg2Jp@thomas> (Thomas Monjalon's message of "Wed, 17 Mar 2021 15:57:31 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=aconole@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [dpdk-dev] [PATCH] test: make hugepage check more robust under Linux 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" Thomas Monjalon writes: > 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. That's true, but it seems to break a few of the unit tests without. I'll clarify the commit message. Additionally, I thought it would be simple to just incorporate your suggestions - but it seems that meson / ninja doesn't have cascading dependencies the way 'make' does (or, I haven't figured out from the syntax how to do that) - a 'run_command' gets resolved at configure time and it doesn't seem that we can make a run_target depend on another run_target since dependencies are on file outputs. Maybe we do some kind of trickery here where we write a file that the build script reads? I am trying to figure out how best to accomplish this - suggestions welcome. > [...] >> + perm="" > > perm= should do the same. > >> + for mount in `mount | grep hugetlbfs | awk '{ print $3; }'`; do > > Please prefer $() syntax. Okay > Are spaces in awk required? I'm not sure - I don't think so. >> + test ! -w $mount/. || perm="$mount" > > Why /. ? Habit. I will remove it. >> + done >> + if [ "$perm" = "" -o "$nr_hugepages" = "0" ]; then > > = "" can be replaced with -z > "0" can be simply 0 Done. >> + echo 0 >> + else >> + echo $nr_hugepages >> + fi