Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2043356rwl; Thu, 13 Apr 2023 00:25:20 -0700 (PDT) X-Google-Smtp-Source: AKy350ZMeCw1hdmFg3FcLPwSUxoh0VcfGYEcpwrV28BjTjVoqU9isK/xtPWYDfh+nw5GSiW0+S8x X-Received: by 2002:a17:906:7c8f:b0:947:4481:105b with SMTP id w15-20020a1709067c8f00b009474481105bmr1705227ejo.3.1681370719963; Thu, 13 Apr 2023 00:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681370719; cv=none; d=google.com; s=arc-20160816; b=i4ELgWUYfnNp/hHwFchG4QmPM4GwXbjOdWj9IiOx5m4oIPH3fR/SV3/M1ygcTBje0H G4xVMKhCDSAXAsOvxCjsaIXmACSEkYbF3U9T8QR+SJ0x1BHR5XKaQ6UM0kAIXWpGINMO 1U1MUfFy3e1hbBRZAH/+v5O332p6Y8WZ+kA6KLHTLqrgXMO1AjlIbdP5SpDKtVBoHPN8 GcqEJ1IBXtOumshawLq0uX3XxEfrMcj5GoLPqX6AqM67iHc2BldLkqUFkBL4J2QINJDA vYrtZUSygC/VhxlnL0wHp+yfpA0TsJ9ntJtk5sQOdmU21aIJ+gjS6rssF4De5BNSiNz8 ld6g== 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=PNCOReB4YwKY0654q7rB/LEsIMt/52TIH7ZpCQmq+rs=; b=OFNFyxPAaimdPcFFhVEeKUR53v86Hb9xK+FcGFzQgBC49pORPPmDePRfjrEeeYGelz xL0WEwu8N3mvLqLEiqDGHSk+pJaDaRAANvP2A0wHskl4m8Ivau6mY1oBBhEh25k1O+a2 mIwKExECMILwEAV8WGd3OqJ4eXWRxABbcpCC1aKN7TQIxYO8svOwjsCQYoIf7s3K5lZX 5bLtAhImdZWu3eIKU0yse7ivAIVwSTCNJGm5me0KdGeGMij6axSRL6yKgu2yRBqaBPaz Wzp22qNXXiD7jHH3UMfU9iUUd0qrw8c8EfKRyD0J1L28PZL1SUrVqFtCdEvyO1IJ6G5P nU+g== 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 fp31-20020a1709069e1f00b0094e8590681bsi1158836ejc.55.2023.04.13.00.24.56; Thu, 13 Apr 2023 00:25:19 -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 S229826AbjDMHXF (ORCPT + 99 others); Thu, 13 Apr 2023 03:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbjDMHXE (ORCPT ); Thu, 13 Apr 2023 03:23:04 -0400 Received: from esa8.hc1455-7.c3s2.iphmx.com (esa8.hc1455-7.c3s2.iphmx.com [139.138.61.253]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53CFA9F; Thu, 13 Apr 2023 00:23:02 -0700 (PDT) X-IronPort-AV: E=McAfee;i="6600,9927,10678"; a="101351006" X-IronPort-AV: E=Sophos;i="5.98,339,1673881200"; d="scan'208";a="101351006" Received: from unknown (HELO yto-r1.gw.nic.fujitsu.com) ([218.44.52.217]) by esa8.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2023 16:22:59 +0900 Received: from yto-m2.gw.nic.fujitsu.com (yto-nat-yto-m2.gw.nic.fujitsu.com [192.168.83.65]) by yto-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 94D69D66A5; Thu, 13 Apr 2023 16:22:57 +0900 (JST) Received: from yto-om3.fujitsu.com (yto-om3.o.css.fujitsu.com [10.128.89.164]) by yto-m2.gw.nic.fujitsu.com (Postfix) with ESMTP id E2071D35F5; Thu, 13 Apr 2023 16:22:56 +0900 (JST) Received: from cn-r05-10.example.com (n3235113.np.ts.nmh.cs.fujitsu.co.jp [10.123.235.113]) by yto-om3.fujitsu.com (Postfix) with ESMTP id AA28A40007204; Thu, 13 Apr 2023 16:22:56 +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 v9 0/6] Some improvements of resctrl selftest Date: Thu, 13 Apr 2023 16:22:53 +0900 Message-Id: <20230413072259.2089348-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 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 Reinette, The aim of this patch series is to improve the resctrl selftest. Without these fixes, some unnecessary processing will be executed and test results will be confusing. There is no behavior change in test themselves. [patch 1] Make write_schemata() run to set up shemata with 100% allocation on first run in MBM test. [patch 2] The MBA test result message is always output as "ok", make output message to be "not ok" if MBA check result is failed. [patch 3] When a child process is created by fork(), the buffer of the parent process is also copied. Flush the buffer before executing fork(). [patch 4] An error occurs whether in parents process or child process, the parents process always kills child process and runs umount_resctrlfs(), and the child process always waits to be killed by the parent process. [patch 5] If a signal received, to cleanup properly before exiting the parent process, commonize the signal handler registered for CMT/MBM/MBA tests and reuse it in CAT, also unregister the signal handler at the end of each test. [patch 6] Before exiting each test CMT/CAT/MBM/MBA, clear test result files function cat/cmt/mbm/mba_test_cleanup() are called twice. Delete once. This patch series is based on based on the "next" branch of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git Pervious versions of this series: [v1] https://lore.kernel.org/lkml/20220914015147.3071025-1-tan.shaopeng@jp.fujitsu.com/ [v2] https://lore.kernel.org/lkml/20221005013933.1486054-1-tan.shaopeng@jp.fujitsu.com/ [v3] https://lore.kernel.org/lkml/20221101094341.3383073-1-tan.shaopeng@jp.fujitsu.com/ [v4] https://lore.kernel.org/lkml/20221117010541.1014481-1-tan.shaopeng@jp.fujitsu.com/ [v5] https://lore.kernel.org/lkml/20230111075802.3556803-1-tan.shaopeng@jp.fujitsu.com/ [v6] https://lore.kernel.org/lkml/20230131054655.396270-1-tan.shaopeng@jp.fujitsu.com/ [v7] https://lore.kernel.org/lkml/20230213062428.1721572-1-tan.shaopeng@jp.fujitsu.com/ [v8] https://lore.kernel.org/lkml/20230215083230.3155897-1-tan.shaopeng@jp.fujitsu.com/ Shaopeng Tan (6): selftests/resctrl: Fix set up schemata with 100% allocation on first run in MBM test selftests/resctrl: Return MBA check result and make it to output message selftests/resctrl: Flush stdout file buffer before executing fork() selftests/resctrl: Cleanup properly when an error occurs in CAT test selftests/resctrl: Commonize the signal handler register/unregister for all tests selftests/resctrl: Remove duplicate codes that clear each test result file tools/testing/selftests/resctrl/cat_test.c | 29 ++++---- tools/testing/selftests/resctrl/cmt_test.c | 7 +- tools/testing/selftests/resctrl/fill_buf.c | 14 ---- tools/testing/selftests/resctrl/mba_test.c | 23 +++---- tools/testing/selftests/resctrl/mbm_test.c | 20 +++--- tools/testing/selftests/resctrl/resctrl.h | 2 + .../testing/selftests/resctrl/resctrl_tests.c | 4 -- tools/testing/selftests/resctrl/resctrl_val.c | 67 ++++++++++++++----- tools/testing/selftests/resctrl/resctrlfs.c | 5 +- 9 files changed, 96 insertions(+), 75 deletions(-) -- 2.27.0