Message ID | cover.1708072203.git.maciej.wieczor-retman@intel.com (mailing list archive) |
---|---|
Headers | show |
Series | selftests/resctrl: Add non-contiguous CBMs in Intel CAT selftest | expand |
Hi Shuah, Could you please consider this series for inclusion? Thank you very much. Reinette On 2/16/2024 12:34 AM, Maciej Wieczor-Retman wrote: > Non-contiguous CBM support for Intel CAT has been merged into the kernel > with Commit 0e3cd31f6e90 ("x86/resctrl: Enable non-contiguous CBMs in > Intel CAT") but there is no selftest that would validate if this feature > works correctly. The selftest needs to verify if writing non-contiguous > CBMs to the schemata file behaves as expected in comparison to the > information about non-contiguous CBMs support. > > The patch series is based on a rework of resctrl selftests that's > currently in review [1]. The patch also implements a similar > functionality presented in the bash script included in the cover letter > of the original non-contiguous CBMs in Intel CAT series [3]. > > Changelog v6: > - Add Reinette's reviewed-by tag to patch 2/5. > - Fix ret type in noncont test. > - Add a check for bit_center value in noncont test. > - Add resource pointer check in resctrl_mon_feature_exists. > - Fix patch 4 leaking into patch 3 by mistake. > > Changelog v5: > - Add a few reviewed-by tags. > - Make some minor text changes in patch messages and comments. > - Redo resctrl_mon_feature_exists() to be more generic and fix some of > my errors in refactoring feature checking. > > Changelog v4: > - Changes to error failure return values in non-contiguous test. > - Some minor text refactoring without functional changes. > > Changelog v3: > - Rebase onto v4 of Ilpo's series [1]. > - Split old patch 3/4 into two parts. One doing refactoring and one > adding a new function. > - Some changes to all the patches after Reinette's review. > > Changelog v2: > - Rebase onto v4 of Ilpo's series [2]. > - Add two patches that prepare helpers for the new test. > - Move Ilpo's patch that adds test grouping to this series. > - Apply Ilpo's suggestion to the patch that adds a new test. > > [1] https://lore.kernel.org/all/20231215150515.36983-1-ilpo.jarvinen@linux.intel.com/ > [2] https://lore.kernel.org/all/20231211121826.14392-1-ilpo.jarvinen@linux.intel.com/ > [3] https://lore.kernel.org/all/cover.1696934091.git.maciej.wieczor-retman@intel.com/ > > Older versions of this series: > [v1] https://lore.kernel.org/all/20231109112847.432687-1-maciej.wieczor-retman@intel.com/ > [v2] https://lore.kernel.org/all/cover.1702392177.git.maciej.wieczor-retman@intel.com/ > [v3] https://lore.kernel.org/all/cover.1706180726.git.maciej.wieczor-retman@intel.com/ > [v4] https://lore.kernel.org/all/cover.1707130307.git.maciej.wieczor-retman@intel.com/ > [v5] https://lore.kernel.org/all/cover.1707487039.git.maciej.wieczor-retman@intel.com/ > > Ilpo Järvinen (1): > selftests/resctrl: Add test groups and name L3 CAT test L3_CAT > > Maciej Wieczor-Retman (4): > selftests/resctrl: Add a helper for the non-contiguous test > selftests/resctrl: Split validate_resctrl_feature_request() > selftests/resctrl: Add resource_info_file_exists() > selftests/resctrl: Add non-contiguous CBMs CAT test > > tools/testing/selftests/resctrl/cat_test.c | 92 +++++++++++++++++- > tools/testing/selftests/resctrl/cmt_test.c | 2 +- > tools/testing/selftests/resctrl/mba_test.c | 2 +- > tools/testing/selftests/resctrl/mbm_test.c | 6 +- > tools/testing/selftests/resctrl/resctrl.h | 10 +- > .../testing/selftests/resctrl/resctrl_tests.c | 18 +++- > tools/testing/selftests/resctrl/resctrlfs.c | 96 ++++++++++++++++--- > 7 files changed, 203 insertions(+), 23 deletions(-) >
On 2/22/24 10:05, Reinette Chatre wrote: > Hi Shuah, > > Could you please consider this series for inclusion? > > Thank you very much. > > Reinette > > On 2/16/2024 12:34 AM, Maciej Wieczor-Retman wrote: >> Non-contiguous CBM support for Intel CAT has been merged into the kernel >> with Commit 0e3cd31f6e90 ("x86/resctrl: Enable non-contiguous CBMs in >> Intel CAT") but there is no selftest that would validate if this feature >> works correctly. The selftest needs to verify if writing non-contiguous >> CBMs to the schemata file behaves as expected in comparison to the >> information about non-contiguous CBMs support. >> >> The patch series is based on a rework of resctrl selftests that's >> currently in review [1]. The patch also implements a similar >> functionality presented in the bash script included in the cover letter >> of the original non-contiguous CBMs in Intel CAT series [3]. >> >> Changelog v6: >> - Add Reinette's reviewed-by tag to patch 2/5. >> - Fix ret type in noncont test. >> - Add a check for bit_center value in noncont test. >> - Add resource pointer check in resctrl_mon_feature_exists. >> - Fix patch 4 leaking into patch 3 by mistake. >> Applied to linux-ksefltest next for Linux 6.9-rc1 thanks, -- Shuah
On 2/23/2024 2:29 PM, Shuah Khan wrote: > > Applied to linux-ksefltest next for Linux 6.9-rc1 > Thank you very much Shuah. Reinette
On 2/23/24 15:33, Reinette Chatre wrote: > > > On 2/23/2024 2:29 PM, Shuah Khan wrote: > >> >> Applied to linux-ksefltest next for Linux 6.9-rc1 >> > > Thank you very much Shuah. > > Reinette > Hi Reinette, Okay ran a quick test. Why does this test leave "/sys/fs/resctrl" mounted when it exits. Can we fix this to unmount before the test exits? Please send a patch on top of linux-kselftest next. thanks, -- Shuah
Hi Shuah, On 2/23/2024 2:37 PM, Shuah Khan wrote: > Okay ran a quick test. Why does this test leave "/sys/fs/resctrl" > mounted when it exits. Can we fix this to unmount before the test > exits? This is unexpected. The test should unmount resctrl when done and I am not able to reproduce what you are seeing. I tried with resctrl mounted as well as unmounted before the test run. Could you please send the output of your test run to hopefully get some hints about what is going on? Please do note that resctrl does create the mountpoint upon initialization so you should always, for example, see /sys/fs/resctrl, but it should be unmounted and empty after a test run. Below is what I am seeing when I try latest from kselftest next and mount resctrl before the test. I see same state after test if I do not mount resctrl before the test run. ../dev/linux$ mount | grep resctrl #not mounted ../dev/linux$ ls /sys/fs/resctrl/ #empty ../dev/linux$ sudo mount -t resctrl resctrl /sys/fs/resctrl/ ../dev/linux$ ls /sys/fs/resctrl/ #has contents after mount cpus cpus_list info mode mon_data mon_groups schemata size tasks ../dev/linux$ mount | grep resctrl #shows as mounted resctrl on /sys/fs/resctrl type resctrl (rw,relatime) ../dev/linux$ git show -s --pretty='format:%h (\"%s\")' ae638551ab64 (\"selftests/resctrl: Add non-contiguous CBMs CAT test\") ../dev/linux$ make -C tools/testing/selftests/resctrl/ make: Entering directory '/home/reinette/dev/linux/tools/testing/selftests/resctrl' gcc -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -isystem /home/reinette/dev/linux/tools/testing/selftests/../../../usr/include resctrl_tests.c cache.c cat_test.c cmt_test.c fill_buf.c mba_test.c mbm_test.c resctrlfs.c resctrl.h resctrl_val.c -o /home/reinette/dev/linux/tools/testing/selftests/resctrl/resctrl_tests make: Leaving directory '/home/reinette/dev/linux/tools/testing/selftests/resctrl' ../dev/linux$ sudo ./tools/testing/selftests/resctrl/resctrl_tests [SNIP] ../dev/linux$ mount | grep resctrl #umounted after test run ../dev/linux$ ls /sys/fs/resctrl/ #empty ../dev/linux$ > > Please send a patch on top of linux-kselftest next. Will do, as soon as I can figure out what is going on. Reinette
Hi Shuah, On 2024-02-23 at 15:37:11 -0700, Shuah Khan wrote: > >Hi Reinette, > >Okay ran a quick test. Why does this test leave "/sys/fs/resctrl" >mounted when it exits. Can we fix this to unmount before the test >exits? I also wasn't able to reproduce this unmounting issue: - with unmounted resctrl before test: [/root]# ls /sys/fs/resctrl/ [/root]# [/root]# ./resctrl_tests -t L3_NONCONT_CAT TAP version 13 # Pass: Check kernel supports resctrl filesystem # Pass: Check resctrl mountpoint "/sys/fs/resctrl" exists # resctrl filesystem not mounted # dmesg: [ 12.502941] resctrl: L3 allocation detected # dmesg: [ 12.507134] resctrl: MB allocation detected # dmesg: [ 12.511315] resctrl: L3 monitoring detected 1..1 # Starting L3_NONCONT_CAT test ... # Mounting resctrl to "/sys/fs/resctrl" # Write schema "L3:1=3f" to resctrl FS # Write schema "L3:1=f0f" to resctrl FS # write() failed : Invalid argument # Non-contiguous CBMs not supported and write of non-contiguous CBM failed as expected ok 1 L3_NONCONT_CAT: test # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 [/root]# ls /sys/fs/resctrl/ [/root]# And with mounted before test: [/root]# ls /sys/fs/resctrl/ [/root]# [/root]# mount -t resctrl resctrl /sys/fs/resctrl [/root]# ls /sys/fs/resctrl/ cpus cpus_list info mode mon_data mon_groups schemata size tasks [/root]# ./resctrl_tests -t L3_NONCONT_CAT TAP version 13 # Pass: Check kernel supports resctrl filesystem # Pass: Check resctrl mountpoint "/sys/fs/resctrl" exists # resctrl filesystem is mounted # dmesg: [ 12.502941] resctrl: L3 allocation detected # dmesg: [ 12.507134] resctrl: MB allocation detected # dmesg: [ 12.511315] resctrl: L3 monitoring detected 1..1 # Starting L3_NONCONT_CAT test ... # Mounting resctrl to "/sys/fs/resctrl" # Write schema "L3:1=3f" to resctrl FS # Write schema "L3:1=f0f" to resctrl FS # write() failed : Invalid argument # Non-contiguous CBMs not supported and write of non-contiguous CBM failed as expected ok 1 L3_NONCONT_CAT: test # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 [/root]# ls /sys/fs/resctrl/ [/root]# Looking at the code there is an unmounting function called after each test (at the end of run_single_test() inside of test_cleanup()). The non-contiguous test also doesn't write any data into a temp file so no additional cleanup is necessary.
On 2/26/24 02:28, Maciej Wieczor-Retman wrote: > Hi Shuah, > > On 2024-02-23 at 15:37:11 -0700, Shuah Khan wrote: >> >> Hi Reinette, >> >> Okay ran a quick test. Why does this test leave "/sys/fs/resctrl" >> mounted when it exits. Can we fix this to unmount before the test >> exits? > > I also wasn't able to reproduce this unmounting issue: > - with unmounted resctrl before test: > > [/root]# ls /sys/fs/resctrl/ > [/root]# > [/root]# ./resctrl_tests -t L3_NONCONT_CAT > TAP version 13 > # Pass: Check kernel supports resctrl filesystem > # Pass: Check resctrl mountpoint "/sys/fs/resctrl" exists > # resctrl filesystem not mounted > # dmesg: [ 12.502941] resctrl: L3 allocation detected > # dmesg: [ 12.507134] resctrl: MB allocation detected > # dmesg: [ 12.511315] resctrl: L3 monitoring detected > 1..1 > # Starting L3_NONCONT_CAT test ... > # Mounting resctrl to "/sys/fs/resctrl" > # Write schema "L3:1=3f" to resctrl FS > # Write schema "L3:1=f0f" to resctrl FS # write() failed : Invalid argument > # Non-contiguous CBMs not supported and write of non-contiguous CBM failed as expected > ok 1 L3_NONCONT_CAT: test > # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > [/root]# ls /sys/fs/resctrl/ > [/root]# > > And with mounted before test: > > [/root]# ls /sys/fs/resctrl/ > [/root]# > [/root]# mount -t resctrl resctrl /sys/fs/resctrl > [/root]# ls /sys/fs/resctrl/ > cpus cpus_list info mode mon_data mon_groups schemata size tasks > [/root]# ./resctrl_tests -t L3_NONCONT_CAT > TAP version 13 > # Pass: Check kernel supports resctrl filesystem > # Pass: Check resctrl mountpoint "/sys/fs/resctrl" exists > # resctrl filesystem is mounted > # dmesg: [ 12.502941] resctrl: L3 allocation detected > # dmesg: [ 12.507134] resctrl: MB allocation detected > # dmesg: [ 12.511315] resctrl: L3 monitoring detected > 1..1 > # Starting L3_NONCONT_CAT test ... > # Mounting resctrl to "/sys/fs/resctrl" > # Write schema "L3:1=3f" to resctrl FS > # Write schema "L3:1=f0f" to resctrl FS # write() failed : Invalid argument > # Non-contiguous CBMs not supported and write of non-contiguous CBM failed as expected > ok 1 L3_NONCONT_CAT: test > # Totals: pass:1 fail:0 xfail:0 xpass:0 skip:0 error:0 > [/root]# ls /sys/fs/resctrl/ > [/root]# > > Looking at the code there is an unmounting function called after each test (at > the end of run_single_test() inside of test_cleanup()). The non-contiguous test > also doesn't write any data into a temp file so no additional cleanup is > necessary. > Looks fine. Thanks for the clarification. thanks, -- Shuah