Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp7356389rwn; Tue, 13 Sep 2022 19:20:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR68vGp1Mbyz7p7Ix2g2r/7vchQIHwc7yac8BijCRoPYlfn5faJDAF8oCXRTkNUV6PJqd98Z X-Received: by 2002:a17:907:7e93:b0:77c:1e21:a50b with SMTP id qb19-20020a1709077e9300b0077c1e21a50bmr11373033ejc.72.1663122021594; Tue, 13 Sep 2022 19:20:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663122021; cv=none; d=google.com; s=arc-20160816; b=EckQOBsVbV9szPkO45W9avdscSgWzR1Izdz69wOQ16SCYJxZoB2tVRL/I4WmqmO8qO lZW+pNeewSyX013dkujkgrJfLfNFWS2Xn7Iek0Ru42Rf9tofVFMNeKxRTV9GSMsINO9S Q66WdFX1by6IjR/QMYXTMV18ii7SLk+yGroVLcsi/OLFXtwk+0i2YViEjCSjFDsc7nuY /7DZow+Pr/a12ugHCRAktF3MPdt6RvqQqXkWaYOzbEPKP55eG3gVTihGgDV98ubOo52Y z9hiNC03/yYwEaNSxFkVa+n0v19fbR1cmvlCcMEcd3qr8JVz98wveyKzWDsCIpSQf0t3 FZQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xJBukQ2vCgbu0cIPLbji+f28FQb59seBD7977KV5n5U=; b=RVC6/BZi086AIPVYILGAPJ5DWnlDVCgmnuf0mE7/IOZu80GWjeaPMB9dZvsubyvdSd m9tKdqHyXWIB4SXidCkda4Va/Q++BIlBTztmqPW1C8BB2CGSFj7lLe8yT2H/O9FLDY97 1r2hwwrmHdJfVc9xAIVO+2NHkHOVHYu6w0qk3I5iObXWatkEtGg3tz1ectYfXOowHr2q 9fFqDrj+PD2JyBRN6Gc52JKpT7pn5YBXjeoGu00bOR3FMYHClxM/1ijrWVn169QZtARY 2cxseQJz2hi7VodCRw3EwBJyZ+CTP4taX6JhIZngmMz5P8Ic65VqJ1f1fdiJQf9NP4U/ SG1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r1-20020aa7da01000000b0044ee91129eesi9223975eds.269.2022.09.13.19.19.56; Tue, 13 Sep 2022 19:20:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=fujitsu.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229801AbiINB4H (ORCPT + 99 others); Tue, 13 Sep 2022 21:56:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbiINB4G (ORCPT ); Tue, 13 Sep 2022 21:56:06 -0400 X-Greylist: delayed 64 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 13 Sep 2022 18:56:05 PDT Received: from esa9.hc1455-7.c3s2.iphmx.com (esa9.hc1455-7.c3s2.iphmx.com [139.138.36.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 938A63FA04 for ; Tue, 13 Sep 2022 18:56:05 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6500,9779,10469"; a="76604921" X-IronPort-AV: E=Sophos;i="5.93,313,1654527600"; d="scan'208";a="76604921" Received: from unknown (HELO yto-r2.gw.nic.fujitsu.com) ([218.44.52.218]) by esa9.hc1455-7.c3s2.iphmx.com with ESMTP; 14 Sep 2022 10:54:59 +0900 Received: from yto-m3.gw.nic.fujitsu.com (yto-nat-yto-m3.gw.nic.fujitsu.com [192.168.83.66]) by yto-r2.gw.nic.fujitsu.com (Postfix) with ESMTP id BBBB5D6253; Wed, 14 Sep 2022 10:54:58 +0900 (JST) Received: from oym-om3.fujitsu.com (oym-om3.o.css.fujitsu.com [10.85.58.163]) by yto-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id 179182757E; Wed, 14 Sep 2022 10:54:58 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by oym-om3.fujitsu.com (Postfix) with ESMTP id DC7E0403DF707; Wed, 14 Sep 2022 10:54:57 +0900 (JST) From: Shaopeng Tan To: Fenghua Yu , Reinette Chatre , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, tan.shaopeng@jp.fujitsu.com Subject: [PATCH 0/5] selftests/resctrl: Some improvements of resctrl selftest Date: Wed, 14 Sep 2022 10:51:41 +0900 Message-Id: <20220914015147.3071025-1-tan.shaopeng@jp.fujitsu.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, The aim of this patch series is to improve the resctrl selftest. The first three patches clear redundant code. The last two patches are bug fixes. Without the two fixes, some unnecessary processing will be executed and test results will be confusing. There is no behavior change in test themselves. [patch 1] Because the default schemata is 100% , in MBM test it is not necessary to reset schemata by write_schemata(). [patch 2] Delete CMT-related processing in write_schemata() which is not called by CMT. [patch 3] Before exiting each test CMT/CAT/MBM/MBA, clear test result files function cat/cmt/mbm/mba_test_cleanup() are called twice. Delete once. [patch 4] If there is an exception occurs after creating a child process with fork() in the CAT test, kill the child process before terminating the parent process. [patch 5] When a child process is created by fork(), the buffer of the parent process is also copied. Flush the buffer before executing fork(). This patch series is based on Linux v6.0-rc5 Shaopeng Tan (5): selftests/resctrl: Clear unused initalization code in MBM tests selftests/resctrl: Clear unused common codes called by CAT/MBA tests testing/selftests: Remove duplicate codes that clear each test result file selftests/resctrl: Kill the child process before exiting the parent process if an exception occurs selftests/resctrl: Flush stdout file buffer before executing fork() tools/testing/selftests/resctrl/cat_test.c | 17 +++++++++-------- tools/testing/selftests/resctrl/cmt_test.c | 2 -- tools/testing/selftests/resctrl/mba_test.c | 2 -- tools/testing/selftests/resctrl/mbm_test.c | 19 ++++++------------- tools/testing/selftests/resctrl/resctrl_val.c | 1 + tools/testing/selftests/resctrl/resctrlfs.c | 7 +++---- 6 files changed, 19 insertions(+), 29 deletions(-) -- 2.27.0