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.

-- 
Kind regards
Maciej Wieczór-Retman

Reply via email to