Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp210040ybh; Fri, 6 Mar 2020 19:48:50 -0800 (PST) X-Google-Smtp-Source: ADFU+vuDCcdF+hMcP8kbnTmbqkR37tnhT4v5m2EetMLrrHYTeu+vfRFEJe/gQgOwVpdCTflmDL0I X-Received: by 2002:a05:6808:3a1:: with SMTP id n1mr4674518oie.89.1583552930139; Fri, 06 Mar 2020 19:48:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583552930; cv=none; d=google.com; s=arc-20160816; b=i8FukDB6LEP6pHhjRGU7UXtJlGu8eVbj+7jYz7TpmVqYlinpX9QI2/xH+ZPJUn/w5T qr0IUEvu6KIaK3dV361QLjLaTN+4Try+g4pZIU/TTlMqMrUlSQx4K8gwBsNKozR73If3 G9Sf6kF+v4Z+bjon/e7zuwqn+S0KwnHIHxORypIepiMQXC9f4gNZ9GkeWH01T/eW7GYE vAYzrnGRKlMLtvdwytresT4Zfc7JtCfAB5hAL6SVQGstCk3oR8PDE9+Ts5ynbIb6EtV2 BAo4ayTjrhtki4rQ84QZXsWKONgvfjErdSMz3LrIXHAHOV/xfZ0zBC6kiePV3k5ps8No G1Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=6j/QcdxmeSmz/yuNDLu5Pgx7qg1xgGyaIsWnNnOgrS4=; b=IVpNGi+itIzhZbwxd+1vvUU9HvGowBOa0w1oa5ldnUMid/EiBqEtGPEXgcFNCfNDUs 7oUFS1SwAt/avuKY47pGFIG1TESkz4pdKaSytfrOs8aGiHv+qmTtwk9BQjdXSxwiSF3v 07xyZslq9ZAhkD+x+bbEvggfGOqHdxoyLr42HJTUWPKxByPJOiq3/tlfvsAJBM//Hvuq YShuqZ60p813EFErwfQYTcvKZXV8du8Wq5iFA5IDbWmUNdGHQ8kdEa0VNkajw0qeJmuU 2IrAo101QrhR47/lwEq180mQgTIVRhuYbFepKcH1+zog+6Kdma3/2TX+ZU+H0zq8fFQi UUlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f24si2565525otl.300.2020.03.06.19.48.38; Fri, 06 Mar 2020 19:48:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727066AbgCGDqQ (ORCPT + 99 others); Fri, 6 Mar 2020 22:46:16 -0500 Received: from mga11.intel.com ([192.55.52.93]:57577 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727052AbgCGDqP (ORCPT ); Fri, 6 Mar 2020 22:46:15 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2020 19:46:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,524,1574150400"; d="scan'208";a="235036005" Received: from sai-dev-mach.sc.intel.com ([143.183.140.153]) by fmsmga008.fm.intel.com with ESMTP; 06 Mar 2020 19:46:15 -0800 From: Sai Praneeth Prakhya To: shuah@kernel.org, linux-kselftest@vger.kernel.org Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, tony.luck@intel.com, reinette.chatre@intel.com, babu.moger@amd.com, james.morse@arm.com, ravi.v.shankar@intel.com, fenghua.yu@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, Sai Praneeth Prakhya Subject: [PATCH V1 04/13] selftests/resctrl: Ensure sibling CPU is not same as original CPU Date: Fri, 6 Mar 2020 19:40:45 -0800 Message-Id: X-Mailer: git-send-email 2.19.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Reinette Chatre The resctrl tests can accept a CPU on which the tests are run and use default of CPU #1 if it is not provided. In the CAT test a "sibling CPU" is determined that is from the same package where another thread will be run. The current algorithm with which a "sibling CPU" is determined does not take the provided/default CPU into account and when that CPU is the first CPU in a package then the "sibling CPU" will be selected to be the same CPU since it starts by picking the first CPU from core_siblings_list. Fix the "sibling CPU" selection by taking the provided/default CPU into account and ensuring a sibling that is a different CPU is selected. Signed-off-by: Reinette Chatre Signed-off-by: Sai Praneeth Prakhya --- tools/testing/selftests/resctrl/resctrlfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c index 226dd7fdcfb1..465faaad3239 100644 --- a/tools/testing/selftests/resctrl/resctrlfs.c +++ b/tools/testing/selftests/resctrl/resctrlfs.c @@ -268,7 +268,7 @@ int get_core_sibling(int cpu_no) while (token) { sibling_cpu_no = atoi(token); /* Skipping core 0 as we don't want to run test on core 0 */ - if (sibling_cpu_no != 0) + if (sibling_cpu_no != 0 && sibling_cpu_no != cpu_no) break; token = strtok(NULL, "-,"); } -- 2.7.4