Re: [PATCH] Fix hugeshmat05 test failure on lpar with 1GB hugepages.

Andrea Cervesato via ltp <[email protected]>
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Pavithra,

> +	tst_res(TINFO, "Page size: %ld bytes", page_size);
> +	tst_res(TINFO, "Hugepage size: %ld bytes (%ld MB)",
> +		hpage_size, hpage_size / (1024 * 1024));
>  }

[...]

>  
> -void shm_test(int size)
> +void shm_test(long size)
>  {
>  	int shmid;
>  	char *shmaddr;
> @@ -56,7 +60,7 @@ void shm_test(int size)
>  	}
>  
>  	shmaddr[0] = 1;
> -	tst_res(TINFO, "allocated %d huge bytes", size);
> +	tst_res(TINFO, "allocated %ld huge bytes", size);
>  
>  	if (shmdt((const void *)shmaddr) != 0) {
>  		shmctl(shmid, IPC_RMID, NULL);
> @@ -69,13 +73,23 @@ void shm_test(int size)
>  static void test_hugeshmat(void)
>  {
>  	unsigned int i;
> +	long multiplier;
> +	long tst_sizes[4];
> +
> +	/*
> +	 * For large hugepage sizes (e.g., 1GB), use N/2 multiplier to avoid
> +	 * excessive memory requirements (4GB for N=4 with 1GB pages) while
> +	 * still testing alignment boundary conditions with multiple pages.
> +	 */
> +	if (hpage_size >= 1024 * 1024 * 1024)
> +		multiplier = N / 2;
> +	else
> +		multiplier = N;
>  
> -	const int tst_sizes[] = {
> -		N * hpage_size - page_size,
> -		N * hpage_size - page_size - 1,
> -		hpage_size,
> -		hpage_size + 1
> -	};
> +	tst_sizes[0] = multiplier * hpage_size - page_size;
> +	tst_sizes[1] = multiplier * hpage_size - page_size - 1;
> +	tst_sizes[2] = hpage_size;
> +	tst_sizes[3] = hpage_size + 1;
>  

Are you still working on this patch? If yes, please update it according
to the agent review, before sending a v2. Also, in LTP we have TST_KB,
TST_MB, TST_GB, so you can avoid using `1024 * 1024 ..` format.

Please rebase to master and send a new version, I will move this patch
into Changes Requested before proceeding to the proper review.

Regards,
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
andrea.cervesato-IBi9RG/[email protected]

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.