Skip to content

Commit 76f8f00

Browse files
rchatreshuahkh
authored andcommitted
selftests/resctrl: Remove unused measurement code
The MBM and MBA resctrl selftests run a benchmark during which it takes measurements of read memory bandwidth via perf. Code exists to support measurements of write memory bandwidth but there exists no path with which this code can execute. While code exists for write memory bandwidth measurement there has not yet been a use case for it. Remove this unused code. Rename relevant functions to include "read" so that it is clear that it relates only to memory bandwidth reads, while renaming the functions also add consistency by changing the "membw" instances to more prevalent "mem_bw". Signed-off-by: Reinette Chatre <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 1384241 commit 76f8f00

File tree

5 files changed

+85
-182
lines changed

5 files changed

+85
-182
lines changed

tools/testing/selftests/resctrl/mba_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static int mba_init(const struct resctrl_val_param *param, int domain_id)
2121
{
2222
int ret;
2323

24-
ret = initialize_mem_bw_imc();
24+
ret = initialize_read_mem_bw_imc();
2525
if (ret)
2626
return ret;
2727

@@ -68,7 +68,7 @@ static int mba_setup(const struct resctrl_test *test,
6868
static int mba_measure(const struct user_params *uparams,
6969
struct resctrl_val_param *param, pid_t bm_pid)
7070
{
71-
return measure_mem_bw(uparams, param, bm_pid, "reads");
71+
return measure_read_mem_bw(uparams, param, bm_pid);
7272
}
7373

7474
static bool show_mba_info(unsigned long *bw_imc, unsigned long *bw_resc)

tools/testing/selftests/resctrl/mbm_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static int mbm_init(const struct resctrl_val_param *param, int domain_id)
9191
{
9292
int ret;
9393

94-
ret = initialize_mem_bw_imc();
94+
ret = initialize_read_mem_bw_imc();
9595
if (ret)
9696
return ret;
9797

@@ -122,7 +122,7 @@ static int mbm_setup(const struct resctrl_test *test,
122122
static int mbm_measure(const struct user_params *uparams,
123123
struct resctrl_val_param *param, pid_t bm_pid)
124124
{
125-
return measure_mem_bw(uparams, param, bm_pid, "reads");
125+
return measure_read_mem_bw(uparams, param, bm_pid);
126126
}
127127

128128
static void mbm_test_cleanup(void)

tools/testing/selftests/resctrl/resctrl.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ int filter_dmesg(void);
126126
int get_domain_id(const char *resource, int cpu_no, int *domain_id);
127127
int mount_resctrlfs(void);
128128
int umount_resctrlfs(void);
129-
const char *get_bw_report_type(const char *bw_report);
130129
bool resctrl_resource_exists(const char *resource);
131130
bool resctrl_mon_feature_exists(const char *resource, const char *feature);
132131
bool resource_info_file_exists(const char *resource, const char *file);
@@ -143,10 +142,9 @@ unsigned char *alloc_buffer(size_t buf_size, int memflush);
143142
void mem_flush(unsigned char *buf, size_t buf_size);
144143
void fill_cache_read(unsigned char *buf, size_t buf_size, bool once);
145144
int run_fill_buf(size_t buf_size, int memflush);
146-
int initialize_mem_bw_imc(void);
147-
int measure_mem_bw(const struct user_params *uparams,
148-
struct resctrl_val_param *param, pid_t bm_pid,
149-
const char *bw_report);
145+
int initialize_read_mem_bw_imc(void);
146+
int measure_read_mem_bw(const struct user_params *uparams,
147+
struct resctrl_val_param *param, pid_t bm_pid);
150148
void initialize_mem_bw_resctrl(const struct resctrl_val_param *param,
151149
int domain_id);
152150
int resctrl_val(const struct resctrl_test *test,

0 commit comments

Comments
 (0)