Hi,
This is an updated version of the series to improve support of rteval
on arm, arm64 and i386. Previous version can be found at [0].
Changes -
* The biggest change in this version is to improve the logic to
construct CPU description on arm and arm64 architectures. The
changes also incorporate feedback from John on the previous version.
* Include the patch to systopology.py required on systems that do not
have numa domains. The patch was previously posted separately at [1].
Feedback welcome.
Thanks,
Punit
[0] https://lore.kernel.org/linux-rt-users/20210126021241.112944-1-punit1.agrawal@toshiba.co.jp/
[1] https://lore.kernel.org/linux-rt-users/20210127083412.118047-1-punit1.agrawal@toshiba.co.jp/
Punit Agrawal (3):
rteval: cyclictest.py: Update logic to get core description
rteval: cyclictest.py: Make build targets architecture independent
rteval: systopology.py: Add support for systems that don't have Numa
rteval/misc.py | 24 ++++++++++++++-
rteval/modules/loads/kcompile.py | 2 +-
rteval/modules/measurement/cyclictest.py | 8 +++--
rteval/systopology.py | 38 ++++++++++++++++++++----
4 files changed, 61 insertions(+), 11 deletions(-)
--
2.30.0
Certain architectures such as arm and arm64 don't have a "model name"
in /proc/cpuinfo but provide other identifying information such as
implementer, architecture, variant, part, revision, etc..
Add a function 'get_cpumodel()' that takes the per-core dictionary
constructed from /proc/cpuinfo and uses the available data to
construct the CPU description. Update the users of "model name" to use
the newly added function.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/misc.py | 24 +++++++++++++++++++++++-
rteval/modules/measurement/cyclictest.py | 8 +++++---
2 files changed, 28 insertions(+), 4 deletions(-)
@@ -79,6 +79,28 @@ def cpuinfo():info[core][key]=valreturninfo+# Pass the per-core dictionary that is part of the dictionary returned+# by cpuinfo()+defget_cpumodel(core_info):+desc=info[core].get('model name','')+ifnotdesc:+# On Arm (both 32 and 64 bit), 'CPU Implementer' is always+# present. Return 'unknown' otherwise+if'CPU Implementer'notininfo[core]:+desc='unknown'+break++implementor=core_info.get('CPU implementer','')+architecture=core_info.get('CPU architecture','')+variant=core_info.get('CPU variant','')+part=core_info.get('CPU part','')+revision=core_info.get('CPU revision','')++desc='Implementor: %s Architecture: %s Variant: %s Part: %s Revision: %s' \+%(implementor,architecture,variant,part,revision)++returndesc+if__name__=="__main__":info=cpuinfo()
@@ -34,7 +34,7 @@ import mathimportlibxml2fromrteval.LogimportLogfromrteval.modulesimportrtevalModulePrototype-fromrteval.miscimportexpand_cpulist,online_cpus,cpuinfo+fromrteval.miscimportexpand_cpulist,online_cpus,cpuinfo,get_cpumodelclassRunData:'''class to keep instance data from a cyclictest run'''
@@ -217,13 +217,15 @@ class Cyclictest(rtevalModulePrototype):forcoreinself.__cpus:self.__cyclicdata[core]=RunData(core,'core',self.__priority,logfnc=self._log)-self.__cyclicdata[core].description=info[core]['model name']+self.__cyclicdata[core].description=get_cpumodel(info[core])+ifself.__cyclicdata[core].description=='unknown':+self._log(Log.INFO,"Unknown model for core %d"%core)# Create a RunData object for the overall systemself.__cyclicdata['system']=RunData('system','system',self.__priority,logfnc=self._log)-self.__cyclicdata['system'].description=("(%d cores) "%self.__numcores)+info['0']['model name']+self.__cyclicdata['system'].description=("(%d cores) "%self.__numcores)+get_cpumodel(info['0'])ifself.__sparse:self._log(Log.DEBUG,"system using %d cpu cores"%self.__numcores)
Certain systems such as Arm v7 do not have support for Numa nodes,
i.e., "/sys/devices/system/node*" does not exist. Instead of erroring
out in this situation, it would be better if rteval could use
alternate sources to get the system topology and memory information.
Introduce the notion of a fake Numa node (as a class) which is used
when no numa nodes are found on the system. Other than the
constructor, it provides the same interface as the existing NumaNode
class so existing users should work without any changes.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/systopology.py | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
@@ -191,6 +191,31 @@ class NumaNode:""" return list of cpus for this node """returnself.cpus.getcpulist()+classFakeNumaNode(NumaNode):+"""class representing a fake NUMA node. The fake NUMA node is used on+systemswhichdon't have NUMA enabled (no+/sys/devices/system/node)suchasArmv7++"""++cpupath='/sys/devices/system/cpu'+mempath='/proc/meminfo'++def__init__(self):+self.nodeid=0+self.cpus=CpuList(sysread(FakeNumaNode.cpupath,"possible"))+self.getmeminfo()++defgetmeminfo(self):+self.meminfo={}+forlinopen(FakeNumaNode.mempath,"r"):+elements=l.split()+key=elements[0][0:-1]+val=int(elements[1])+iflen(elements)==3andelements[2]=="kB":+val*=1024+self.meminfo[key]=val+## Class to abstract the system topology of numa nodes and cpus#
@@ -238,12 +263,13 @@ class SysTopology:defgetinfo(self):nodes=glob.glob(os.path.join(SysTopology.nodepath,'node[0-9]*'))-ifnotnodes:-raiseRuntimeError("No valid nodes found in %s!"%SysTopology.nodepath)-nodes.sort()-forninnodes:-node=int(os.path.basename(n)[4:])-self.nodes[node]=NumaNode(n)+ifnodes:+nodes.sort()+forninnodes:+node=int(os.path.basename(n)[4:])+self.nodes[node]=NumaNode(n)+else:+self.nodes[0]=FakeNumaNode()defgetnodes(self):returnlist(self.nodes.keys())
Not all kernel archiectures provide the "bzImage" target, e.g., arm64
provides "Image" which generates an uncompressed kernel binary.
Instead of going down the path of customizing build targets
per-architecture, let's drop them altogether. The default kernel
target should build the kernel and modules on all architectures
anyways.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/modules/loads/kcompile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: John Kacur <jkacur@redhat.com> Date: 2021-03-03 06:32:33
On Wed, 24 Feb 2021, Punit Agrawal wrote:
quoted hunk
Not all kernel archiectures provide the "bzImage" target, e.g., arm64
provides "Image" which generates an uncompressed kernel binary.
Instead of going down the path of customizing build targets
per-architecture, let's drop them altogether. The default kernel
target should build the kernel and modules on all architectures
anyways.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/modules/loads/kcompile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Not all kernel archiectures provide the "bzImage" target, e.g., arm64
provides "Image" which generates an uncompressed kernel binary.
Instead of going down the path of customizing build targets
per-architecture, let's drop them altogether. The default kernel
target should build the kernel and modules on all architectures
anyways.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/modules/loads/kcompile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -58,7 +58,7 @@ class KBuildJob:else:self.jobs=self.calc_jobs_per_cpu()*len(self.node)self.log(Log.DEBUG,"node %d: jobs == %d"%(int(node),self.jobs))-self.runcmd="%s make O=%s -C %s -j%d bzImage modules" \+self.runcmd="%s make O=%s -C %s -j%d" \%(self.binder,self.objdir,self.kdir,self.jobs)self.cleancmd="%s make O=%s -C %s clean allmodconfig" \%(self.binder,self.objdir,self.kdir)
--
2.30.0
Signed-off-by: John Kacur <jkacur@redhat.com>
Hi John,
Thanks for picking up this patch.
Just wanted to make sure about the status of the other 2 patches in the
set - 1/3 and 3/3, I am assuming they're on your TODO but haven't had a
chance to confirm yet.
Let me know if that's not the case for some reason.
Thanks,
Punit
From: John Kacur <jkacur@redhat.com> Date: 2021-03-04 15:50:28
On Thu, 4 Mar 2021, Punit Agrawal wrote:
John Kacur [off-list ref] writes:
quoted
On Wed, 24 Feb 2021, Punit Agrawal wrote:
quoted
Not all kernel archiectures provide the "bzImage" target, e.g., arm64
provides "Image" which generates an uncompressed kernel binary.
Instead of going down the path of customizing build targets
per-architecture, let's drop them altogether. The default kernel
target should build the kernel and modules on all architectures
anyways.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/modules/loads/kcompile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -58,7 +58,7 @@ class KBuildJob:else:self.jobs=self.calc_jobs_per_cpu()*len(self.node)self.log(Log.DEBUG,"node %d: jobs == %d"%(int(node),self.jobs))-self.runcmd="%s make O=%s -C %s -j%d bzImage modules" \+self.runcmd="%s make O=%s -C %s -j%d" \%(self.binder,self.objdir,self.kdir,self.jobs)self.cleancmd="%s make O=%s -C %s clean allmodconfig" \%(self.binder,self.objdir,self.kdir)
--
2.30.0
Signed-off-by: John Kacur <jkacur@redhat.com>
Hi John,
Thanks for picking up this patch.
Just wanted to make sure about the status of the other 2 patches in the
set - 1/3 and 3/3, I am assuming they're on your TODO but haven't had a
chance to confirm yet.
Let me know if that's not the case for some reason.
Thanks,
Punit
Yes, they are on my TODO list, I will get to them.
I will probably take the patch that deal with the model name, after I
convince myself that it won't break anything else.
I don't really like the idea of a fake NUMA node to deal with rteval
on non-NUMA machines, but I am open to ideas to get rteval working
on such machines. On my list to give you feedback.
Thanks
John
Not all kernel archiectures provide the "bzImage" target, e.g., arm64
provides "Image" which generates an uncompressed kernel binary.
Instead of going down the path of customizing build targets
per-architecture, let's drop them altogether. The default kernel
target should build the kernel and modules on all architectures
anyways.
Signed-off-by: Punit Agrawal <redacted>
---
rteval/modules/loads/kcompile.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -58,7 +58,7 @@ class KBuildJob:else:self.jobs=self.calc_jobs_per_cpu()*len(self.node)self.log(Log.DEBUG,"node %d: jobs == %d"%(int(node),self.jobs))-self.runcmd="%s make O=%s -C %s -j%d bzImage modules" \+self.runcmd="%s make O=%s -C %s -j%d" \%(self.binder,self.objdir,self.kdir,self.jobs)self.cleancmd="%s make O=%s -C %s clean allmodconfig" \%(self.binder,self.objdir,self.kdir)
--
2.30.0
Signed-off-by: John Kacur <jkacur@redhat.com>
Hi John,
Thanks for picking up this patch.
Just wanted to make sure about the status of the other 2 patches in the
set - 1/3 and 3/3, I am assuming they're on your TODO but haven't had a
chance to confirm yet.
Let me know if that's not the case for some reason.
Thanks,
Punit
Yes, they are on my TODO list, I will get to them.
I will probably take the patch that deal with the model name, after I
convince myself that it won't break anything else.
I don't really like the idea of a fake NUMA node to deal with rteval
on non-NUMA machines, but I am open to ideas to get rteval working
on such machines. On my list to give you feedback.
I am not too attached to the fake NUMA node either. The resulting patch
seemed like the least invasive way to make rteval more inclusive on
non-NUMA architectures.
I am open to alternate ways to enable this functionality. I'll look out
for your feedback once you've taken a closer look.
[...]