lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <358c9ac7-4a55-4aa7-b51d-be15e377d154@intel.com>
Date: Wed, 29 May 2024 10:44:59 -0700
From: Reinette Chatre <reinette.chatre@...el.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
	<linux-kselftest@...r.kernel.org>, Shuah Khan <shuah@...nel.org>, Babu Moger
	<babu.moger@....com>, Maciej Wieczór-Retman
	<maciej.wieczor-retman@...el.com>
CC: <linux-kernel@...r.kernel.org>, Fenghua Yu <fenghua.yu@...el.com>, "Shuah
 Khan" <skhan@...uxfoundation.org>
Subject: Re: [PATCH v4 07/16] selftests/resctrl: Rename measure_vals() to
 measure_mem_bw_vals() & document

Hi Ilpo,

Function name in shortlog does not match the patch.

On 5/20/24 5:30 AM, Ilpo Järvinen wrote:
> measure_val() is awfully generic name so rename it to measure_mem_bw()

measure_val() -> measure_vals()

> to describe better what it does and document the function parameters.
> 
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
> ---
>   tools/testing/selftests/resctrl/resctrl_val.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/testing/selftests/resctrl/resctrl_val.c b/tools/testing/selftests/resctrl/resctrl_val.c
> index 198b5133432a..6c53eb9171ea 100644
> --- a/tools/testing/selftests/resctrl/resctrl_val.c
> +++ b/tools/testing/selftests/resctrl/resctrl_val.c
> @@ -637,8 +637,14 @@ static void initialize_llc_occu_resctrl(const char *ctrlgrp, const char *mongrp,
>   		set_cmt_path(ctrlgrp, mongrp, domain_id);
>   }
>   
> -static int measure_vals(const struct user_params *uparams,
> -			struct resctrl_val_param *param, pid_t bm_pid)
> +/*
> + * measure_mem_bw - Measures memory bandwidth numbers while benchmark runs
> + * @uparams:		User supplied parameters
> + * @param:		parameters passed to resctrl_val()

Please consistently start descriptions with upper case.

> + * @bm_pid:		PID that runs the benchmark
> + */
> +static int measure_mem_bw(const struct user_params *uparams,
> +			  struct resctrl_val_param *param, pid_t bm_pid)
>   {
>   	unsigned long bw_resc, bw_resc_start, bw_resc_end;
>   	FILE *mem_bw_fp, *mem_bw_fp2;
> @@ -912,7 +918,7 @@ int resctrl_val(const struct resctrl_test *test,
>   
>   		if (!strncmp(resctrl_val, MBM_STR, sizeof(MBM_STR)) ||
>   		    !strncmp(resctrl_val, MBA_STR, sizeof(MBA_STR))) {
> -			ret = measure_vals(uparams, param, bm_pid);
> +			ret = measure_mem_bw(uparams, param, bm_pid);
>   			if (ret)
>   				break;
>   		} else if (!strncmp(resctrl_val, CMT_STR, sizeof(CMT_STR))) {

With typos fixed:

| Reviewed-by: Reinette Chatre <reinette.chatre@...el.com>

Reinette


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ