From patchwork Mon Nov 30 02:06:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Xu X-Patchwork-Id: 1407955 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.linux.it (client-ip=2001:1418:10:5::2; helo=picard.linux.it; envelope-from=ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from picard.linux.it (picard.linux.it [IPv6:2001:1418:10:5::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CkpW85WMPz9sVN for ; Mon, 30 Nov 2020 13:06:25 +1100 (AEDT) Received: from picard.linux.it (localhost [IPv6:::1]) by picard.linux.it (Postfix) with ESMTP id 3A0DF3C5DDA for ; Mon, 30 Nov 2020 03:06:10 +0100 (CET) X-Original-To: ltp@lists.linux.it Delivered-To: ltp@picard.linux.it Received: from in-2.smtp.seeweb.it (in-2.smtp.seeweb.it [217.194.8.2]) by picard.linux.it (Postfix) with ESMTP id 927A93C28B0 for ; Mon, 30 Nov 2020 03:06:08 +0100 (CET) Received: from heian.cn.fujitsu.com (mail.cn.fujitsu.com [183.91.158.132]) by in-2.smtp.seeweb.it (Postfix) with ESMTP id 6A827600879 for ; Mon, 30 Nov 2020 03:06:06 +0100 (CET) X-IronPort-AV: E=Sophos;i="5.78,379,1599494400"; d="scan'208";a="101868543" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 30 Nov 2020 10:06:03 +0800 Received: from G08CNEXMBPEKD04.g08.fujitsu.local (unknown [10.167.33.201]) by cn.fujitsu.com (Postfix) with ESMTP id A20C94CE5CED for ; Mon, 30 Nov 2020 10:06:02 +0800 (CST) Received: from localhost.localdomain (10.167.220.84) by G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 30 Nov 2020 10:06:04 +0800 From: Yang Xu To: Date: Mon, 30 Nov 2020 10:06:06 +0800 Message-ID: <1606701966-1596-1-git-send-email-xuyang2018.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 X-Originating-IP: [10.167.220.84] X-ClientProxiedBy: G08CNEXCHPEKD06.g08.fujitsu.local (10.167.33.205) To G08CNEXMBPEKD04.g08.fujitsu.local (10.167.33.201) X-yoursite-MailScanner-ID: A20C94CE5CED.AEB0A X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: xuyang2018.jy@cn.fujitsu.com X-Spam-Status: No, score=0.4 required=7.0 tests=KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE autolearn=disabled version=3.4.4 X-Virus-Scanned: clamav-milter 0.102.4 at in-2.smtp.seeweb.it X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on in-2.smtp.seeweb.it Subject: [LTP] [PATCH] cpuset_inherit: Use the original mem value instead of N_NODES X-BeenThere: ltp@lists.linux.it X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Test Project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ltp-bounces+incoming=patchwork.ozlabs.org@lists.linux.it Sender: "ltp" Since ltp commit cf33086a1ca, we add cgroup.clone_children switch for cpuset.cpus and mems, we used the original memory value to set in cpuset_inherit case. After ltp commit 6872ad15a, we improve the node number calculation for N_NODES, so it can calculate for N_NODES obtained from the file contains only "0,8". But it doesn't think about this patch will affect mem_string value, so this cpuset_inherit case will fail on 4 numa nodes pc, as below: cpuset_inherit 1 TPASS: cpus: Inherited information is right! cpuset_inherit 3 TPASS: cpus: Inherited information is right! cpuset_inherit 5 TPASS: cpus: Inherited information is right! cpuset_inherit 7 TPASS: cpus: Inherited information is right! cpuset_inherit 9 TPASS: cpus: Inherited information is right! cpuset_inherit 11 TPASS: cpus: Inherited information is right! cpuset_inherit 13 TPASS: mems: Inherited information is right! cpuset_inherit 15 TPASS: mems: Inherited information is right! cpuset_inherit 17 TPASS: mems: Inherited information is right! cpuset_inherit 19 TPASS: mems: Inherited information is right! cpuset_inherit 21 TPASS: mems: Inherited information is right! cpuset_inherit 23 TFAIL: mems: Test result - 0-3 Expected string - "4" Fix this by using original mem value. Signed-off-by: Yang Xu --- testcases/kernel/controllers/cpuset/cpuset_funcs.sh | 7 +++---- .../cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh index f4365af2c..b469140ca 100755 --- a/testcases/kernel/controllers/cpuset/cpuset_funcs.sh +++ b/testcases/kernel/controllers/cpuset/cpuset_funcs.sh @@ -28,10 +28,11 @@ NR_CPUS=`tst_ncpus` if [ -f "/sys/devices/system/node/has_high_memory" ]; then - N_NODES="`cat /sys/devices/system/node/has_high_memory | tr ',' ' '`" + mem_string="`cat /sys/devices/system/node/has_high_memory`" else - N_NODES="`cat /sys/devices/system/node/has_normal_memory | tr ',' ' '`" + mem_string="`cat /sys/devices/system/node/has_normal_memory`" fi +N_NODES="`echo $mem_string | tr ',' ' '`" count=0 for item in $N_NODES; do delta=1 @@ -42,8 +43,6 @@ for item in $N_NODES; do done N_NODES=$count -mem_string="$N_NODES" - CPUSET="/dev/cpuset" CPUSET_TMP="/tmp/cpuset_tmp" CLONE_CHILDREN="/dev/cpuset/cgroup.clone_children" diff --git a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh index 73eed2cb9..27ff19532 100755 --- a/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh +++ b/testcases/kernel/controllers/cpuset/cpuset_inherit_test/cpuset_inherit_testset.sh @@ -31,10 +31,8 @@ export TST_COUNT=1 check 1 1 nr_cpus=$NR_CPUS -nr_mems=$N_NODES cpus_all="$(seq -s, 0 $((nr_cpus-1)))" -mems_all="$(seq -s, 0 $((nr_mems-1)))" exit_status=0 @@ -134,10 +132,10 @@ test_mems() done <<- EOF 0 NULL EMPTY 0 0 EMPTY - 0 $mems_all EMPTY + 0 $mem_string EMPTY 1 NULL EMPTY 1 0 0 - 1 $mems_all $mem_string + 1 $mems_string $mem_string EOF # while read mems result }