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 3E43CA0547; Fri, 9 Apr 2021 17:06:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AA3B914108E; Fri, 9 Apr 2021 17:06:31 +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 DA58B14108D for ; Fri, 9 Apr 2021 17:06:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617980788; 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=Js5yMXnKKSsNh4pSqS3kF0FiacDVkxVvzkLkq/ezosw=; b=BqEXwPtmbJrbPOlB5F2OKMbb1RGfKCB193fHv3njNaJdgLvMgtWlSlg2Zt3NpiZ6j02cZS bqKlIbsU+erpCOMEL+iVV9cJJrqUKI7OMZ/OWX8pDzfsO0eZ+j9ovuRbvbN5ijbH436ffu dw7+gb8LRjTJDNUzyftgWrZc3fupIeA= 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-215-zARodn4IMdqM69Unw8rqRg-1; Fri, 09 Apr 2021 11:06:27 -0400 X-MC-Unique: zARodn4IMdqM69Unw8rqRg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0F06210054F6; Fri, 9 Apr 2021 15:06:26 +0000 (UTC) Received: from dhcp-25.97.bos.redhat.com (ovpn-115-147.rdu2.redhat.com [10.10.115.147]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE3D15C1A1; Fri, 9 Apr 2021 15:06:21 +0000 (UTC) From: Aaron Conole To: Bruce Richardson Cc: Thomas Monjalon , dev@dpdk.org, David Marchand , anatoly.burakov@intel.com References: <20210317144409.288346-1-aconole@redhat.com> <2080877.JXBMkDg2Jp@thomas> <20210406125835.GB551@bricha3-MOBL.ger.corp.intel.com> <20210406145041.GC551@bricha3-MOBL.ger.corp.intel.com> Date: Fri, 09 Apr 2021 11:06:20 -0400 In-Reply-To: <20210406145041.GC551@bricha3-MOBL.ger.corp.intel.com> (Bruce Richardson's message of "Tue, 6 Apr 2021 15:50:41 +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.16 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" Bruce Richardson writes: > On Tue, Apr 06, 2021 at 10:20:37AM -0400, Aaron Conole wrote: >> Bruce Richardson writes: >> >> > On Tue, Apr 06, 2021 at 08:33:07AM -0400, Aaron Conole wrote: >> >> 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. >> >> >> > Sorry that I'm late to this thread. Can you perhaps explain what you mean >> > by cascading dependencies in this instance, or what you are trying to do >> > exactly that is not supported? >> >> I want to conditionally invoke the test suite with the hugepage tests, >> and support the case that the machine has hugepages enabled, but not >> accessible. >> >> Right now, if a user runs: >> >> meson build && ninja -C build test >> >> with hugepages allocated as a non-root user, they will see 'FAIL' >> messages. This isn't very friendly, since the user would be confused. >> >> Right now, hugepage detection is done only at configure time (the >> 'meson' step), and then the target is always run. >> >> For now, I will continue modifying the below script, but that will be a >> detection at configure time, still. So the case where the user runs >> 'meson' when they have hugepages, but those hugepages go away and then >> they run 'ninja -C build test' will still be FAIL instead of SKIP (maybe >> we need a more descriptive error when FAIL due to hugepages happen?) >> > > This seems to me like the test binary itself should be checking the > presence of hugepages, and reporting skips if necessary. It's not just when > run through ninja that this functionality would be useful. Either way, there needs to be a rework - if we do it in the test binary, then the tests that require hugepages need to be worked so that they correctly detect lack of hugepage support before starting. If we keep that knowledge in the meson system, then we need to change the way we call the test binary script to support a more robust detection. I guess, I don't care too much which one is the one we choose. My $.02 opinion is that we already have most of the logic and whatnot done in the build system, so I'd prefer to do as small a change as possible (leaving that logic in the meson system). Then again, maybe it makes more sense to just rip the bandaid off and move it all into the test framework. WDYT?