x86/resctrl: Move default group file creation to mount
authorBabu Moger <babu.moger@amd.com>
Tue, 17 Oct 2023 00:23:04 +0000 (19:23 -0500)
committerBorislav Petkov (AMD) <bp@alien8.de>
Tue, 17 Oct 2023 10:50:53 +0000 (12:50 +0200)
commitd27567a0eb54be457b25e240593fdbd1c35c8618
treebd79b2c0cec1789e09428175379ad9d8883b8bd4
parentdf5f3a1dd8a6d3ddb1f07a10817f735194717422
x86/resctrl: Move default group file creation to mount

The default resource group and its files are created during kernel init
time. Upcoming changes will make some resctrl files optional based on
a mount parameter. If optional files are to be added to the default
group based on the mount option, then each new file needs to be created
separately and call kernfs_activate() again.

Create all files of the default resource group during resctrl mount,
destroyed during unmount, to avoid scattering resctrl file addition
across two separate code flows.

Signed-off-by: Babu Moger <babu.moger@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Peter Newman <peternewman@google.com>
Reviewed-by: Tan Shaopeng <tan.shaopeng@jp.fujitsu.com>
Reviewed-by: Fenghua Yu <fenghua.yu@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tested-by: Peter Newman <peternewman@google.com>
Tested-by: Tan Shaopeng <tan.shaopeng@jp.fujitsu.com>
Link: https://lore.kernel.org/r/20231017002308.134480-6-babu.moger@amd.com
arch/x86/kernel/cpu/resctrl/rdtgroup.c