Re: [PATCH v4 09/19] selftests/resctrl: Convert span to size_t

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ilpo,

On 7/13/2023 6:19 AM, Ilpo Järvinen wrote:

...

> @@ -188,10 +188,10 @@ fill_cache(unsigned long long buf_size, int malloc_and_init, int memflush,
>  	return 0;
>  }
>  
> -int run_fill_buf(unsigned long span, int malloc_and_init_memory,
> -		 int memflush, int op, char *resctrl_val)
> +int run_fill_buf(size_t span, int malloc_and_init_memory, int memflush, int op,
> +		 char *resctrl_val)
>  {
> -	unsigned long long cache_size = span;
> +	size_t cache_size = span;
>  	int ret;
>  
>  	ret = fill_cache(cache_size, malloc_and_init_memory, memflush, op,

Any idea what the purpose being run_fill_buf() is? From what I can tell it is
an unnecessary level of indirection.

...

> diff --git a/tools/testing/selftests/resctrl/resctrlfs.c b/tools/testing/selftests/resctrl/resctrlfs.c
> index f622245adafe..8be5b745226d 100644
> --- a/tools/testing/selftests/resctrl/resctrlfs.c
> +++ b/tools/testing/selftests/resctrl/resctrlfs.c
> @@ -298,7 +298,7 @@ int taskset_benchmark(pid_t bm_pid, int cpu_no)
>  void run_benchmark(int signum, siginfo_t *info, void *ucontext)
>  {
>  	int operation, ret, malloc_and_init_memory, memflush;
> -	unsigned long span, buffer_span;
> +	size_t span, buffer_span;
>  	char **benchmark_cmd;
>  	char resctrl_val[64];
>  	FILE *fp;

Do we now need a cast in the initialization of span?

Reinette



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux