hugemmap/hugemmap03.c: fix the ppc64 FAILED situation procedure
PATCH 1/1 hugemmap/hugemmap03.c: fix the ppc64 FAILED situation procedure
From: Li Wang <[email protected]>
When testing on ppc64 arch, ./hugemmap03 -s 64 failed message as:
hugemmap03 1 TFAIL : mmap into high region failed unexpectedly - expect errno=ENOMEM, got: errno=EINVAL(22): Invalid
But it is not the system issue, MMAP(2) Programmer's Manual define the mmap() error return value like:
EINVAL We don't like addr, length, or offset (e.g., they are too large, or not aligned on a page boundary). ENOMEM No memory is available, or the process's maximum number of mappings would have been exceeded.
So, we should consider the EINVAL return situation on ppc64.
--- testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
testcases/kernel/mem/hugetlb/hugemmap/hugemmap03.c +6 -6
@@ -100,7 +100,7 @@ int main(int ac, char **av) tst_count =0 ; -/* Attempt to mmap into highmem addr, should get ENOMEM */ +/* Attempt to mmap into highmem addr, should get ENOMEM or EINVAL (on arch ppc64) */ addr =mmap (HIGH_ADDR , map_sz,PROT_READ ,MAP_SHARED |MAP_FIXED , fildes,0 );if (addr !=MAP_FAILED ) {
@@ -108,13 +108,13 @@ int main(int ac, char **av) "succeeded unexpectedly"); goto fail; } -if (errno !=ENOMEM ) -tst_resm (TFAIL |TERRNO ,"mmap into high region " -"failed unexpectedly - expect " -"errno=ENOMEM, got" ); -else +if (errno ==ENOMEM || errno ==EINVAL )tst_resm (TPASS |TERRNO ,"mmap into high region " "failed as expected" ); +else +tst_resm (TFAIL |TERRNO ,"mmap into high region " +"failed unexpectedly - expect " +"errno=ENOMEM or EINVAL, got" ); fail:close (fildes); }
Signature · 11 lines
1.8.1.2 ------------------------------------------------------------------------------ Time is money. Stop wasting it! Get your web API in 5 minutes. www.restlet.com/download http://p.sf.net/sfu/restlet _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list
Hi!
Quoted 7 lines
When testing on ppc64 arch,
./hugemmap03 -s 64failed message as:
hugemmap03 1 TFAIL : mmap into high region failed unexpectedly - expect errno=ENOMEM, got: errno=EINVAL(22): InvalidBut it is not the system issue, MMAP(2) Programmer's Manual define the
mmap()error return value like:
EINVAL We don't like addr, length, or offset (e.g., they are too large, or not aligned on a page boundary). ENOMEM No memory is available, or the process's maximum number of mappings would have been exceeded.
So, we should consider the EINVAL return situation on ppc64.
Which kernel version does this happen on?
Can you capture kernel function trace of the test?
We looked at the test (I've got help from Mel Gorman) and we concluded that the test has nothing to do with hugepages and that it simply checks that addresses outside of the process space are rejected by the kernel. Which should return ENOMEM on ppc64 too (because the high address constant in the test should be high enough for ppc64 too).
Signature · 13 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list