提交 22da0461 编写于 作者: W Wang ShaoBo 提交者: Yang Yingliang

arm64/mpam: Clean up header files and rearrange declarations

hulk inclusion
category: feature
bugzilla: 34278
CVE: NA

-------------------------------------------------

Rearrange helpers' declaration place for resctrlfs and clean up
header files included, this make code more clear.
Signed-off-by: NWang ShaoBo <bobo.shaobowang@huawei.com>
Reviewed-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NCheng Jian <cj.chengjian@huawei.com>
上级 24e0745c
...@@ -115,9 +115,6 @@ ...@@ -115,9 +115,6 @@
DECLARE_STATIC_KEY_FALSE(resctrl_enable_key); DECLARE_STATIC_KEY_FALSE(resctrl_enable_key);
DECLARE_STATIC_KEY_FALSE(resctrl_mon_enable_key); DECLARE_STATIC_KEY_FALSE(resctrl_mon_enable_key);
extern bool rdt_alloc_capable;
extern bool rdt_mon_capable;
extern int max_name_width, max_data_width; extern int max_name_width, max_data_width;
enum resctrl_conf_type { enum resctrl_conf_type {
...@@ -207,11 +204,6 @@ struct resctrl_schema { ...@@ -207,11 +204,6 @@ struct resctrl_schema {
struct resctrl_resource *res; struct resctrl_resource *res;
}; };
/* rdtgroup.flags */
#define RDT_DELETED BIT(0)
#define RDT_CTRLMON BIT(1)
/** /**
* struct rdt_domain - group of cpus sharing an RDT resource * struct rdt_domain - group of cpus sharing an RDT resource
* @list: all instances of this resource * @list: all instances of this resource
...@@ -250,35 +242,13 @@ struct rdt_domain { ...@@ -250,35 +242,13 @@ struct rdt_domain {
#define RESCTRL_SHOW_DOM_MAX_NUM 8 #define RESCTRL_SHOW_DOM_MAX_NUM 8
extern struct mutex resctrl_group_mutex;
extern struct resctrl_resource resctrl_resources_all[];
int __init resctrl_group_init(void); int __init resctrl_group_init(void);
void rdt_last_cmd_clear(void);
void rdt_last_cmd_puts(const char *s);
void rdt_last_cmd_printf(const char *fmt, ...);
int alloc_rmid(void);
void free_rmid(u32 rmid);
int resctrl_group_mondata_show(struct seq_file *m, void *arg); int resctrl_group_mondata_show(struct seq_file *m, void *arg);
void rmdir_mondata_subdir_allrdtgrp(struct resctrl_resource *r, void rmdir_mondata_subdir_allrdtgrp(struct resctrl_resource *r,
unsigned int dom_id); unsigned int dom_id);
int closid_init(void);
int closid_alloc(void);
void closid_free(int closid);
int cdp_enable(int level, int data_type, int code_type); int cdp_enable(int level, int data_type, int code_type);
void resctrl_resource_reset(void);
void release_rdtgroupfs_options(void);
int parse_rdtgroupfs_options(char *data);
static inline int __resctrl_group_show_options(struct seq_file *seq)
{
return 0;
}
void post_resctrl_mount(void); void post_resctrl_mount(void);
...@@ -354,6 +324,12 @@ union mon_data_bits { ...@@ -354,6 +324,12 @@ union mon_data_bits {
} u; } u;
}; };
ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of,
char *buf, size_t nbytes, loff_t off);
int resctrl_group_schemata_show(struct kernfs_open_file *of,
struct seq_file *s, void *v);
struct rdt_domain *mpam_find_domain(struct resctrl_resource *r, int id, struct rdt_domain *mpam_find_domain(struct resctrl_resource *r, int id,
struct list_head **pos); struct list_head **pos);
...@@ -365,14 +341,6 @@ int resctrl_group_ctrlmon_show(struct kernfs_open_file *of, ...@@ -365,14 +341,6 @@ int resctrl_group_ctrlmon_show(struct kernfs_open_file *of,
int resctrl_group_alloc_mon(struct rdtgroup *grp); int resctrl_group_alloc_mon(struct rdtgroup *grp);
void mon_init(void);
int alloc_mon(void);
void free_mon(u32 mon);
int resctrl_mkdir_ctrlmon_mondata(struct kernfs_node *parent_kn,
struct rdtgroup *prgrp,
struct kernfs_node **dest_kn);
u16 mpam_resctrl_max_mon_num(void); u16 mpam_resctrl_max_mon_num(void);
#endif /* _ASM_ARM64_MPAM_H */ #endif /* _ASM_ARM64_MPAM_H */
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define _ASM_ARM64_RESCTRL_H #define _ASM_ARM64_RESCTRL_H
#include <asm/mpam_sched.h> #include <asm/mpam_sched.h>
#include <asm/mpam.h>
#define resctrl_group rdtgroup #define resctrl_group rdtgroup
#define resctrl_alloc_capable rdt_alloc_capable #define resctrl_alloc_capable rdt_alloc_capable
...@@ -79,6 +78,9 @@ int schemata_list_init(void); ...@@ -79,6 +78,9 @@ int schemata_list_init(void);
void schemata_list_destroy(void); void schemata_list_destroy(void);
int alloc_rmid(void);
void free_rmid(u32 rmid);
static inline int alloc_mon_id(void) static inline int alloc_mon_id(void)
{ {
...@@ -90,7 +92,11 @@ static inline void free_mon_id(u32 id) ...@@ -90,7 +92,11 @@ static inline void free_mon_id(u32 id)
free_rmid(id); free_rmid(id);
} }
int closid_init(void);
int closid_alloc(void);
void closid_free(int closid);
void pmg_init(void); void pmg_init(void);
static inline int resctrl_id_init(void) static inline int resctrl_id_init(void)
{ {
int ret; int ret;
...@@ -120,11 +126,26 @@ void update_closid_rmid(const struct cpumask *cpu_mask, struct resctrl_group *r) ...@@ -120,11 +126,26 @@ void update_closid_rmid(const struct cpumask *cpu_mask, struct resctrl_group *r)
int __resctrl_group_move_task(struct task_struct *tsk, int __resctrl_group_move_task(struct task_struct *tsk,
struct resctrl_group *rdtgrp); struct resctrl_group *rdtgrp);
ssize_t resctrl_group_schemata_write(struct kernfs_open_file *of, extern bool rdt_alloc_capable;
char *buf, size_t nbytes, loff_t off); extern bool rdt_mon_capable;
/* rdtgroup.flags */
#define RDT_DELETED BIT(0)
#define RDT_CTRLMON BIT(1)
void rdt_last_cmd_clear(void);
void rdt_last_cmd_puts(const char *s);
void rdt_last_cmd_printf(const char *fmt, ...);
extern struct mutex resctrl_group_mutex;
void release_rdtgroupfs_options(void);
int parse_rdtgroupfs_options(char *data);
int resctrl_group_schemata_show(struct kernfs_open_file *of, int alloc_mon(void);
struct seq_file *s, void *v); void free_mon(u32 mon);
void resctrl_resource_reset(void);
#define release_resctrl_group_fs_options release_rdtgroupfs_options #define release_resctrl_group_fs_options release_rdtgroupfs_options
#define parse_resctrl_group_fs_options parse_rdtgroupfs_options #define parse_resctrl_group_fs_options parse_rdtgroupfs_options
...@@ -141,6 +162,15 @@ mongroup_create_dir(struct kernfs_node *parent_kn, struct resctrl_group *prgrp, ...@@ -141,6 +162,15 @@ mongroup_create_dir(struct kernfs_node *parent_kn, struct resctrl_group *prgrp,
int resctrl_group_init_alloc(struct rdtgroup *rdtgrp); int resctrl_group_init_alloc(struct rdtgroup *rdtgrp);
static inline int __resctrl_group_show_options(struct seq_file *seq)
{
return 0;
}
int resctrl_mkdir_ctrlmon_mondata(struct kernfs_node *parent_kn,
struct rdtgroup *prgrp,
struct kernfs_node **dest_kn);
struct resctrl_resource * struct resctrl_resource *
mpam_resctrl_get_resource(enum resctrl_resource_level level); mpam_resctrl_get_resource(enum resctrl_resource_level level);
......
...@@ -33,11 +33,8 @@ ...@@ -33,11 +33,8 @@
#include <linux/kernfs.h> #include <linux/kernfs.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/resctrlfs.h>
#include <asm/mpam.h>
#include <asm/mpam_resource.h> #include <asm/mpam_resource.h>
#include <asm/resctrl.h>
#include "mpam_internal.h" #include "mpam_internal.h"
/* schemata content list */ /* schemata content list */
...@@ -705,7 +702,6 @@ int mkdir_mondata_all(struct kernfs_node *parent_kn, ...@@ -705,7 +702,6 @@ int mkdir_mondata_all(struct kernfs_node *parent_kn,
r = s->res; r = s->res;
if (r->mon_enabled) { if (r->mon_enabled) {
/* HHA does not support monitor by pmg */
struct raw_resctrl_resource *rr; struct raw_resctrl_resource *rr;
rr = r->res; rr = r->res;
......
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
#include <linux/cacheinfo.h> #include <linux/cacheinfo.h>
#include <linux/arm_mpam.h> #include <linux/arm_mpam.h>
#include <asm/mpam_resource.h> #include <asm/mpam_resource.h>
#include <asm/mpam.h>
#include "mpam_device.h" #include "mpam_device.h"
#include "mpam_internal.h"
/* /*
* During discovery this lock protects writers to class, components and devices. * During discovery this lock protects writers to class, components and devices.
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <linux/cpumask.h> #include <linux/cpumask.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/arm_mpam.h> #include <linux/arm_mpam.h>
#include "mpam_internal.h"
struct mpam_config; struct mpam_config;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#define _ASM_ARM64_MPAM_INTERNAL_H #define _ASM_ARM64_MPAM_INTERNAL_H
#include <linux/resctrlfs.h> #include <linux/resctrlfs.h>
#include <asm/mpam.h>
#include <asm/resctrl.h> #include <asm/resctrl.h>
typedef u32 mpam_features_t; typedef u32 mpam_features_t;
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/resctrlfs.h>
#include <asm/resctrl.h>
#include "mpam_internal.h" #include "mpam_internal.h"
......
...@@ -37,12 +37,10 @@ ...@@ -37,12 +37,10 @@
#include <linux/task_work.h> #include <linux/task_work.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
#include <linux/sched/task.h> #include <linux/sched/task.h>
#include <linux/resctrlfs.h>
#include <linux/arm_mpam.h> #include <linux/arm_mpam.h>
#include <asm/mpam_sched.h> #include <asm/mpam_sched.h>
#include <asm/mpam_resource.h> #include <asm/mpam_resource.h>
#include <asm/resctrl.h>
#include <asm/io.h> #include <asm/io.h>
#include "mpam_device.h" #include "mpam_device.h"
......
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/resctrlfs.h>
#include <asm/resctrl.h>
#include "mpam_device.h" #include "mpam_device.h"
#include "mpam_internal.h" #include "mpam_internal.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册