linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Punit Agrawal <punitagrawal@gmail.com>
To: jkacur@redhat.com
Cc: punit1.agrawal@toshiba.co.jp,
	Punit Agrawal <punitagrawal@gmail.com>,
	linux-rt-users@vger.kernel.org
Subject: [PATCH 5/5] rteval: kcompile.py: Gracefully handle missing affinity information
Date: Wed,  1 Sep 2021 17:08:16 +0900	[thread overview]
Message-ID: <20210901080816.721731-6-punitagrawal@gmail.com> (raw)
In-Reply-To: <20210901080816.721731-1-punitagrawal@gmail.com>

From: Punit Agrawal <punit1.agrawal@toshiba.co.jp>

kcompile either sets the affinity of the workload threads to a user
specified list of cpus (using taskset) or binds the threads to the
local numa node (using numactl). In the absence of both the following
hard to parse error is thrown -

    Exception in thread kcompile:
    Traceback (most recent call last):
    ...
      File "...rteval/rteval/modules/loads/kcompile.py", line 55, in __init__
	self.binder = 'taskset -c %s' % compress_cpulist(cpulist)
      File "...rteval/rteval/misc.py", line 62, in compress_cpulist
	if isinstance(cpulist[0], int):
    TypeError: 'NoneType' object is not subscriptable

Instead, add a warning to report the missing affinity information /
tools and continue executing the workload with no affinity - relying
on the affinity settings being set by the kernel.

Signed-off-by: Punit Agrawal <punit1.agrawal@toshiba.co.jp>
---
 rteval/modules/loads/kcompile.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/rteval/modules/loads/kcompile.py b/rteval/modules/loads/kcompile.py
index d1955c7aee3d..5c83b78525e5 100644
--- a/rteval/modules/loads/kcompile.py
+++ b/rteval/modules/loads/kcompile.py
@@ -51,8 +51,12 @@ class KBuildJob:
             os.mkdir(self.objdir)
         if os.path.exists('/usr/bin/numactl') and not cpulist:
             self.binder = 'numactl --cpunodebind %d' % int(self.node)
-        else:
+        elif cpulist is not None:
             self.binder = 'taskset -c %s' % compress_cpulist(cpulist)
+        else:
+            self.log(Log.WARN, 'Unable to set job affinity - please install "numactl" or pass "cpulist"')
+            self.log(Log.WARN, 'Running with default OS decided affinity')
+            self.binder = ''
         if cpulist:
             self.jobs = self.calc_jobs_per_cpu() * len(cpulist)
         else:
-- 
2.32.0


  parent reply	other threads:[~2021-09-01  8:08 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  8:08 [PATCH 0/5] Enable rteval on Arm based systems Punit Agrawal
2021-09-01  8:08 ` [PATCH 1/5] rteval: systopology.py: Add support for systems that don't have Numa Punit Agrawal
2021-09-09 12:34   ` John Kacur
2021-09-13  2:28     ` Punit Agrawal
2021-09-01  8:08 ` [PATCH 2/5] rteval: cyclictest.py: Update logic to get core description Punit Agrawal
2021-09-09 12:41   ` John Kacur
2021-09-01  8:08 ` [PATCH 3/5] rteval: kernel.py: Add support for kthreads running with deadline policy Punit Agrawal
2021-09-09 12:47   ` John Kacur
2021-09-15  8:45     ` Punit Agrawal
2021-09-15 12:17       ` John Kacur
2021-09-16 11:34         ` Punit Agrawal
2021-09-01  8:08 ` [PATCH 4/5] rteval: hackbench.py: Enable running on a system with low memory Punit Agrawal
2021-09-09 12:46   ` John Kacur
2021-09-13  7:18     ` Punit Agrawal
2021-09-13 12:52       ` John Kacur
2021-09-14 18:32   ` John Kacur
2021-09-15  1:54     ` Punit Agrawal
2021-09-01  8:08 ` Punit Agrawal [this message]
2021-09-09 19:23   ` [PATCH 5/5] rteval: kcompile.py: Gracefully handle missing affinity information John Kacur

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210901080816.721731-6-punitagrawal@gmail.com \
    --to=punitagrawal@gmail.com \
    --cc=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=punit1.agrawal@toshiba.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).