From patchwork Fri Jun 30 09:19:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 699176 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 7CC15EB64DA for ; Fri, 30 Jun 2023 09:22:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbjF3JW4 (ORCPT ); Fri, 30 Jun 2023 05:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232281AbjF3JWm (ORCPT ); Fri, 30 Jun 2023 05:22:42 -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 B6D6A3C30 for ; Fri, 30 Jun 2023 02:20:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116836; 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=BGxFzztYxuG3lzbr6gdMoyMVH7K3+cDE30szbMN1MxY=; b=CagMp8Ms6jf3dgr+L5vefVNRdspTN/cAy/R8zbHTbhAB8OQNivB9izhb/9DJ4M7alr80pZ CxjcjDQZ7/NFwEB28LKYY2WDu5sfr4COc13opAEjh66e1Vq+ChO9YQCZ0SkKxeKROS0kPY eYMIvEFCWRAyYzALOYk4U//MH4Lzb7Q= 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-370-pDA9i2l8MfGsk3zvGaIUdA-1; Fri, 30 Jun 2023 05:20:34 -0400 X-MC-Unique: pDA9i2l8MfGsk3zvGaIUdA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E92FB88D125 for ; Fri, 30 Jun 2023 09:20:33 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5430A40C6CCD; Fri, 30 Jun 2023 09:20:33 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 1/6] rteval: Detect isolcpus in systopology Date: Fri, 30 Jun 2023 11:19:02 +0200 Message-ID: <20230630091951.916865-2-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Works similarly to online_cpus: - add CpuList.isolated_cpulist to filter isolated CPUs - add SysTopology.isolated_cpus to get list of isolated CPUs - add CpuList.nonisolated_cpulist to do the opposite filter - add SysTopology.default_cpus to get CPUs that are used for scheduling by default, i.e. online and non-isolated CPUs Signed-off-by: Tomas Glozar Signed-off-by: John Kacur --- rteval/systopology.py | 47 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/rteval/systopology.py b/rteval/systopology.py index c8f85c5..19443f9 100644 --- a/rteval/systopology.py +++ b/rteval/systopology.py @@ -127,6 +127,11 @@ class CpuList: return True return False + @staticmethod + def isolated_file_exists(): + """ Check whether machine / kernel is configured with isolated file """ + return os.path.exists(os.path.join(CpuList.cpupath, "isolated")) + @staticmethod def longest_sequence(cpulist): """ return index of last element of a sequence that steps by one """ @@ -214,6 +219,24 @@ class CpuList: newlist.append(cpu) return newlist + @staticmethod + def isolated_cpulist(cpulist): + """Given a cpulist, return a cpulist of isolated CPUs""" + if not CpuList.isolated_file_exists(): + return cpulist + isolated_cpulist = sysread(CpuList.cpupath, "isolated") + isolated_cpulist = CpuList.expand_cpulist(isolated_cpulist) + return list(set(isolated_cpulist) & set(cpulist)) + + @staticmethod + def nonisolated_cpulist(cpulist): + """Given a cpulist, return a cpulist of non-isolated CPUs""" + if not CpuList.isolated_file_exists(): + return cpulist + isolated_cpulist = sysread(CpuList.cpupath, "isolated") + isolated_cpulist = CpuList.expand_cpulist(isolated_cpulist) + return list(set(cpulist).difference(set(isolated_cpulist))) + # # class to abstract access to NUMA nodes in /sys filesystem # @@ -362,11 +385,35 @@ class SysTopology: cpulist.sort() return cpulist + def isolated_cpus(self): + """ return a list of integers of all isolated cpus """ + cpulist = [] + for n in self.nodes: + cpulist += CpuList.isolated_cpulist(self.getcpus(n)) + cpulist.sort() + return cpulist + + def default_cpus(self): + """ return a list of integers of all default schedulable cpus, i.e. online non-isolated cpus """ + cpulist = [] + for n in self.nodes: + cpulist += CpuList.nonisolated_cpulist(self.getcpus(n)) + cpulist.sort() + return cpulist + def online_cpus_str(self): """ return a list of strings of numbers of all online cpus """ cpulist = [str(cpu) for cpu in self.online_cpus()] return cpulist + def isolated_cpus_str(self): + cpulist = [str(cpu) for cpu in self.isolated_cpus()] + return cpulist + + def default_cpus_str(self): + cpulist = [str(cpu) for cpu in self.default_cpus()] + return cpulist + def invert_cpulist(self, cpulist): """ return a list of online cpus not in cpulist """ return [c for c in self.online_cpus() if c not in cpulist] From patchwork Fri Jun 30 09:19:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 699175 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 D0631EB64D7 for ; Fri, 30 Jun 2023 09:23:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232444AbjF3JXA (ORCPT ); Fri, 30 Jun 2023 05:23:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232563AbjF3JWp (ORCPT ); Fri, 30 Jun 2023 05:22:45 -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 7E01035B0 for ; Fri, 30 Jun 2023 02:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116837; 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=f3tMRVpZxvOfTdQ/kvXFloJOtsCjvgOA3FpDw9MKwGY=; b=Pr/ZtxY/sQ3atDoM0A4fYmFIXPMDIvOzm8mPFGA0Zke0emmbTrLh5HADRt0og8gbQftUOm BLLcJzvZEnUKHgQQ9qcVDMd1ON3lT98EyI/jtaSYW4x+uzE/918ldOqM6cJb03E2KHQhNT pgfVUOJDjkTRhHPX8wRQuRWM1w6aqsQ= 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-433-2hM7KjZ-NBy_qOBrV0vE6g-1; Fri, 30 Jun 2023 05:20:35 -0400 X-MC-Unique: 2hM7KjZ-NBy_qOBrV0vE6g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D5730800CA9 for ; Fri, 30 Jun 2023 09:20:34 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5573340C6CD2; Fri, 30 Jun 2023 09:20:34 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 2/6] rteval: Report isolated CPUs Date: Fri, 30 Jun 2023 11:19:03 +0200 Message-ID: <20230630091951.916865-3-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Add a flag for whether a CPU is isolated in CPUtopology and display the number of isolated CPUs in text report. Signed-off-by: Tomas Glozar --- rteval/rteval_text.xsl | 4 ++++ rteval/sysinfo/cputopology.py | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/rteval/rteval_text.xsl b/rteval/rteval_text.xsl index 7ecfac6..0ef649b 100644 --- a/rteval/rteval_text.xsl +++ b/rteval/rteval_text.xsl @@ -59,6 +59,10 @@ (online: + + , isolated: + + ) diff --git a/rteval/sysinfo/cputopology.py b/rteval/sysinfo/cputopology.py index 2bb6323..f60b059 100644 --- a/rteval/sysinfo/cputopology.py +++ b/rteval/sysinfo/cputopology.py @@ -25,6 +25,7 @@ import os import libxml2 +from rteval.systopology import SysTopology class CPUtopology: "Retrieves an overview over the installed CPU cores and the system topology" @@ -34,6 +35,7 @@ class CPUtopology: self.__cputop_n = None self.__cpu_cores = 0 self.__online_cores = 0 + self.__isolated_cores = 0 self.__cpu_sockets = 0 def __read(self, dirname, fname): @@ -51,6 +53,10 @@ class CPUtopology: self.__cputop_n = libxml2.newNode('CPUtopology') + # Get list of isolated CPUs from SysTopology + systopology = SysTopology() + isolated_cpus = {'cpu' + n for n in systopology.isolated_cpus_str()} + cpusockets = [] for dirname in os.listdir(self.sysdir): # Only parse directories which starts with 'cpu' @@ -82,6 +88,10 @@ class CPUtopology: 'physical_package_id') cpu_n.newProp('physical_package_id', str(phys_pkg_id)) cpusockets.append(phys_pkg_id) + is_isolated = dirname in isolated_cpus + if is_isolated: + self.__isolated_cores += 1 + cpu_n.newProp('isolated', str(int(dirname in isolated_cpus))) break # Count unique CPU sockets @@ -97,6 +107,7 @@ class CPUtopology: # Summarise the core counts self.__cputop_n.newProp('num_cpu_cores', str(self.__cpu_cores)) self.__cputop_n.newProp('num_cpu_cores_online', str(self.__online_cores)) + self.__cputop_n.newProp('num_cpu_cores_isolated', str(self.__isolated_cores)) self.__cputop_n.newProp('num_cpu_sockets', str(self.__cpu_sockets)) return self.__cputop_n From patchwork Fri Jun 30 09:19:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 698269 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 59F93EB64DD for ; Fri, 30 Jun 2023 09:23:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232364AbjF3JW6 (ORCPT ); Fri, 30 Jun 2023 05:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232545AbjF3JWo (ORCPT ); Fri, 30 Jun 2023 05:22:44 -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 32C343A8B for ; Fri, 30 Jun 2023 02:20:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116837; 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=J47Cwegspn/5IUDzU9Pfhu8LTjXAfTcRkBMtXqcteeA=; b=CWWQA4rdQp63xhR25cDz7edGJVxVb/E4p6PeBtADyqpD3DJj2vfjaZxadjGoU3HXlWTzqL tEaO5EW2i6depUDWtwCZ4djv12vChg6NykWtH+y3mwa271iq6DHqjFW8FdnLDhFEEfwZKg TJr7ybrSJOZw7e4KdjtdzVcFmvCNoqo= 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-b8eQJwCRPxe8V3NNqCEzhQ-1; Fri, 30 Jun 2023 05:20:36 -0400 X-MC-Unique: b8eQJwCRPxe8V3NNqCEzhQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DBCAB1044590 for ; Fri, 30 Jun 2023 09:20:35 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 290B340C6CCD; Fri, 30 Jun 2023 09:20:34 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 3/6] rteval: Exclude isolcpus from kcompile by default Date: Fri, 30 Jun 2023 11:19:04 +0200 Message-ID: <20230630091951.916865-4-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Allows correct calculation of make job count that does not include isolated CPUs, on which the loads won't be scheduled. Signed-off-by: Tomas Glozar Signed-off-by: John Kacur --- rteval/modules/loads/kcompile.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py index 35ee5cb..30c5965 100644 --- a/rteval/modules/loads/kcompile.py +++ b/rteval/modules/loads/kcompile.py @@ -37,6 +37,7 @@ from rteval.systopology import CpuList, SysTopology expand_cpulist = CpuList.expand_cpulist compress_cpulist = CpuList.compress_cpulist +nonisolated_cpulist = CpuList.nonisolated_cpulist DEFAULT_KERNEL_PREFIX = "linux-6.1" @@ -55,17 +56,20 @@ class KBuildJob: if not os.path.isdir(self.objdir): os.mkdir(self.objdir) + # Exclude isolated CPUs if cpulist not set + cpus_available = len(nonisolated_cpulist(self.node.cpus.cpulist)) + if os.path.exists('/usr/bin/numactl') and not cpulist: # Use numactl self.binder = f'numactl --cpunodebind {int(self.node)}' - self.jobs = self.calc_jobs_per_cpu() * len(self.node) + self.jobs = self.calc_jobs_per_cpu() * cpus_available elif cpulist: # Use taskset self.jobs = self.calc_jobs_per_cpu() * len(cpulist) self.binder = f'taskset -c {compress_cpulist(cpulist)}' else: # Without numactl calculate number of jobs from the node - self.jobs = self.calc_jobs_per_cpu() * len(self.node) + self.jobs = self.calc_jobs_per_cpu() * cpus_available self.runcmd = f"make O={self.objdir} -C {self.kdir} -j{self.jobs}" self.cleancmd = f"make O={self.objdir} -C {self.kdir} clean allmodconfig" From patchwork Fri Jun 30 09:19:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 698267 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 152C7C001B0 for ; Fri, 30 Jun 2023 09:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232138AbjF3JXJ (ORCPT ); Fri, 30 Jun 2023 05:23:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232769AbjF3JWu (ORCPT ); Fri, 30 Jun 2023 05:22:50 -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 1C1B244BE for ; Fri, 30 Jun 2023 02:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116840; 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=ItCqZdAEvU3sK4cB8FOoCCtgA98EoLT/V3DYj8EOaeo=; b=Lx0WAsS3S8D8lVAWaC1tmmXvOmw7HQV2Ur/657bZVTWUicWH1uhbtvsm74eW7w8pdIJO0n g/GQrMpQUlAVnh4Wqof7sRfp6Nt6WXKMEf0oG0P59xW25qBD2iEvysAzoznPxWsmtkYljw u/HPdboadFnxVhEo4t9peh326wbxmag= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [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-401-wiI6A2XHOB-1oqWMtR3y8A-1; Fri, 30 Jun 2023 05:20:37 -0400 X-MC-Unique: wiI6A2XHOB-1oqWMtR3y8A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07A513C100C7 for ; Fri, 30 Jun 2023 09:20:37 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3438140C6CCD; Fri, 30 Jun 2023 09:20:36 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 4/6] rteval: Exclude isolcpus from stressng by default Date: Fri, 30 Jun 2023 11:19:05 +0200 Message-ID: <20230630091951.916865-5-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Note: this has little effect now, because the cpus variables is only used for removing empty nodes unless a cpulist is specified by the user. However, this can change in the future. Signed-off-by: Tomas Glozar --- rteval/modules/loads/stressng.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rteval/modules/loads/stressng.py b/rteval/modules/loads/stressng.py index 85cb473..800fdec 100644 --- a/rteval/modules/loads/stressng.py +++ b/rteval/modules/loads/stressng.py @@ -9,6 +9,7 @@ from rteval.Log import Log from rteval.systopology import CpuList, SysTopology expand_cpulist = CpuList.expand_cpulist +nonisolated_cpulist = CpuList.nonisolated_cpulist class Stressng(CommandLineLoad): " This class creates a load module that runs stress-ng " @@ -69,6 +70,10 @@ class Stressng(CommandLineLoad): # if a cpulist was specified, only allow cpus in that list on the node if self.cpulist: cpus[n] = [c for c in cpus[n] if c in expand_cpulist(self.cpulist)] + # if a cpulist was not specified, exclude isolated cpus + else: + cpus[n] = CpuList.nonisolated_cpulist(cpus[n]) + # remove nodes with no cpus available for running for node, cpu in cpus.items(): From patchwork Fri Jun 30 09:19:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 699174 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 E8288EB64DA for ; Fri, 30 Jun 2023 09:23:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232296AbjF3JXI (ORCPT ); Fri, 30 Jun 2023 05:23:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232768AbjF3JWu (ORCPT ); Fri, 30 Jun 2023 05:22:50 -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 81A523C3D for ; Fri, 30 Jun 2023 02:21:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116839; 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=1YHtiXHF3x88Mbfh5nqG2rDlSlojNSDSykq5kAPrIG8=; b=QaMEcgwSs5E6/dxSTzrJJP+VLHaqEL7p0C6wOO94OzlWpD8zGFBw2cmAJNZast8eTHhH/m W3XYKhRh0e7ZxMdEH005w3OUb6LU++WHtKaIakblH6EkOYwyhDsUnvne4RZjCY9PcTlr1R /LJqdf5+1rIVPjwFRkET2JOFRvE+WN0= 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-574-ZK6PFqO1OqKRXgKSc5xfOw-1; Fri, 30 Jun 2023 05:20:38 -0400 X-MC-Unique: ZK6PFqO1OqKRXgKSc5xfOw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BCD1A185A7A9 for ; Fri, 30 Jun 2023 09:20:37 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3E90E40C6CCD; Fri, 30 Jun 2023 09:20:37 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 5/6] rteval: Fix CPU count calculation for hackbench Date: Fri, 30 Jun 2023 11:19:06 +0200 Message-ID: <20230630091951.916865-6-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Use count from cpulist when specified and all CPUs on node excluding offline ones and isolated ones if not specified. Signed-off-by: Tomas Glozar Signed-off-by: John Kacur --- rteval/modules/loads/hackbench.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rteval/modules/loads/hackbench.py b/rteval/modules/loads/hackbench.py index 14e60d1..f5a547e 100644 --- a/rteval/modules/loads/hackbench.py +++ b/rteval/modules/loads/hackbench.py @@ -38,6 +38,7 @@ from rteval.Log import Log from rteval.systopology import CpuList, SysTopology expand_cpulist = CpuList.expand_cpulist +isolated_cpulist = CpuList.isolated_cpulist class Hackbench(CommandLineLoad): def __init__(self, config, logger): @@ -77,9 +78,12 @@ class Hackbench(CommandLineLoad): # if a cpulist was specified, only allow cpus in that list on the node if self.cpulist: self.cpus[n] = [c for c in self.cpus[n] if c in expand_cpulist(self.cpulist)] + # if a cpulist was not specified, exclude isolated cpus + else: + self.cpus[n] = CpuList.nonisolated_cpulist(self.cpus[n]) # track largest number of cpus used on a node - node_biggest = len(sysTop.getcpus(int(n))) + node_biggest = len(self.cpus[n]) if node_biggest > biggest: biggest = node_biggest From patchwork Fri Jun 30 09:19:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomas Glozar X-Patchwork-Id: 698268 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 12357EB64D7 for ; Fri, 30 Jun 2023 09:23:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232016AbjF3JXG (ORCPT ); Fri, 30 Jun 2023 05:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232660AbjF3JWu (ORCPT ); Fri, 30 Jun 2023 05:22:50 -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 75B403596 for ; Fri, 30 Jun 2023 02:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1688116841; 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=KC6zfdFi9pUi2JSY8bcPZesV3mdmP8ItoD16DWromLI=; b=FhUT2DEF7ZG1DG9rz33ZxqI4Ary0nqfnlvKsWSWdXZLTOMEW8Hqh7mR2b1Ak5NFRq2E1kA V0EtdHSlTRY9UlH8pNo30Wl/aB+tRFMoa71QxyWn74zQqlOZm/61AQMoMqdJQz7CZ/hSy7 br9lQOcSWSnMZfk7nSnf/0g/5N4tN1g= 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-582-f_GOVp1wOYSPY41XApsdRg-1; Fri, 30 Jun 2023 05:20:39 -0400 X-MC-Unique: f_GOVp1wOYSPY41XApsdRg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5D37381D9EC for ; Fri, 30 Jun 2023 09:20:39 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.45.224.109]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016F840C6F5A; Fri, 30 Jun 2023 09:20:37 +0000 (UTC) From: Tomas Glozar To: linux-rt-users@vger.kernel.org Cc: Tomas Glozar Subject: [PATCH 6/6] rteval: Exclude isolcpus from loads report Date: Fri, 30 Jun 2023 11:19:07 +0200 Message-ID: <20230630091951.916865-7-tglozar@redhat.com> In-Reply-To: <20230630091951.916865-1-tglozar@redhat.com> References: <20230630091951.916865-1-tglozar@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-rt-users@vger.kernel.org Use SysTopology.default_cpus() to report cores on which measurements and loads and run by default to reflect the default behavior (no isolcpus). Signed-off-by: Tomas Glozar --- rteval/modules/loads/__init__.py | 2 +- rteval/modules/measurement/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rteval/modules/loads/__init__.py b/rteval/modules/loads/__init__.py index 761cc8c..74aad58 100644 --- a/rteval/modules/loads/__init__.py +++ b/rteval/modules/loads/__init__.py @@ -138,7 +138,7 @@ class LoadModules(RtEvalModules): # Convert str to list and remove offline cpus cpulist = CpuList(cpulist).cpulist else: - cpulist = SysTop().online_cpus() + cpulist = SysTop().default_cpus() rep_n.newProp("loadcpus", collapse_cpulist(cpulist)) return rep_n diff --git a/rteval/modules/measurement/__init__.py b/rteval/modules/measurement/__init__.py index d99873e..0e395be 100644 --- a/rteval/modules/measurement/__init__.py +++ b/rteval/modules/measurement/__init__.py @@ -194,7 +194,7 @@ measurement profiles, based on their characteristics""" # Convert str to list and remove offline cpus cpulist = CpuList(cpulist).cpulist else: - cpulist = SysTop().online_cpus() + cpulist = SysTop().default_cpus() rep_n.newProp("measurecpus", collapse_cpulist(cpulist)) for mp in self.__measureprofiles: