From patchwork Thu Aug 10 09:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 712527 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 074F0C04A94 for ; Thu, 10 Aug 2023 09:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233333AbjHJJCV (ORCPT ); Thu, 10 Aug 2023 05:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56332 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbjHJJCU (ORCPT ); Thu, 10 Aug 2023 05:02:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56CFE211F for ; Thu, 10 Aug 2023 02:01:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691658090; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=JIBQNdn5gJw9CfPBmwfXP8HD/eN8kJoHKJNetKw23pk=; b=Khj/bN6ujC6KfdP3qYFIhl/zSVxGWgUjLsSCxiklqxIqbJ3oGJHpbZ677ikNp/dTVYQbtB f5eqHVEsKdzsd8JAZ8eekx5AYmIODIeAXaYAGpP/0RwuGt3kMMsjm4DGjW6fi7UnBqBqcF uf/8ShRnsX4o3i4k8DcHquLN9zKOVxk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-435-tiNCEFv8Mqqy8spIW5j8ZQ-1; Thu, 10 Aug 2023 05:01:29 -0400 X-MC-Unique: tiNCEFv8Mqqy8spIW5j8ZQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1BFEA185A792 for ; Thu, 10 Aug 2023 09:01:29 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 77F7D492C13; Thu, 10 Aug 2023 09:01:28 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: jkacur@redhat.com, Tomas Glozar Subject: [PATCH 1/3] rteval: Allow arguments specific to module group Date: Thu, 10 Aug 2023 11:01:21 +0200 Message-ID: <20230810090123.151924-2-tglozar@redhat.com> In-Reply-To: <20230810090123.151924-1-tglozar@redhat.com> References: <20230810090123.151924-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Return grparser from ModuleContainer.SetupModuleOptions, which allows it to be used to setup additional options in *Modules class. Signed-off-by: Tomas Glozar --- rteval/modules/__init__.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/rteval/modules/__init__.py b/rteval/modules/__init__.py index 794135d..f4fd160 100644 --- a/rteval/modules/__init__.py +++ b/rteval/modules/__init__.py @@ -312,7 +312,7 @@ the information provided by the module""" # Ignore if a section is not found cfg = None - grparser = parser.add_argument_group("Options for the %s module" % shortmod) + modgrparser = parser.add_argument_group("Options for the %s module" % shortmod) for (o, s) in list(opts.items()): descr = 'descr' in s and s['descr'] or "" metavar = 'metavar' in s and s['metavar'] or None @@ -327,13 +327,15 @@ the information provided by the module""" default = 'default' in s and s['default'] or None - grparser.add_argument('--%s-%s' % (shortmod, o), - dest="%s___%s" % (shortmod, o), - action='store', - help='%s%s' % (descr, - default and ' (default: %s)' % default or ''), - default=default, - metavar=metavar) + modgrparser.add_argument('--%s-%s' % (shortmod, o), + dest="%s___%s" % (shortmod, o), + action='store', + help='%s%s' % (descr, + default and ' (default: %s)' % default or ''), + default=default, + metavar=metavar) + + return grparser def InstantiateModule(self, modname, modcfg, modroot=None): From patchwork Thu Aug 10 09:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 712528 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 93078C001B0 for ; Thu, 10 Aug 2023 09:02:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229820AbjHJJCT (ORCPT ); Thu, 10 Aug 2023 05:02:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233074AbjHJJCS (ORCPT ); Thu, 10 Aug 2023 05:02:18 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BCD42127 for ; Thu, 10 Aug 2023 02:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691658091; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8PBGc6IebAkMokCkxGkYct3L2/n6z7WyIZUJS4hofmk=; b=CdrwzlvWj0aRNWOq7yLDKFW8VT1SqKYC5Bui/uLCj43WbJ/EKF3Vq2ilOdbIHduWckdQPt 5bAax66FF8lNsbcEqR51BhlW2Dio4qkEBbHjvJqDkxlEJqJdBtqSkur/4ED+D0IMaLQauw Urb+r+6ALIZ01fLFc0zRdPDH879/3kM= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-NF-kjuIpNIK4XtCfhk1tlQ-1; Thu, 10 Aug 2023 05:01:30 -0400 X-MC-Unique: NF-kjuIpNIK4XtCfhk1tlQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id F0B6328237C4 for ; Thu, 10 Aug 2023 09:01:29 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55A3A492C13; Thu, 10 Aug 2023 09:01:29 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: jkacur@redhat.com, Tomas Glozar Subject: [PATCH 2/3] rteval: Add run_on_isolcpus option to measurements Date: Thu, 10 Aug 2023 11:01:22 +0200 Message-ID: <20230810090123.151924-3-tglozar@redhat.com> In-Reply-To: <20230810090123.151924-1-tglozar@redhat.com> References: <20230810090123.151924-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Add option --measurement-run-on-isolcpus for the user to specify to include isolcpus in the default cpulist (without --measurement-cpulist). A default value might also be specified in rteval.conf: [measurement] run-on-isolcpus: true Note that values different from true evaluate as false. Signed-off-by: Tomas Glozar --- rteval/modules/measurement/__init__.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py index 0e395be..2472b43 100644 --- a/rteval/modules/measurement/__init__.py +++ b/rteval/modules/measurement/__init__.py @@ -146,7 +146,15 @@ measurement profiles, based on their characteristics""" def SetupModuleOptions(self, parser): "Sets up all the measurement modules' parameters for the option parser" - self.__container.SetupModuleOptions(parser, self.__cfg) + grparser = self.__container.SetupModuleOptions(parser, self.__cfg) + + # Set up options specific for measurement module group + grparser.add_argument("--measurement-run-on-isolcpus", + dest="measurement___run_on_isolcpus", + action="store_true", + default=self.__cfg.GetSection("measurement").setdefault("run-on-isolcpus", False).lower() + == "true", + help="Include isolated CPUs in default cpulist") def Setup(self, modparams): @@ -157,9 +165,10 @@ measurement profiles, based on their characteristics""" modcfg = self.__cfg.GetSection("measurement") cpulist = modcfg.cpulist + run_on_isolcpus = modcfg.run_on_isolcpus for (modname, modtype) in modcfg: - if modtype.lower() == 'module': # Only 'module' will be supported (ds) + if isinstance(modtype, str) and modtype.lower() == 'module': # Only 'module' will be supported (ds) # Extract the measurement modules info modinfo = self.__container.ModuleInfo(modname) @@ -179,6 +188,7 @@ measurement profiles, based on their characteristics""" # Setup this imported module inside the appropriate measurement profile self.__cfg.AppendConfig(modname, modparams) self.__cfg.AppendConfig(modname, {'cpulist':cpulist}) + self.__cfg.AppendConfig(modname, {'run-on-isolcpus':run_on_isolcpus}) mp.Setup(modname) del self.__container @@ -190,11 +200,12 @@ measurement profiles, based on their characteristics""" # Get the reports from all meaurement modules in all measurement profiles rep_n = libxml2.newNode("Measurements") cpulist = self.__cfg.GetSection("measurement").cpulist + run_on_isolcpus = self.__cfg.GetSection("measurement").run_on_isolcpus if cpulist: # Convert str to list and remove offline cpus cpulist = CpuList(cpulist).cpulist else: - cpulist = SysTop().default_cpus() + cpulist = SysTop().online_cpus() if run_on_isolcpus else SysTop().default_cpus() rep_n.newProp("measurecpus", collapse_cpulist(cpulist)) for mp in self.__measureprofiles: From patchwork Thu Aug 10 09:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 713088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C144C04E69 for ; Thu, 10 Aug 2023 09:02:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233339AbjHJJCV (ORCPT ); Thu, 10 Aug 2023 05:02:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233225AbjHJJCU (ORCPT ); Thu, 10 Aug 2023 05:02:20 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 760B22103 for ; Thu, 10 Aug 2023 02:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691658092; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lxOQ0L6srgd3pRlQ1R7yRX3n1t5d9kYr2+nhBYz9rAY=; b=VHvPE+sk9gRUSJtgoAt9Ta7PtHdY5hLGtZ3X7KUc7rcvXvRUU08ijwYO+iK8loBgRxYi0Q xSJU0oAx5AsGQxGKTvpnWWIB1v5NUG5c36e1ehzuod934Ftsy5k4VQYUSIPwKTLNo/82+K HFkgvJa+K7GLpUk+2UFXa07Vcby1osc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-215-o2aUpVk4PQ6lrKTgRz-rHQ-1; Thu, 10 Aug 2023 05:01:31 -0400 X-MC-Unique: o2aUpVk4PQ6lrKTgRz-rHQ-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CDC3B8DC665 for ; Thu, 10 Aug 2023 09:01:30 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 36667492C13; Thu, 10 Aug 2023 09:01:30 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: jkacur@redhat.com, Tomas Glozar Subject: [PATCH 3/3] rteval: Support run-on-isolcpus in cyclictest Date: Thu, 10 Aug 2023 11:01:23 +0200 Message-ID: <20230810090123.151924-4-tglozar@redhat.com> In-Reply-To: <20230810090123.151924-1-tglozar@redhat.com> References: <20230810090123.151924-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org If --measurement-run-on-isolcpus is enabled, add isolated CPUs to the cpumask for the case when --measurement-cpulist is not specified. If both options are specified, display a warning. Signed-off-by: Tomas Glozar --- rteval/modules/measurement/cyclictest.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rteval/modules/measurement/cyclictest.py b/rteval/modules/measurement/cyclictest.py index ace8db4..4d7fcf2 100644 --- a/rteval/modules/measurement/cyclictest.py +++ b/rteval/modules/measurement/cyclictest.py @@ -214,6 +214,7 @@ class Cyclictest(rtevalModulePrototype): self.__cpus = [] self.__cyclicdata = {} self.__sparse = False + self.__run_on_isolcpus = bool(self.__cfg.setdefault('run-on-isolcpus', False)) if self.__cfg.cpulist: self.__cpulist = self.__cfg.cpulist @@ -224,14 +225,21 @@ class Cyclictest(rtevalModulePrototype): self.__cpulist = collapse_cpulist(self.__cpus) self.__cpus = [str(c) for c in self.__cpus] self.__sparse = True + if self.__run_on_isolcpus: + self._log(Log.WARN, "ignoring --measurement-run-on-isolcpus, since cpulist is specified") else: self.__cpus = SysTopology().online_cpus_str() # Get the cpuset from the environment cpuset = os.sched_getaffinity(0) # Convert the elements to strings cpuset = [str(c) for c in cpuset] - # Only include cpus that are in the cpuset - self.__cpus = [c for c in self.__cpus if c in cpuset] + # Get isolated CPU list + isolcpus = [str(c) for c in SysTopology().isolated_cpus()] + # Only include cpus that are in the cpuset and isolated CPUs if run_on_isolcpus is enabled + self.__cpus = [c for c in self.__cpus if c in cpuset or self.__run_on_isolcpus and c in isolcpus] + if self.__run_on_isolcpus: + self.__sparse = True + self.__cpulist = collapse_cpulist(self.__cpus) # Sort the list of cpus to align with the order reported by cyclictest self.__cpus.sort(key=int)