From patchwork Wed Feb 15 13:05:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57528 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp179824wrn; Wed, 15 Feb 2023 05:08:16 -0800 (PST) X-Google-Smtp-Source: AK7set/Q60wkIuIsJwpG443IqKuNrIaEgYG1cldfglwX45nN31gB66UTItEqASrTII917owN6T6U X-Received: by 2002:a05:6a20:c5a9:b0:c6:d84a:ce1c with SMTP id gn41-20020a056a20c5a900b000c6d84ace1cmr1113796pzb.35.1676466496593; Wed, 15 Feb 2023 05:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466496; cv=none; d=google.com; s=arc-20160816; b=diCcZNExT4iP2/QvjkJcNCtXjzN+dnT3VyC8nysA6rP1NuMu614TOMDrxJ9cHzwsbb A4Hu3+Pv4vcIb7IVPNI+iclGVVGufSK4DW5sNbQF2EYFzWX1O3vnRKpSXP6ALfoz/CCU 8nDxTiRR5UmalfagWXhsW+CeHJmkq7ZtXjHWjDxGXY2tVau5UHGPJ5lGhopXydNk7akO +NTnbIbMD/MgzxkLVYsGvGoZLviUggXti5x1BShvmWjryKJOJGS5bl35KsMMukzGhLjy KdDvxXVTtt46EIjYR4n1XXpaBjo/LibKxZpYzYViaxsRZMorszZZcONDXOtCx0dhnqB/ BZuA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=K3SQXe++tBfpe3sczDsyeqgKawxCx6wcARY6zJ82Q/4=; b=CCapzd9uWdD6hQrentmp/lE8QSOY3YArLvzWCl3Jd49QQzlgPqPTqJMIxCrxeTtFPm 0uF/3P2kN+umBLG/iFsvWunC70CpSgKUqihKs/z+hdawjygfjFCcCW4qjE0alZ2LFzJ6 3yU2X7AVHpn0O1+mswnn+eO0O4JEcIfu9JcabSlcRGw58ByDlz3mPs2ARil+B1yX+X8Q eJdMKQCIN/9GPNkf4d3YfIz/T1P7/pdQ/ScW5NJ68LCln+HIonCnQBMejdx81S14CDi9 rksL+y/xWU/JMM2LNda7FVMj9TkDZT94h/FJ8eJcgfWEFRhRmhOr01Pm7G2FXb58TLT5 C20g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=NiSIyHx7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020aa78427000000b005a8cf0d93cbsi6520198pfn.3.2023.02.15.05.08.03; Wed, 15 Feb 2023 05:08:16 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=NiSIyHx7; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234013AbjBONG1 (ORCPT + 99 others); Wed, 15 Feb 2023 08:06:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233926AbjBONGX (ORCPT ); Wed, 15 Feb 2023 08:06:23 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 446F238B43; Wed, 15 Feb 2023 05:06:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466383; x=1708002383; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=MRld6On45bu0R7Xy8hDi8ba43WkFZqsxPMer/O6B9x8=; b=NiSIyHx7AXzh9Z5feKZRPvHpIICO+NoaIdapaYI8XQxoBDwPI2JOQ3/X JZg7ACyh8nXHiF2jMyDTTl5vHuJ0wyqp7ZLqPo7gFm2UEt8ivY4zpyaIX i/BpyfuX4jfPCcDmBBTT5yJKbDBx3GUoQ98m//WVAju+TYKXBZPtO+vvS Ii0Tai++geX8dtYSVohk1o73TQm1rlmZESimPHkmosqgpPKpU0QsBr0Tt I8YbLHlFLEh1HXjtLUFrpAciHf6IM2KPJfO8uAk6RzMtnPlOYDK91PfFP cNeeDv8fb5wRQdDu3vvk3nO10PnO3JhKTfyQ1DyQXJ5s540D13j+edJHD A==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456237" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456237" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:23 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436017" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436017" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:20 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan , Sai Praneeth Prakhya , Babu Moger Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 1/9] selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem Date: Wed, 15 Feb 2023 15:05:57 +0200 Message-Id: <20230215130605.31583-2-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902533518650897?= X-GMAIL-MSGID: =?utf-8?q?1757902533518650897?= malloc_and_init_memory() in fill_buf isn't checking if memalign() successfully allocated memory or not before accessing the memory. Check the return value of memalign() and return NULL if allocating aligned memory fails. Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark") Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/fill_buf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c index 56ccbeae0638..c20d0a7ecbe6 100644 --- a/tools/testing/selftests/resctrl/fill_buf.c +++ b/tools/testing/selftests/resctrl/fill_buf.c @@ -68,6 +68,8 @@ static void *malloc_and_init_memory(size_t s) size_t s64; void *p = memalign(PAGE_SIZE, s); + if (!p) + return NULL; p64 = (uint64_t *)p; s64 = s / sizeof(uint64_t); From patchwork Wed Feb 15 13:05:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57529 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp179882wrn; Wed, 15 Feb 2023 05:08:23 -0800 (PST) X-Google-Smtp-Source: AK7set/7eqM8PKLT1GxnrrSb/3XIY1psUz+BuOs//eFfZO2gF/c2J3fT3yp6eLx8Xle0TgNCqp+z X-Received: by 2002:a17:90b:1bcf:b0:233:f09c:82c9 with SMTP id oa15-20020a17090b1bcf00b00233f09c82c9mr2868222pjb.20.1676466502827; Wed, 15 Feb 2023 05:08:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466502; cv=none; d=google.com; s=arc-20160816; b=macI9WFLDuyhENcjz7PRnkm1PS3B7KnzivObY/KFk08eLtN2lXv7hh0uu8rFvQfK8W AA0G21a7ObzAO8mbs+hyPgFle3cfOLSZ2ZQhP1UjjkB/+9oXZs0T75es1Hs2a3YxGkj1 i1Aw2E2QX9qX3jC4XVTh71hPeERPe8lCjZOY3PFvWcpQUT4M8tuYoLij6nJExO611aoq vMUwuod4WY4ZuM7lDl1Q7orl5/g+PtAUq7oICGV7Fl5vs8lFz7RmUPTjTJoE/GMI6IYa sV77Ov8Pa7ijR/WMaSNc+144ydc76BSRWAx2hr7Sc5BCUuqm/8XufGrBjAfbIiNA+wFq TM8Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iKDNovyzYNoYZPtyRDZOtCOZFK8zFKNumUZD2PHNeuw=; b=PThiF7P8UdPbYCSBNZlaIlumOfwdXVUsI0pKVOmLPESAxIGdjxhtraBPbbIYl7R2bh /hPN7QD6GzJ4Yk8KDmXz7fnvKtezZ/dNC252QoYf7ey4iQMgX9cOMovLbdUHEnsstV/G 09quNYPitpc5m9mYgtEJUgz4EwuIsK9xs8Z3kzZroRPyBkWPmPCVr53ffG8HeDYbD8w5 Gcd6PnVtCv68DwUfY0FbWc0o7r8lT0AbHbduq1uHtEIHMvImrZ/Uoi5Agz3wPe137n1a 6CrBxhxlth9D1uBQxj5qQDLeZI3HlOKgdkfUQ+zCyd4xDR22IcqedIeQJNwvlfoTs934 u4RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=FJYLqX7L; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a17090abe0600b00233ea41cd31si1899900pjs.74.2023.02.15.05.08.10; Wed, 15 Feb 2023 05:08:22 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=FJYLqX7L; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234068AbjBONGa (ORCPT + 99 others); Wed, 15 Feb 2023 08:06:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbjBONG1 (ORCPT ); Wed, 15 Feb 2023 08:06:27 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6AD538B4D; Wed, 15 Feb 2023 05:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466386; x=1708002386; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Qn//9IBm5Kac9zEBQzEQS4jENOC77V8ts13HcmG10h0=; b=FJYLqX7L1ASRhBvDcgzvrIHms/65ar9D4R5WvRizu2+wAhNTR8Sv1f3V 5mgYHb+4X+3koKI3cib9DKmTZpqKRqjrU3Z64SmXdgF4QTbrpUcqfsre9 Lk0pjQf20NWHRqFMMmJVD7iCy8UrGHqiK/VEAKnFEx2keN/ofuKG/KGdz 51yM1QCSS1tBvONq+dTlh7Lyr+2V2scI31KSnZs2cGm3PlGFE9Llmr7++ wWCiA/Z0KvKfnAAfIE3FlBb8riEUR1iqk0P/HhsOE/DHXc20VAGTQJVcI PJTEepshmIxKmfnQbzI9bw3Ws941KMPAnVVY0xd90Q8G+1opGT29YF/5j A==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456252" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456252" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:26 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436033" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436033" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:24 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 2/9] selftests/resctrl: Move ->setup() call outside of test specific branches Date: Wed, 15 Feb 2023 15:05:58 +0200 Message-Id: <20230215130605.31583-3-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902539791546181?= X-GMAIL-MSGID: =?utf-8?q?1757902539791546181?= resctrl_val() function is called only by MBM, MBA, and CMT tests which means the else branch is never used. Both test branches call param->setup(). Remove the unused else branch and place the ->setup() call outside of the test specific branches reducing code duplication. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl_val.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index b32b96356ec7..787546a52849 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -734,29 +734,22 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param) /* Test runs until the callback setup() tells the test to stop. */ while (1) { + ret = param->setup(1, param); + if (ret) { + ret = 0; + break; + } + if (!strncmp(resctrl_val, MBM_STR, sizeof(MBM_STR)) || !strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR))) { - ret = param->setup(1, param); - if (ret) { - ret = 0; - break; - } - ret = measure_vals(param, &bw_resc_start); if (ret) break; } else if (!strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR))) { - ret = param->setup(1, param); - if (ret) { - ret = 0; - break; - } sleep(1); ret = measure_cache_vals(param, bm_pid); if (ret) break; - } else { - break; } } From patchwork Wed Feb 15 13:05:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57531 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180068wrn; Wed, 15 Feb 2023 05:08:42 -0800 (PST) X-Google-Smtp-Source: AK7set8zcNLbxKebqIKxYAwk1xK2nJKN1GxCyELcz/r+58x+2i/GT0SwvRsfZ2/CsZn80GI0MyFE X-Received: by 2002:a62:52d6:0:b0:5a8:4c8b:49e with SMTP id g205-20020a6252d6000000b005a84c8b049emr1591033pfb.3.1676466521947; Wed, 15 Feb 2023 05:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466521; cv=none; d=google.com; s=arc-20160816; b=HYPSBLLatat2Xqc0m/bDzhkDR0qm0JAbTeSjegwX8MxZNxiO2d4iDhXCLw5SSKoNFy Q8Y0e3MfldAgS0Co+w49uiVNnSF+gsiFOYhVCcRorwRBzs7w7KZQtcF+B0KO8S1UhgKI 4G6G2afn+yh5HdOcflggVYh42rFwFpCpDL5+YZ5vyb6TaIPd4pUUTF4OdSyjVLvsU4Lt 2mHLNe5mSMryo0QSVjzuIPLoj+uR/mp8DbpBvlPweYYzbUYAQjWu+9s56KuorXOY+Vpg ODnar7dhz2aH0CFcLRwbNlRt90/hHkkv9SJGXrnngpqfZIgf0NSgSQ4SYxJlvgYFoeun J7Yw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FlMg9QDSrnWjQzdEdiufnrxA4ZXdiCWg2RuxWBBivvU=; b=0YWKGD29AWgxpQpVONAO06Mg6DnAzh+AT2u9ToT47mhAnk+JrQqU6uNiINdXAEiqy/ Wr8SrsewyScxVKTBpd8u/La54h8ppB96zlwvPNC3yQcqatAB6zwHAMxZ4aHFF+mXuHf5 Y85qfEG8Bg2bEgb8x5MtbuzEwMR1dNchixWgvrtyVzEV91twVSd9X3dglyCSAiy5Zhqd dDJwG0poloNRXnoBDvpG5fqS58kjQO22Tq4cQ4+LHHBDsxQi/1lk6HT7lAvI4eA25Jz3 8geIqSC1czCyLwG2ktU72X8fRJpwXwcWxe4b1Zpwr8NbmQk4Nz8D552gBj+uRFk3LTiq dnWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aLgFa97K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h14-20020a056a00000e00b005a8ec643a4bsi3285450pfk.131.2023.02.15.05.08.28; Wed, 15 Feb 2023 05:08:41 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=aLgFa97K; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234071AbjBONGi (ORCPT + 99 others); Wed, 15 Feb 2023 08:06:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbjBONGb (ORCPT ); Wed, 15 Feb 2023 08:06:31 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3126037F15; Wed, 15 Feb 2023 05:06:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466390; x=1708002390; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ieANzC0mnbQoL6/kg9W09orFIHLECukxmo5j4g9LCd4=; b=aLgFa97Kwe2G9VpMAki3jLoKgK1XQEO8dXWAX2DoKvTJShe7doYwH9c8 FL3B25WPrOgPy9Y4PbpFRLxdBfQ4jzAmYfxM3yKtL+pQxIzQoyFBDS+xE mxh4GgEF2dev7PtEnUA/VqTB1XNfsGzLoaIrZ/t2nS6aSBoJTu4h5VEFt ODnmgHWW9LRz0t7RXiD5LFRd2oy2lXjaNPuqc3imv0uU2awe0Ia7n0ddN R9buz7MgimAqBC7U4cFq6BUqZbSJdCH4sISAJs7sFxUgfCyGZIMTuM1le WElYPNRqtsGmtdxRQk6efxcxHQOC+wy/ffxuIOvmwqMizuW/aUsJXjIdu w==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456258" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456258" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436045" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436045" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:27 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan , Babu Moger , Sai Praneeth Prakhya Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 3/9] selftests/resctrl: Allow ->setup() to return errors Date: Wed, 15 Feb 2023 15:05:59 +0200 Message-Id: <20230215130605.31583-4-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902559827554133?= X-GMAIL-MSGID: =?utf-8?q?1757902559827554133?= resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns. Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly. Fixes: 790bf585b0ee ("selftests/resctrl: Add Cache Allocation Technology (CAT) selftest") Fixes: ecdbb911f22d ("selftests/resctrl: Add MBM test") Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/cache.c | 4 +++- tools/testing/selftests/resctrl/cat_test.c | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 2 +- tools/testing/selftests/resctrl/resctrl.h | 2 ++ tools/testing/selftests/resctrl/resctrl_val.c | 4 +++- 7 files changed, 12 insertions(+), 6 deletions(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index 68ff856d36f0..0485863a169f 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -244,10 +244,12 @@ int cat_val(struct resctrl_val_param *param) while (1) { if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) { ret = param->setup(1, param); - if (ret) { + if (ret == END_OF_TESTS) { ret = 0; break; } + if (ret < 0) + break; ret = reset_enable_llc_perf(bm_pid, param->cpu_no); if (ret) break; diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c index 1c5e90c63254..2d3c7c77ab6c 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -40,7 +40,7 @@ static int cat_setup(int num, ...) /* Run NUM_OF_RUNS times */ if (p->num_of_runs >= NUM_OF_RUNS) - return -1; + return END_OF_TESTS; if (p->num_of_runs == 0) { sprintf(schemata, "%lx", p->mask); diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c index 8968e36db99d..3b0454e7fc82 100644 --- a/tools/testing/selftests/resctrl/cmt_test.c +++ b/tools/testing/selftests/resctrl/cmt_test.c @@ -32,7 +32,7 @@ static int cmt_setup(int num, ...) /* Run NUM_OF_RUNS times */ if (p->num_of_runs >= NUM_OF_RUNS) - return -1; + return END_OF_TESTS; p->num_of_runs++; diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index 1a1bdb6180cf..f32289ae17ae 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -41,7 +41,7 @@ static int mba_setup(int num, ...) return 0; if (allocation < ALLOCATION_MIN || allocation > ALLOCATION_MAX) - return -1; + return END_OF_TESTS; sprintf(allocation_str, "%d", allocation); diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c index 8392e5c55ed0..280187628054 100644 --- a/tools/testing/selftests/resctrl/mbm_test.c +++ b/tools/testing/selftests/resctrl/mbm_test.c @@ -95,7 +95,7 @@ static int mbm_setup(int num, ...) /* Run NUM_OF_RUNS times */ if (num_of_runs++ >= NUM_OF_RUNS) - return -1; + return END_OF_TESTS; va_start(param, num); p = va_arg(param, struct resctrl_val_param *); diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index f0ded31fb3c7..f44fa2de4d98 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -37,6 +37,8 @@ #define ARCH_INTEL 1 #define ARCH_AMD 2 +#define END_OF_TESTS 1 + #define PARENT_EXIT(err_msg) \ do { \ perror(err_msg); \ diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c index 787546a52849..00864242d76c 100644 --- a/tools/testing/selftests/resctrl/resctrl_val.c +++ b/tools/testing/selftests/resctrl/resctrl_val.c @@ -735,10 +735,12 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param) /* Test runs until the callback setup() tells the test to stop. */ while (1) { ret = param->setup(1, param); - if (ret) { + if (ret == END_OF_TESTS) { ret = 0; break; } + if (ret < 0) + break; if (!strncmp(resctrl_val, MBM_STR, sizeof(MBM_STR)) || !strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR))) { From patchwork Wed Feb 15 13:06:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57532 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180591wrn; Wed, 15 Feb 2023 05:09:36 -0800 (PST) X-Google-Smtp-Source: AK7set8xqJssEklKKAxkoUeAlljji7HhwTg1Oo3d1Uiysk7tArwaF1nlX/HgQur5aAEAMHhk1q7h X-Received: by 2002:a05:6a20:35a5:b0:bd:c7b2:725e with SMTP id j37-20020a056a2035a500b000bdc7b2725emr1501373pze.22.1676466576542; Wed, 15 Feb 2023 05:09:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466576; cv=none; d=google.com; s=arc-20160816; b=DqBasWy6aYfG+DdhRvr/y8TKZ0dl+FL4zRjayvrDQK6g4QfM3VhG9EhpB5qA1iJySn OyZ8d5eIqsUc9KJSYQdwp+P6zvDBbaoUtEdybAZc9nXY7VaB+XIPqm60lceY8Z5hvLOc 1N7iLoCGgWv4S9boi0boBpg5n9RT7bAGI/Lk9JTG8oKhPeCUq88RlMTf/q8c4qjrVcwf P8MN1M7vx+dJWBg4MK8HcRqVnS5hwFuaFLnSsX24cf18rCowkUHE7VJbc/qI9hI/XbtW /UDv8VtLhyccw7zPCEt4M5CqtpsCFv6PlKRx4khMaaQtyWTeHOmvntVV0ev77aHn8vTD 7q6A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aVcQUpS3nOXEqvIrd+IybVfPcMuRCtiMwjfAG/2vB0g=; b=N8kBZ0FgxDPBd+DycQHRGw6FiawLELFs+eSkR95xuDS1b5dePuTGHySD3sV2VT/5Ni NUdCNbJWeVfqXCTRJ3jsEvckMqpvxmiVQf/U4du4r4PzuG5hnyegNupMUcnM3R1bmL2N 97+s6JTJ2QH/KJPxb6EuWIV0ZQVmVkspl5A4w3c3hF9Eiq4ad9eQwgBx8s/USuUwT0Bu pc9ZkaS8sr+M97VzPnYwxoHFAELptGlXZQ/nfAgNWgExb15YpRMPztC81g7xU+RVW2VK zu1asX/FWwuzdvwLefRmakR5+d/WqpiFWp2KkaXfozUprnoKOBy3NiV4HPtZXivFIh2/ yjew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=LSZNhPqQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l190-20020a6391c7000000b004fb99dd149fsi10153505pge.239.2023.02.15.05.09.23; Wed, 15 Feb 2023 05:09:36 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=LSZNhPqQ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234037AbjBONGp (ORCPT + 99 others); Wed, 15 Feb 2023 08:06:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234106AbjBONGh (ORCPT ); Wed, 15 Feb 2023 08:06:37 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54F2738B56; Wed, 15 Feb 2023 05:06:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466393; x=1708002393; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4x8SNti8bzuAAFLkH7pvwnNAsALE/29/ahp/VHLzAMg=; b=LSZNhPqQ7oRTtDVKW6sPfLMOcuC3amyGCJ8Ptm0L3H82yum/AJf15icI LMP/XiPXDNRw/WubMxsZ0ww983vz8bb/uaq+ZsazVZMJnYSmkrHZlUsjf U1hbrZbKawOQO3yGleMjSMED7RAd5q/cM2fITb3EICt7t/7BQrTWMIbgg NYvqPVQCbsgLhjIrYS+jOEjqDte6MCaMSY+dFoajqxtQlyGX93joqfWTg ffYIU+tTKNe15EiiWbTZiIt0b8aaUZnerXo1EWoln31pjTaHHch3YA5ES HMyNwVWGhgerCK2wVYRVKvXgFSj22rs/Ns7uiNd5+ZPfaUaxc+AQ4FQMb g==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456268" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456268" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436060" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436060" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:30 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan , Babu Moger , Sai Praneeth Prakhya Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 4/9] selftests/resctrl: Check for return value after write_schemata() Date: Wed, 15 Feb 2023 15:06:00 +0200 Message-Id: <20230215130605.31583-5-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902617328447539?= X-GMAIL-MSGID: =?utf-8?q?1757902617328447539?= MBA test case writes schemata but it does not check if the write is successful or not. Add the error check and return error properly. Fixes: 01fee6b4d1f9 ("selftests/resctrl: Add MBA test") Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index f32289ae17ae..97dc98c0c949 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -28,6 +28,7 @@ static int mba_setup(int num, ...) struct resctrl_val_param *p; char allocation_str[64]; va_list param; + int ret; va_start(param, num); p = va_arg(param, struct resctrl_val_param *); @@ -45,7 +46,11 @@ static int mba_setup(int num, ...) sprintf(allocation_str, "%d", allocation); - write_schemata(p->ctrlgrp, allocation_str, p->cpu_no, p->resctrl_val); + ret = write_schemata(p->ctrlgrp, allocation_str, p->cpu_no, + p->resctrl_val); + if (ret < 0) + return ret; + allocation -= ALLOCATION_STEP; return 0; From patchwork Wed Feb 15 13:06:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57533 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180720wrn; Wed, 15 Feb 2023 05:09:51 -0800 (PST) X-Google-Smtp-Source: AK7set90FTLkOS276Mx6hDnGKColoMHx9St1r3Y4xBXcimObfVnRAqDcU+bFLKp0C79KUBAOdRq1 X-Received: by 2002:a17:903:2312:b0:19a:9705:6465 with SMTP id d18-20020a170903231200b0019a97056465mr2821202plh.37.1676466591412; Wed, 15 Feb 2023 05:09:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466591; cv=none; d=google.com; s=arc-20160816; b=Y/zroOpFc9UAZxTl6SvJhWlC+V6Fl5y43PqwYf91xizbrDTbl3pMp4pIfLpg8tu5pJ l2vb73WFhoFDcZM7t9H8Wtfn5hFLKj4lq9yyvTcufhNUNThqIYG3Bb3Qk24Kixkwb0Fm LCU3dbRvL3LbcCXU6on2F601ZYy2yUiuErDazhTr6+MSBCFRvRVqJnrSv9MseWJfK2WR N++yAyaSJluNoxEUIQnAVB5h+BKg2aPBZI9IMarlDTq95u2lSw71mkEEOks/0xFbCWN/ D0l35ZCb5ShkFEDH1XFemdtSNcCDbRM/AvoZ5wBOkdzAlk6Iu1Tx5ycp0m2MnG1PSBbV cMyg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=skKIHCCIebwrJCro4tB01evkb/lLhYBdD6Ous1zfb4k=; b=z9kvJTIOsGY53sK9YWDhyeHERDPOPSJDAUHEY2BZ1B7Y9G7BwfE+IPxMUjsYZvNAGx Zv9wTQR916MJkoNkm4z/ni+/wpw4w3MyvV5mRSx+3xWtCYuQ84JsfRQiBwIMvYkUX1X7 t+HG7vI/ZnnMhe/5ZT4v8bBG8vbkF7ip6iIyWSEEFL5JStP4qVAzk2m9vAdIEMsjReW8 o+Gib4LfawWr+qLd3DvIEv6jQPcqIEzMREXeQ8idBJQ1lYRq8iY3vVVmP+szcI9azaQJ QeuDQA8Qj+Ub7nB79FykobcSAf0/8t1z9EMExue0RamJ9CK6jOqxkhdaMWKKKU+gpdvd UUGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TbpsbkpI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a170902d38200b0019468fe44d5si14069948pld.233.2023.02.15.05.09.37; Wed, 15 Feb 2023 05:09:51 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=TbpsbkpI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234088AbjBONGz (ORCPT + 99 others); Wed, 15 Feb 2023 08:06:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234117AbjBONGn (ORCPT ); Wed, 15 Feb 2023 08:06:43 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54C1F38E81; Wed, 15 Feb 2023 05:06:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466396; x=1708002396; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ATWdTIj6nlHosfxRj2cQEQ4dZAgek4AbNN/n59hIx9E=; b=TbpsbkpIrsubjjxbWHiTBvoESEjnbU4eSJ1VO4a7FwvPx9sQMkzsyJgn KOfl3aCvk1wtQX2lzcD0ERrQR3FhvHN+oc3U090cqCRDmxW9CMyWndz2U dhF6NAgjdxiFju1ftEj1GSSmKMWLwtuQsIg7kJYuAusNL+YNgbCm1GHcA AzvA1X/XTDUPa3aocRkXHRTx+LWE7OPSKoacyzUclPfv542ReQoXhb+ul jraNiX886Fwb36ItGkDjHQ0yGBbBlTZlZyzi96C8nUdsyfDVV2IEGaeUG YzRaoaVxDM9WN/q3wGth++vHWheSnoZI+mFOxMw4kzHZNhc6Wz10cstmo A==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456280" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456280" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436072" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436072" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:33 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 5/9] selftests/resctrl: Replace obsolete memalign() with posix_memalign() Date: Wed, 15 Feb 2023 15:06:01 +0200 Message-Id: <20230215130605.31583-6-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902632822052541?= X-GMAIL-MSGID: =?utf-8?q?1757902632822052541?= memalign() is obsolete according to its manpage. Replace memalign() with posix_memalign() and remove malloc.h include that was there for memalign(). As a pointer is passed into posix_memalign(), initialize *p to NULL to silence a warning about the function's return value being used as uninitialized (which is not valid anyway because the error is properly checked before p is returned). Suggested-by: Reinette Chatre Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/fill_buf.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/testing/selftests/resctrl/fill_buf.c b/tools/testing/selftests/resctrl/fill_buf.c index c20d0a7ecbe6..3cd0b337eae5 100644 --- a/tools/testing/selftests/resctrl/fill_buf.c +++ b/tools/testing/selftests/resctrl/fill_buf.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include "resctrl.h" @@ -64,11 +63,13 @@ static void mem_flush(void *p, size_t s) static void *malloc_and_init_memory(size_t s) { + void *p = NULL; uint64_t *p64; size_t s64; + int ret; - void *p = memalign(PAGE_SIZE, s); - if (!p) + ret = posix_memalign(&p, PAGE_SIZE, s); + if (ret < 0) return NULL; p64 = (uint64_t *)p; From patchwork Wed Feb 15 13:06:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57534 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180726wrn; Wed, 15 Feb 2023 05:09:52 -0800 (PST) X-Google-Smtp-Source: AK7set8tOY0q/QP98VgEb0QN7IobJzswc0X1e4ppQkKyRN3ICnZ7MA97YTynYcbyuqu+Z+NkR0Dw X-Received: by 2002:a17:90b:224b:b0:22c:b1c5:ae87 with SMTP id hk11-20020a17090b224b00b0022cb1c5ae87mr2551431pjb.45.1676466592329; Wed, 15 Feb 2023 05:09:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466592; cv=none; d=google.com; s=arc-20160816; b=EPtKmcEYHeSvyyarCv2Clflk0T29Exvu/n9GR1YT85Smq+lEtkq+RUNCEfpdqI+FWX XrZqkUk9Epf0HPo3CFY96mXajLr0vFL2gHBE7mMdJhn4tRpSg1dViOQWx52QJdUkILnG t984W2nToTQtE7sD/yFzdMh1TMavXzqGqRtx0tIXSCqK7YkYJPGflND5TqT35rSE/Nv9 41zLJKyY4I4dgc/rla4vgNRvDCLjngjQldUa1T70b1Ovw7Eqy2gyRjEEeheHJwTaWMk6 zdilNMVvMFow1rMZtzdQoVaibjCBOslCBrlvK/vTebR0nDMUDQq+BG0wcQXjRqqvGKqm 0uNQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=dOzs75YznMjU/70PCdyVS/2cvTs0HlnyBQuChQ+h4kI=; b=MJ9YCrf/cKmkLhk8LFAFHTowznhkXdp/Bamtl2ePs6VrqdGz51HryBU+QXduiS3kP9 DKd1Ca/zvRsYI3v0GlA9vmzy9JQFYo/ESeW0HQOhz6rXatATGvDRV1h8w6VGgk3AQrtE 9SqdQwDrsAUUuYP61QXLU4KGbsNr7okZqrAvECVokjzGe9FYjdPhkT0ZpclYYR94TkJT VKV5uN8AW4ghd2kNTx1Tq2wRNHDHGxCBqj0SXznV6kG7XcSBXvwGRpj2HCWUjubYAIpc dYJVBCX2M+En6Ivu6bB+iB/uKfezzmdkxQLA8gJ3yVb3IklBaJbLGvU4WSmYrQJWoZiS nvGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=erLBOpL4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j9-20020a17090a840900b00233e92f0ed0si1887689pjn.143.2023.02.15.05.09.38; Wed, 15 Feb 2023 05:09:52 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=erLBOpL4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234107AbjBONHB (ORCPT + 99 others); Wed, 15 Feb 2023 08:07:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234103AbjBONGw (ORCPT ); Wed, 15 Feb 2023 08:06:52 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EBA438B66; Wed, 15 Feb 2023 05:06:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466399; x=1708002399; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TiJbClLs47EPNPKSTZyf82H5dlzHWOIydhuXM2If5tk=; b=erLBOpL4ZmQYfwjDYmetqH4ESwiyoA93pkjFsYPAOQ5x8n8dxhZAP4ll O8C8V1JbfnImw3YYTn699P6PoC99JV8CBCCdDfueFAEi0/U0JWnMFWBun hzEQ84sRlDKsrYV6u8hREL3hJathIyKYdhkJEncCswBQkStPCKs+0eCPE JC226xhxeH6DYWY9r6VjjCKHvBqCiw9OJci5fpb+87ouvJv4Y5BQlFG0K YLmz24YvFWU8QlQqChlBeLry+F/3HpKhepi1Nptlv5w8hjcbcMooEEvBx o/qhAoldJxQ1lYO2P4uB2bpJUSLk/3uwAhYupyRNvh7VlpEsiHUZP6wPd w==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456292" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456292" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:39 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436083" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436083" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:37 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 6/9] selftests/resctrl: Change initialize_llc_perf() return type to void Date: Wed, 15 Feb 2023 15:06:02 +0200 Message-Id: <20230215130605.31583-7-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902633800554384?= X-GMAIL-MSGID: =?utf-8?q?1757902633800554384?= initialize_llc_perf() unconditionally returns 0. initialize_llc_perf() performs only memory initialization, none of which can fail. Change the return type from int to void to accurately reflect that its return value doesn't need to be checked. Remove the error checking from the only callsite. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/cache.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index 0485863a169f..585186c874dc 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -48,7 +48,7 @@ static int perf_event_open_llc_miss(pid_t pid, int cpu_no) return 0; } -static int initialize_llc_perf(void) +static void initialize_llc_perf(void) { memset(&pea_llc_miss, 0, sizeof(struct perf_event_attr)); memset(&rf_cqm, 0, sizeof(struct read_format)); @@ -59,8 +59,6 @@ static int initialize_llc_perf(void) pea_llc_miss.config = PERF_COUNT_HW_CACHE_MISSES; rf_cqm.nr = 1; - - return 0; } static int reset_enable_llc_perf(pid_t pid, int cpu_no) @@ -234,11 +232,8 @@ int cat_val(struct resctrl_val_param *param) if (ret) return ret; - if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) { - ret = initialize_llc_perf(); - if (ret) - return ret; - } + if (!strncmp(resctrl_val, CAT_STR, sizeof(CAT_STR))) + initialize_llc_perf(); /* Test runs until the callback setup() tells the test to stop. */ while (1) { From patchwork Wed Feb 15 13:06:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57535 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180918wrn; Wed, 15 Feb 2023 05:10:14 -0800 (PST) X-Google-Smtp-Source: AK7set8H2iSFq1Tguh2Q6DDHjf/4h3xg7IHwt4+Was2Iaa1euLB/LXHfTvrddAYkLaUKtiXFu9Ii X-Received: by 2002:a62:4e4e:0:b0:5a8:b041:9420 with SMTP id c75-20020a624e4e000000b005a8b0419420mr1303078pfb.31.1676466613585; Wed, 15 Feb 2023 05:10:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466613; cv=none; d=google.com; s=arc-20160816; b=DWUUVkh7caXcJHAt2Z3seykffgwGc+trIa4jQOzoMknB21l4Oo7NiKsmNMe6j/urgV vU8LHZ2QpvbofEtbqRjyKxT+1Yz5Tc6NAWXFNN+0MZ3NQfOpaJticn+lt4IPSum80j6Q +o5lOSwOMe/JVgEhIhewT38J0AE40Olo8h/VWEoAVV1R27qFWWCh/HQ1J+AxhW1BxIVM nYuMj7wc2nK8O84r7gsLs0h0+NkwbjmdcwwDtWtl3JpTZQ5oAhoxK33ualFIDd+eqDJQ nkt56V4QGe8VTvDYmKPFDpfe4R+5KAs8annAoAB62Wxk3+kH0dnhmjwCfhlnhb8lG16O 2oeg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VE5c8Ups0ZqsCpYe8R86JibkEDhJKbfN4AdlMCTgbwQ=; b=MLclLJYZ3JfyhVI7BNyo6jS1nT7Vx3NUmqkU/vMnoBxwRYXBvzOMrqAXDibCMVE7Gb 8R/l0x/FYrSEYtryaBhZn6PsJZ/m05FADST97wDSLEB5DYoHpOjigjBRDXWxy+HqAq+3 W+2DARtcEQA8hC0n00l3j7vn0FUtWq4jQjKw5p8GwXfKMRpJU4Rw8giIUrxM0cu4YHBa l69JD+yx3JLFC4hEyt2ATbgv3vtkKUenk/OovptK5k39dGgEAU91tdrTjiU7eCojv+Ff fhsFY6q1SmX308K9Y4Q6EIUp7P1SdI5G91s8o8BSzto4mIGOfMuacJhFSSl9dDdW4V7d l4Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=TRZAIE16; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a627b14000000b005a8dcaeba57si4912500pfc.371.2023.02.15.05.09.59; Wed, 15 Feb 2023 05:10:13 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=TRZAIE16; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234105AbjBONHM (ORCPT + 99 others); Wed, 15 Feb 2023 08:07:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234098AbjBONG6 (ORCPT ); Wed, 15 Feb 2023 08:06:58 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 014C339286; Wed, 15 Feb 2023 05:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466404; x=1708002404; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FJytfcP4W/Nd+1A+HEFfRfK2SHfSGE7vjyPsbBrbJmY=; b=TRZAIE167DY/ZC9oRyUKjguxo6j6BTcOueb8naUcUYop9qcV98ssqpar opte8qj9wCCOSKfBsNOBbLYzxz4o+bbxP1nRq+zmGwnqYe4C5pkJUwpag uvoYfnSDfhA+ztayGE1HQJN74VPpHdfeAfp7l4wEMIWHNYS44xUyq815U 35pgbUMQHwJhnGWN2RmTNXuOe4z7gOZ3PwV+0Fsk+KcBHVqaQd93Z4BvL GFxcRkknCwBLbTzF2vKTR0KBMhT+OHccPqxeT40Pu0+3p69DXuiDMKEOc ftBjKNepqCFz+4NFDSbzA9uVq2/j8U98hCs+BAGZNWWQZEezmkvw6uiPm Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456307" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456307" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:42 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436095" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436095" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:40 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 7/9] selftests/resctrl: Change name from CBM_MASK_PATH to INFO_PATH Date: Wed, 15 Feb 2023 15:06:03 +0200 Message-Id: <20230215130605.31583-8-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902655835216160?= X-GMAIL-MSGID: =?utf-8?q?1757902655835216160?= From: Fenghua Yu CBM_MASK_PATH is actually the path to resctrl/info. Change the macro name to correctly indicate what it represents. [ ij: Tweaked the changelog. ] Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/resctrl.h | 2 +- tools/testing/selftests/resctrl/resctrlfs.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index f44fa2de4d98..20aaa7c0e784 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -28,7 +28,7 @@ #define MB (1024 * 1024) #define RESCTRL_PATH "/sys/fs/resctrl" #define PHYS_ID_PATH "/sys/devices/system/cpu/cpu" -#define CBM_MASK_PATH "/sys/fs/resctrl/info" +#define INFO_PATH "/sys/fs/resctrl/info" #define L3_PATH "/sys/fs/resctrl/info/L3" #define MB_PATH "/sys/fs/resctrl/info/MB" #define L3_MON_PATH "/sys/fs/resctrl/info/L3_MON" diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 6f543e470ad4..cc6cf49e3129 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -210,7 +210,7 @@ int get_cbm_mask(char *cache_type, char *cbm_mask) if (!cbm_mask) return -1; - sprintf(cbm_mask_path, "%s/%s/cbm_mask", CBM_MASK_PATH, cache_type); + sprintf(cbm_mask_path, "%s/%s/cbm_mask", INFO_PATH, cache_type); fp = fopen(cbm_mask_path, "r"); if (!fp) { From patchwork Wed Feb 15 13:06:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57536 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp180941wrn; Wed, 15 Feb 2023 05:10:16 -0800 (PST) X-Google-Smtp-Source: AK7set8Hfslv3glSXTXCD0vsuySJ++BwPLFid8TzAYt6+dQW6mvpgWGaVn6zONFY78CRN5gyfOGZ X-Received: by 2002:a17:902:e5c4:b0:19a:aed0:dca3 with SMTP id u4-20020a170902e5c400b0019aaed0dca3mr2492789plf.37.1676466615770; Wed, 15 Feb 2023 05:10:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466615; cv=none; d=google.com; s=arc-20160816; b=NH/q7MessnQyHSzK3CsUnvy2wNxy9XR8iIHG23dTdVWlP8/6XekpmLi2i8vtp1OxCl lh18qpKgcyKmgOP+9zG76JHJlgUpgBs44ec+oym1dQ1pWpg3Sac7NJOiGacv/udqygNU HY/Ax54m1g7FAxwXyba9gX0r73Fjnx65YIWyiycY5j6NL6ovOEJ8cElniM8TNw15Z6cZ 4XgLA/nNmogVeN2zUvgsokI8yZkhxVhEKYZiSCgGU/PYku1CjCaulpItEhKHMhDWvot/ SrrCEPrfP3lzw/g9OJ3FzDKkphqQKjv3yve0Rr03Dp+HbKiiSwwstl4PTILWUF9lDBB8 wCKA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=DYLLp7xKbDrR/g6WxnMJW0RIn5aU/DvqUYRNgs6eqo4=; b=WgpiSsMks5/DZsARoLIsqkR5qc/t9G2aGp8WKZGJvVaCdb73ag93wYBX/CfpeD2D4V 3NlZZMBln3KF9Y7O4THFHj3jKG+8vH5cSNl2dXM4iW8LkbyM27VLwSo2xYET9vqfi4Y1 VBfTSjVJPrYCy63rYw9Zh/jj9qS96feX/Ju8twa3s+2STyWnAlcy1hdWxZYJNyqOnwAb D0BAsAB4CeCjuvbeLcRyuylTCJyKRdsBMpEf17umnXXDQUZDqxTmu308LijTALaVw+ZG CjAJfCW2FCVMYKXcTkhKDJz5yHQem1qTRpRo2I8iwSh8sxa93CYtR6R29Vod60Ge9izF s8AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kEjPQe4i; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a170902849400b0019a80b2e956si11570251plo.412.2023.02.15.05.10.02; Wed, 15 Feb 2023 05:10:15 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=kEjPQe4i; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234142AbjBONHP (ORCPT + 99 others); Wed, 15 Feb 2023 08:07:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234133AbjBONHD (ORCPT ); Wed, 15 Feb 2023 08:07:03 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D2B392A0; Wed, 15 Feb 2023 05:06:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466406; x=1708002406; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Rbo6pbyWbXZwebkS7BOf6e5/MHJ+u2ASUXfLqvQcmlA=; b=kEjPQe4iPiSiRMDjdgTjNDOG6OZZqPXGYSc1bl14ISwicuSd+2f8/Ck1 KtH8/QNL0p6OqIB4AUayWoIK92kWEHgrTiVoU6qefOwox622hOVbD7V9s eyJ3AEN6BQVc/3mJz6Sw4zTP+4JNjdsrPM+/nZPb0CoFYMzp1tpL9lgOt urVI3av/oY3pqvWQSH20wiDNIl1/St/AywNYba6bTXA6CpDcmIYLBBcHu pz9SL21v+SRH34NgOT8hSCZhy/eha19oohtBfPH6dCL84zkMNcCraICx6 EfZxT8BC6M3UMoHs74gHj8tDmUc+MyIOoBEwGrF8t1TrqKeaQf1Bk6s5q A==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456342" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456342" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:45 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436105" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436105" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:43 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 8/9] selftests/resctrl: Use remount_resctrlfs() consistently with boolean Date: Wed, 15 Feb 2023 15:06:04 +0200 Message-Id: <20230215130605.31583-9-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902657893133609?= X-GMAIL-MSGID: =?utf-8?q?1757902657893133609?= remount_resctrlfs() accepts a boolean value as an argument. Some tests pass 0/1 and some tests pass true/false. Make all the callers of remount_resctrlfs() use true/false so that the parameter usage is consistent across tests. Co-developed-by: Fenghua Yu Signed-off-by: Fenghua Yu Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/cat_test.c | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 7 +++---- tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 2 +- tools/testing/selftests/resctrl/resctrl.h | 2 +- 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tools/testing/selftests/resctrl/cat_test.c b/tools/testing/selftests/resctrl/cat_test.c index 2d3c7c77ab6c..08070d4fa735 100644 --- a/tools/testing/selftests/resctrl/cat_test.c +++ b/tools/testing/selftests/resctrl/cat_test.c @@ -145,7 +145,7 @@ int cat_perf_miss_val(int cpu_no, int n, char *cache_type) struct resctrl_val_param param = { .resctrl_val = CAT_STR, .cpu_no = cpu_no, - .mum_resctrlfs = 0, + .mum_resctrlfs = false, .setup = cat_setup, }; diff --git a/tools/testing/selftests/resctrl/cmt_test.c b/tools/testing/selftests/resctrl/cmt_test.c index 3b0454e7fc82..47cde5c02b7f 100644 --- a/tools/testing/selftests/resctrl/cmt_test.c +++ b/tools/testing/selftests/resctrl/cmt_test.c @@ -82,12 +82,11 @@ void cmt_test_cleanup(void) int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd) { - int ret, mum_resctrlfs; + int ret; cache_size = 0; - mum_resctrlfs = 1; - ret = remount_resctrlfs(mum_resctrlfs); + ret = remount_resctrlfs(true); if (ret) return ret; @@ -118,7 +117,7 @@ int cmt_resctrl_val(int cpu_no, int n, char **benchmark_cmd) .ctrlgrp = "c1", .mongrp = "m1", .cpu_no = cpu_no, - .mum_resctrlfs = 0, + .mum_resctrlfs = false, .filename = RESULT_FILE_NAME, .mask = ~(long_mask << n) & long_mask, .span = cache_size * n / count_of_bits, diff --git a/tools/testing/selftests/resctrl/mba_test.c b/tools/testing/selftests/resctrl/mba_test.c index 97dc98c0c949..7defb32ad0de 100644 --- a/tools/testing/selftests/resctrl/mba_test.c +++ b/tools/testing/selftests/resctrl/mba_test.c @@ -154,7 +154,7 @@ int mba_schemata_change(int cpu_no, char *bw_report, char **benchmark_cmd) .ctrlgrp = "c1", .mongrp = "m1", .cpu_no = cpu_no, - .mum_resctrlfs = 1, + .mum_resctrlfs = true, .filename = RESULT_FILE_NAME, .bw_report = bw_report, .setup = mba_setup diff --git a/tools/testing/selftests/resctrl/mbm_test.c b/tools/testing/selftests/resctrl/mbm_test.c index 280187628054..c9dfa54af42f 100644 --- a/tools/testing/selftests/resctrl/mbm_test.c +++ b/tools/testing/selftests/resctrl/mbm_test.c @@ -122,7 +122,7 @@ int mbm_bw_change(int span, int cpu_no, char *bw_report, char **benchmark_cmd) .mongrp = "m1", .span = span, .cpu_no = cpu_no, - .mum_resctrlfs = 1, + .mum_resctrlfs = true, .filename = RESULT_FILE_NAME, .bw_report = bw_report, .setup = mbm_setup diff --git a/tools/testing/selftests/resctrl/resctrl.h b/tools/testing/selftests/resctrl/resctrl.h index 20aaa7c0e784..9555a6f683f7 100644 --- a/tools/testing/selftests/resctrl/resctrl.h +++ b/tools/testing/selftests/resctrl/resctrl.h @@ -64,7 +64,7 @@ struct resctrl_val_param { char mongrp[64]; int cpu_no; unsigned long span; - int mum_resctrlfs; + bool mum_resctrlfs; char filename[64]; char *bw_report; unsigned long mask; From patchwork Wed Feb 15 13:06:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ilpo_J=C3=A4rvinen?= X-Patchwork-Id: 57537 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp181190wrn; Wed, 15 Feb 2023 05:10:40 -0800 (PST) X-Google-Smtp-Source: AK7set/sJZaRTba7JgYqik6pFz1ecDwv6T7cxHAsR+0rAmlN8mSf74GYfvZ58xnbkxW/Ic6suJra X-Received: by 2002:a17:903:5c4:b0:19a:703d:c1c6 with SMTP id kf4-20020a17090305c400b0019a703dc1c6mr1846582plb.26.1676466640615; Wed, 15 Feb 2023 05:10:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676466640; cv=none; d=google.com; s=arc-20160816; b=ssH+dJIJTo7TZpVqeQIcXCiOHEyK0pgDXI6xFZT3Cjv3vsiidE8siXh6qNmk6Gui2F mTrSWQKpRvjFhPeJ10S4h+q4BWAxnGOCI/ktYBBDw9cUMaTV3L2n+yR/YuN0qoYdzT8S 672NN5QtIGQqN6XkK0acVu5h+TqKuyWUHVMiMAcq71hdc2kLUEe/RUUovBjc3c/X1Oac y5nUdAT2iEXYXOBBdnE8MVmS0xfNVPa95d5amMKWSfNPnVLPIhGPcg9+QTZkaRInyXyO 7Dakzj7hyBs+QRyZoiPvIoRAFPW8BwHFhq1OeMesA72N8bT/W9VSWoz7GSXw7A2DpYcF G73A== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4/IKN2Sr7/eCgHWUouMZnsg+FJLx+eY52Lz7hQC6ydg=; b=eUq1H5vUWRi//0rQQlcFxO70Rb2Ics4vXaJS1l/6UzE0VCITY3ERXzQD/uBuSDN0gK JYmAF8zOyhCSqdTC5TKyPUgy2/ee4gw0Egu4k41zSS1nDf/p8YM4/HNtwhx5MJyslDQz 4Y6yhBuP3eBwePOu9jffeDuXnUXVijNqeRiTctCOxjfHD9gpwS1Mn++XXRlyOIXkSANk LOouRP04k4O5s6Ab3i7vG9PHbFzIo6Fc4m10dGeuQSzfaDF8mZNN8PYzVpICHY1ixF3V /CTjQCYi/Euaqk4IEggG8kGWrfCah94pQo2w6g79J3ch2mQHL8Vy5emhRdxHqfBn6h+0 xyTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=A7l7IwMJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a170902d50a00b00198e4bd86besi42467plg.506.2023.02.15.05.10.26; Wed, 15 Feb 2023 05:10:40 -0800 (PST) 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; dkim=pass header.i=@intel.com header.s=Intel header.b=A7l7IwMJ; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234124AbjBONH0 (ORCPT + 99 others); Wed, 15 Feb 2023 08:07:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234160AbjBONHQ (ORCPT ); Wed, 15 Feb 2023 08:07:16 -0500 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4FF838B74; Wed, 15 Feb 2023 05:06:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676466412; x=1708002412; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TMTPGCBFEcyXIrRfllTsJbANrKN0ke5YKs8+ZFm0YOU=; b=A7l7IwMJm5LfeHSE4k4jCw3PP/iyCp+/IygZSffoEgcWJPo/aZqvoVD8 xw6Mv+lfZi8zRWV3BgrB8rmAwWjeQaMXtsj/3ND7MOMWwkxe1GF3xbpoY Y4woRDWoU33dO6A38eCeMJLNX1uUIbnAOZbkvlY2kvDjRFzwP58JvACfA TLOjwrH2Ui3HJzwpLdls5GuL+xpvWCXGYC86jtyRUkCnSQ3J2PDoxl38p 24YAE0EVsgl83z5AAZ0VenbkKePhZFnCBNRqs0bSNTI4p+OQGThWYeVDv tOhRK9jxHwq/jobOw0/9b1zoSfLqIoCbNm0Tq/m5JnF70ttKNn9hRiJez Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="319456365" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="319456365" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:48 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10621"; a="812436116" X-IronPort-AV: E=Sophos;i="5.97,299,1669104000"; d="scan'208";a="812436116" Received: from hshannan-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.49.120]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Feb 2023 05:06:46 -0800 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= To: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre , Fenghua Yu , Shuah Khan Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= Subject: [PATCH v2 9/9] selftests/resctrl: Correct get_llc_perf() param in function comment Date: Wed, 15 Feb 2023 15:06:05 +0200 Message-Id: <20230215130605.31583-10-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> References: <20230215130605.31583-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757902683911559994?= X-GMAIL-MSGID: =?utf-8?q?1757902683911559994?= get_llc_perf() function comment refers to cpu_no parameter that does not exist. Correct get_llc_perf() the comment to document llc_perf_miss instead. Signed-off-by: Ilpo Järvinen Reviewed-by: Reinette Chatre --- tools/testing/selftests/resctrl/cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/cache.c b/tools/testing/selftests/resctrl/cache.c index 585186c874dc..8a4fe8693be6 100644 --- a/tools/testing/selftests/resctrl/cache.c +++ b/tools/testing/selftests/resctrl/cache.c @@ -77,7 +77,7 @@ static int reset_enable_llc_perf(pid_t pid, int cpu_no) /* * get_llc_perf: llc cache miss through perf events - * @cpu_no: CPU number that the benchmark PID is binded to + * @llc_perf_miss: LLC miss counter that is filled on success * * Perf events like HW_CACHE_MISSES could be used to validate number of * cache lines allocated.