From 9f90b135c8d7bbcf6d5e0f3f3d552b0b152f897b Mon Sep 17 00:00:00 2001 From: Xiaochen Shen Date: Wed, 13 Sep 2017 00:29:15 +0800 Subject: [PATCH] x86/intel_rdt: Fix cdp info directory files issue CDP config is not initialized correctly by rdt_get_cache_infofile(). With CDP enabled, there are no info files under info/L3CODE and info/L3DATA directories. Move rdt_get_cache_infofile() from intel_rdt_late_init() to rdt_mount() to fix it. mount -t resctrl resctrl -o cdp /sys/fs/resctrl tree /sys/fs/resctrl/ 1. before: /sys/fs/resctrl/ |-- cpus |-- cpus_list |-- info | |-- L3CODE | |-- L3DATA | |-- MB | |-- bandwidth_gran | |-- delay_linear | |-- min_bandwidth | |-- num_closids |-- schemata |-- tasks 2. after: /sys/fs/resctrl/ |-- cpus |-- cpus_list |-- info | |-- L3CODE | | |-- cbm_mask | | |-- min_cbm_bits | | |-- num_closids | |-- L3DATA | | |-- cbm_mask | | |-- min_cbm_bits | | |-- num_closids | |-- MB | |-- bandwidth_gran | |-- delay_linear | |-- min_bandwidth | |-- num_closids |-- schemata |-- tasks Fixes: 6a507a6ad8a6 ("x86/intel_rdt: Make information files resource specific") Signed-off-by: Xiaochen Shen --- arch/x86/kernel/cpu/intel_rdt.c | 1 - arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c index 3de4f6b..930226c 100644 --- a/arch/x86/kernel/cpu/intel_rdt.c +++ b/arch/x86/kernel/cpu/intel_rdt.c @@ -232,7 +232,6 @@ static void rdt_get_cache_config(int idx, struct rdt_resource *r) r->cache.cbm_len = eax.split.cbm_len + 1; r->default_ctrl = BIT_MASK(eax.split.cbm_len + 1) - 1; r->data_width = (r->cache.cbm_len + 3) / 4; - rdt_get_cache_infofile(r); r->capable = true; r->enabled = true; } diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 6711d6d..a8ecab4 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -649,6 +649,7 @@ static int rdtgroup_create_info_dir(struct kernfs_node *parent_kn) if (ret) goto out_destroy; + rdt_get_cache_infofile(r); res_info_files = r->info_files; len = r->nr_info_files; -- 1.8.3.1