intel / intel-cmt-cat

User space software for Intel(R) Resource Director Technology
http://www.intel.com/content/www/us/en/architecture-and-technology/resource-director-technology.html
Other
693 stars 183 forks source link

How to enable mbaCtrl-on on kernel 3.10? #183

Closed oleotiger closed 3 years ago

oleotiger commented 3 years ago

I'm using kernel 3.10.0-957.el7.x86_64 on Centos7.6. When I use MBA to control memory bandwidth through MSR interface, I found that it is not so accurate. From mba:100 to mba:10, the bandwidth of a core reduces from 17.7GB/s to 4GB/s. It's supposed to reduce to 1~2GB/s.

So I wanna use rdt to control mem_bw in MB/s.

When I mount resctrl with mount -t resctrl resctrl -o mba_MBps /sys/fs/resctrl, I got:

mount: wrong fs type, bad option, bad superblock on resctrl,
       missing codepage or helper program, or other error

       In some cases useful info is found in syslog - try
       dmesg | tail or so.

From dmesg I can see that intel_rdt_rdtgroup: Invalid mount option "mba_MBps".

But I can mount without any options, mount -t resctrl resctrl /sys/fs/resctrl. But the file list is wried:

[root@localhost  resctrl]# ll
total 0
-rw-r--r-- 1 root root 0 Apr 17 11:03 cpus
-rw-r--r-- 1 root root 0 Apr 17 11:03 cpus_list
dr-xr-xr-x 4 root root 0 Apr 17 11:03 info
dr-xr-xr-x 4 root root 0 Apr 17 11:03 mon_data
dr-xr-xr-x 2 root root 0 Apr 17 11:03 mon_groups
-rw-r--r-- 1 root root 0 Apr 17 11:03 schemata
-rw-r--r-- 1 root root 0 Apr 17 11:03 tasks
[root@6248r-node121 resctrl]# pwd
/sys/fs/resctrl

When I wanna turn on mbaCtrl-on:

[root@localhost resctrl]#  pqos -I -R mbaCtrl-on
NOTE:  Mixed use of MSR and kernel interfaces to manage
       CAT or CMT & MBM may lead to unexpected behavior.
ERROR: Could not open schemata file /sys/fs/resctrl/COS1/schemata for COS 1
ERROR: Could not open schemata file /sys/fs/resctrl/COS2/schemata for COS 2
ERROR: Could not open schemata file /sys/fs/resctrl/COS3/schemata for COS 3
ERROR: Could not open schemata file /sys/fs/resctrl/COS4/schemata for COS 4
ERROR: Could not open schemata file /sys/fs/resctrl/COS5/schemata for COS 5
ERROR: Could not open schemata file /sys/fs/resctrl/COS6/schemata for COS 6
ERROR: Could not open schemata file /sys/fs/resctrl/COS7/schemata for COS 7
ERROR: Could not open cpus file /sys/fs/resctrl/COS7/cpus for COS 7
WARN: Unable to check if MBA CTRL is enabled - No free group
ERROR: Could not umount resctrl filesystem!
Allocation reset failed!

If I tried it again:

pqos -I -R mbaCtrl-on
NOTE:  Mixed use of MSR and kernel interfaces to manage
       CAT or CMT & MBM may lead to unexpected behavior.
ERROR: Could not umount resctrl filesystem!
Allocation reset failed!

Files in /sys/fs/resctrl changed:

drwxr-xr-x 4 root root 0 Apr 17 11:06 COS1
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS2
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS3
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS4
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS5
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS6
drwxr-xr-x 4 root root 0 Apr 17 11:06 COS7
-rw-r--r-- 1 root root 0 Apr 17 11:06 cpus
-rw-r--r-- 1 root root 0 Apr 17 11:03 cpus_list
dr-xr-xr-x 4 root root 0 Apr 17 11:03 info
dr-xr-xr-x 4 root root 0 Apr 17 11:03 mon_data
dr-xr-xr-x 2 root root 0 Apr 17 11:03 mon_groups
-rw-r--r-- 1 root root 0 Apr 17 11:03 schemata
-rw-r--r-- 1 root root 0 Apr 17 11:03 tasks

There are two way that I wanna try:

  1. Try to fix it on kernel 3.10 and turn on mbaCtrl-on. But I haven't worked it out.
  2. From wiki resctrl, there is 'If you wish to use this before the release of kernel 4.10 you can download from here kernel.googlesource x86/cache'. I found the link points to a commit which add 2 files to the kernel. So I think the file may help to update the function of rdt/resctrl in kernel whose version is lower than 4.10. But I don't know how to use the commit. Can you provide more details?
kmabbasi commented 3 years ago

Hi,

Thanks for looking into details.

Our team is not involved in kernel development. So unfortunately, cannot provide more details on how to patch your kernel version. Therefore, we suggest to use new kernel version if possible.

Thanks, Khawar

oleotiger commented 3 years ago

OK, thanks for your reply.