Re: [LTP] [PATCH] fix "hugetlb" several tests

Randy Dunlap
2010-04-14T16:39:53Z

On Wed, 14 Apr 2010 17:58:17 +0900 Mitani wrote:

> Hi,
>
> I suggest new patch.
>
> Signed-off-by: Tomonori Mitani <mitani@ryobi.co.jp>

This one is OK with me also, but...

Is it possible to determine the difference between a kernel that does
not support hugepages at all and a kernel that does support hugepages
but just does not have enough of them allocated?

or maybe we don't care about this difference. Do we?

> ============
> --- a/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugemmap/hugemmap04.c 2010-04-14
> 16:40:25.000000000 +0900
> @@ -127,8 +127,7 @@
>
> /* Check number of hugepages */
> if (get_no_of_hugepages() <= 0 || hugepages_size() <= 0)
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> \
> - sufficient availability of Hugepages on the
> system");
> + tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
>
> /* Perform global setup for test */
> setup();
> --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat01.c 2010-04-14
> 16:48:54.000000000 +0900
> @@ -105,7 +105,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat02.c 2010-04-14
> 16:49:15.000000000 +0900
> @@ -102,7 +102,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmat/hugeshmat03.c 2010-04-14
> 16:49:31.000000000 +0900
> @@ -86,7 +86,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl01.c 2010-04-14
> 16:50:16.000000000 +0900
> @@ -130,7 +130,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl02.c 2010-04-14
> 16:50:28.000000000 +0900
> @@ -102,7 +102,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmctl/hugeshmctl03.c 2010-04-14
> 16:50:40.000000000 +0900
> @@ -105,7 +105,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmdt/hugeshmdt01.c 2010-04-14
> 16:51:11.000000000 +0900
> @@ -87,7 +87,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget01.c 2010-04-14
> 16:51:34.000000000 +0900
> @@ -82,7 +82,7 @@
>
> /* The following loop checks looping state if -i option given */
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget02.c 2010-04-14
> 16:51:45.000000000 +0900
> @@ -84,7 +84,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c 2010-04-14
> 16:51:55.000000000 +0900
> @@ -85,7 +85,7 @@
>
> /* The following loop checks looping state if -i option given */
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, tst_exit, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> --- a/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c 2010-04-01
> 15:23:09.000000000 +0900
> +++ b/testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget05.c 2010-04-14
> 16:52:10.000000000 +0900
> @@ -86,7 +86,7 @@
> }
>
> if ( get_no_of_hugepages() <= 0 || hugepages_size() <= 0 )
> - tst_brkm(TBROK, cleanup, "Test cannot be continued owning to
> sufficient availability of Hugepages on the system");
> + tst_brkm(TCONF, cleanup, "Not enough available Hugepages");
> else
> huge_pages_shm_to_be_allocated = ( get_no_of_hugepages() *
> hugepages_size() * 1024) / 2 ;
>
> ============

---
~Randy