From patchwork Wed Oct 10 11:41:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rafael David Tinoco X-Patchwork-Id: 148548 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp744678lji; Wed, 10 Oct 2018 04:41:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV611GaZr7mvKEb5SeBioKd5UeFVYphrS5dZ2o+DdmIjRt7wGSUqjLc2z+5Nfxq+NDHQF4IQB X-Received: by 2002:a5d:4101:: with SMTP id l1-v6mr24889244wrp.45.1539171708097; Wed, 10 Oct 2018 04:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539171708; cv=none; d=google.com; s=arc-20160816; b=plOf+7h8HvFVy914Fv+KwYtsr+79S91L5MEPA+5VIjA91ZrM34S6S+kShgY22XcxmL 8OobmzVD/GVFQzF6N1PyHTb4s4y+YSaq6fDztazvQtMjm9w0kFGRGO88hV3yOL6elzWs B3P+/b3jsFvxCOEvqhyXi4au8yvgTF1batTXLf3IXtWY4GULaw2bpbh7MiBPiTPrGGvf 13WzoGzyRNLWVi5ktpaXWXXO2ifer4bTCy0YUI22FeT8O2TSF1my4YRPh4olXigCp2Zn j+yxoUCFsVhiNO5YCw1wRFotm9GHVCC5pgF8JETKIKt8MPu1SrFax/fDnXkrG/8bwd0J JbSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:delivered-to; bh=4tjO2ob3WE1r8xWP0j/ESxv653r9J9lJHkrcbLm7obo=; b=YosCPGNB34/rK96/YqF4RkxGTkRZ/PL0ahymNAErzcQK28c96gg2NYUTXrw0cYDL8a F7kU3K8pi1Di7e1kVn3TEbyUSlsM/qBo+EbnXa8js9Ar3gvIcwPB+hLbPtgCWlUZFCsR Zxn7ZDWfkpiiWgiu44OrpntYHWymXhF4bwfMLVd6UaWINGYsmMivcFtNSF5KCGwkdCsS mlASrTnnjCT94kazlfEtA8vS0YrQ5LtdYqpZZH6cy4kSArHp33DrFbUiQTdxlFa18Lkk wkSwL/TO1v92mHatKJF9ymkWJghAu3rCSc+EE3cHGulDOX7bdXstE5LV72bwlD4efZGE CMXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CEss730k; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from picard.linux.it (picard.linux.it. [213.254.12.146]) by mx.google.com with ESMTPS id k9-v6si17421045wrm.210.2018.10.10.04.41.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 04:41:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) client-ip=213.254.12.146; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=CEss730k; spf=pass (google.com: domain of ltp-bounces+patch=linaro.org@lists.linux.it designates 213.254.12.146 as permitted sender) smtp.mailfrom="ltp-bounces+patch=linaro.org@lists.linux.it"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id A93723E70F2 for ; Wed, 10 Oct 2018 13:41:47 +0200 (CEST) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-3.smtp.seeweb.it (in-3.smtp.seeweb.it [IPv6:2001:4b78:1:20::3]) by picard.linux.it (Postfix) with ESMTP id 0617D3E7059 for ; Wed, 10 Oct 2018 13:41:43 +0200 (CEST) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by in-3.smtp.seeweb.it (Postfix) with ESMTPS id D504D1A01152 for ; Wed, 10 Oct 2018 13:41:42 +0200 (CEST) Received: by mail-qt1-x842.google.com with SMTP id v19-v6so5205732qtg.2 for ; Wed, 10 Oct 2018 04:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ln/XRGzO0M2gF5MSszumz5MjwystesSzEiz/FjfuLf4=; b=CEss730kLG5a45ETgXWERrjPtWZHBm2EQibpjtQgY207Rwk4zkMTkLi5sqJJ71ak4p OqqTbTmpo/NkUrgJ9Y5El9+uo7FsOHqOxB1v2Z+sQuQA8g5u/pzrcDn39ptJ521C3kzn V6L9XdnYqbKus8TS5FHTtLxq3DMMirGJEE6hk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ln/XRGzO0M2gF5MSszumz5MjwystesSzEiz/FjfuLf4=; b=nlM1pLvD6Fxz8bSkrH9b0F62kMR/5e8ik1//J3G2V8xgQVDimBfqwzeWLGgaYb9vV5 +WQ+4bLlhdgWLIQPE6ATKAw68KA8a3Sh5AGe5xtiQ2AzcTG1M+3NBDK6A9XOCy9QGW8c Ercx81qUp8CSv7usUExQvrVxsCZvK40o4X+AnbMA4ZdpimJYiBy0/1/jNm2Gau4A/kLJ shYzPPG6KFEGlWjzh7KvTj9wXwzhEQ/ukW4+hxcr7xdhX/hAZqt0nvMpa0JFf7fMZgHU 6BjIKm5dyGryLvmPN2Iw0s94Moq23Zsqwut/IBVfcLJNqE9tQT4YVbHFXwXVGq4GBCW9 6MJg== X-Gm-Message-State: ABuFfoh8ufmM73kjXf42r3+nHb+nTHQLe3du+HNRSgba1W5MowkF4R7+ HhD+cUj5SJRXuenWilUabmolV9rBC8E= X-Received: by 2002:a0c:fc04:: with SMTP id z4mr1192987qvo.157.1539171701449; Wed, 10 Oct 2018 04:41:41 -0700 (PDT) Received: from workstation.celeiro.br ([138.204.25.12]) by smtp.gmail.com with ESMTPSA id m61-v6sm10846228qte.30.2018.10.10.04.41.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 04:41:40 -0700 (PDT) From: Rafael David Tinoco To: ltp@lists.linux.it Date: Wed, 10 Oct 2018 08:41:35 -0300 Message-Id: <20181010114136.23957-1-rafael.tinoco@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181010104317.GB1990@rei> References: <20181010104317.GB1990@rei> MIME-Version: 1.0 X-Virus-Scanned: clamav-milter 0.99.2 at in-3.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Status: No, score=0.1 required=7.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_PASS autolearn=disabled version=3.4.0 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on in-3.smtp.seeweb.it Cc: rafael.tinoco@linaro.org Subject: [LTP] [PATCH v2 1/2] futex/futex_wake04.c: fix hugepages setup for test X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.18 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+patch=linaro.org@lists.linux.it Sender: "ltp" Test was changing number of hugepages during setup()/cleanup() phase, despite system having (or not) already configured hugepages. This was causing some overhead - of destroying (or creating) hugepages - during the test execution, and also changing amount of available hugepages to the rest of the system. Now, if system has > 0 hugepages available, the test doesn't touch it. Link: https://bugs.linaro.org/show_bug.cgi?id=3984 Signed-off-by: Rafael David Tinoco --- testcases/kernel/syscalls/futex/futex_wake04.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/testcases/kernel/syscalls/futex/futex_wake04.c b/testcases/kernel/syscalls/futex/futex_wake04.c index 3c7038317..1ae9599ab 100644 --- a/testcases/kernel/syscalls/futex/futex_wake04.c +++ b/testcases/kernel/syscalls/futex/futex_wake04.c @@ -76,14 +76,17 @@ static void setup(void) tst_tmpdir(); SAFE_FILE_SCANF(NULL, PATH_NR_HUGEPAGES, "%ld", &orig_hugepages); - SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%d", 1); + + if (!orig_hugepages) + SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%d", 1); TEST_PAUSE; } static void cleanup(void) { - SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%ld", orig_hugepages); + if (!orig_hugepages) + SAFE_FILE_PRINTF(NULL, PATH_NR_HUGEPAGES, "%d", 0); tst_rmdir(); }