hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IDA7PH -------------------------------- Currently, after mounting resctrl, the -o l2 option is not shown in the mount list, and under the -o cdp option, cdpl2 information is incorrectly displayed additionally. This fix resolves the incorrect display of mount options in the mount list. After the fix, the mount list will show the actual effective mount parameters, as illustrated by the following examples: 1. After mounting with -o cdpl2, the mount list will now show only cdp. 2. After mounting with -o l2,cdpl2, the mount list will show l2,cdpl2. Fixes: 13e249bf4944 ("x86/resctrl: Move the filesystem portions of resctrl to live in '/fs/'") Signed-off-by: Quanmin Yan <yanquanmin1@huawei.com> --- fs/resctrl/rdtgroup.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/resctrl/rdtgroup.c b/fs/resctrl/rdtgroup.c index 96a9c3d001db..00e24d052650 100644 --- a/fs/resctrl/rdtgroup.c +++ b/fs/resctrl/rdtgroup.c @@ -3932,10 +3932,12 @@ static int rdtgroup_rename(struct kernfs_node *kn, static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) { + bool l2_visible = !resctrl_arch_get_resource(RDT_RESOURCE_L2)->invisible; + if (resctrl_arch_get_cdp_enabled(RDT_RESOURCE_L3)) seq_puts(seq, ",cdp"); - if (resctrl_arch_get_cdp_enabled(RDT_RESOURCE_L2)) + if (l2_visible && resctrl_arch_get_cdp_enabled(RDT_RESOURCE_L2)) seq_puts(seq, ",cdpl2"); if (is_mba_sc(resctrl_arch_get_resource(RDT_RESOURCE_MBA))) @@ -3944,6 +3946,9 @@ static int rdtgroup_show_options(struct seq_file *seq, struct kernfs_root *kf) if (resctrl_debug) seq_puts(seq, ",debug"); + if (IS_ENABLED(CONFIG_ARM64_MPAM) && l2_visible) + seq_puts(seq, ",l2"); + return 0; } -- 2.43.0