----- Original Message -----
> From: "Caspar Zhang" <cas...@casparzhang.com>
> To: "Li Wang" <wangli.a...@gmail.com>, ltp-list@lists.sourceforge.net
> Sent: Tuesday, 22 July, 2014 6:12:55 AM
> Subject: Re: [LTP] fix hugemmap03 fails on s390x error
>
> On 07/22/2014 11:24 AM, Li Wang wrote:
> > Hi all,
> >
> > LTP failed with mmap into high region on s390x:
> >
> > hugemmap03 0 TINFO : set nr_hugepages to 64
> > hugemmap03 1 TFAIL : mmap into high region succeeded unexpectedly
> > hugemmap03 0 TINFO : set nr_hugepages to 0
> > hugemmap03 0 TWARN : tst_rmdir: rmobj(/tmp/hugOr8owE) failed:
> > remove(/tmp/hugOr8owE) failed; errno=16: Device or resource busy
> >
> >
> > According to the test case, the failing code is:
> >
> > 103 /* Attempt to mmap into highmem addr, should get ENOMEM
> > */
> > 104 addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
> > 105 MAP_SHARED | MAP_FIXED, fildes, 0);
> > 106 if (addr != MAP_FAILED) {
> > 107 tst_resm(TFAIL, "mmap into high region "
> > 108 "succeeded unexpectedly");
> > 109 goto fail;
> > 110 }
> >
> > with HIGH_ADDR defined as:
> >
> > #define HIGH_ADDR (void *)(0x1000000000000)
> >
> > This is an 2^48 address... which is likely the maximum for amd64. On
> > s390x, the address space is up to 2^53. So the mmap() in the test case
> > succeeds which is not expected.
> >
> >
> > ---------------------------------------------
> >
> > after increase the HIGH_ADDR value, test PASS.
> >
> > [root@ibm-z10-38 hugemmap]# cat hugemmap03.c |grep HIGH
> > #define HIGH_ADDR (void *)(0x100000000000000) <----increase the value
> > addr = mmap(HIGH_ADDR, map_sz, PROT_READ,
I tested this on s390x, and can confirm that raising it to 2^53 or higher
gives -ENOMEM.
I posted a small patch and added your Sob.
Regards,
Jan
> >
> >
> > [root@ibm-z10-38 hugemmap]# ./hugemmap03 -s 1024
> > hugemmap03 0 TINFO : set nr_hugepages to 1024
> > hugemmap03 1 TPASS : mmap into high region failed as expected:
> > errno=ENOMEM(12): Cannot allocate memory
> > hugemmap03 0 TINFO : set nr_hugepages to 0
> >
> >
> >
> >
>
> Looks good to me. Could you please make a patch for it?
>
> Thanks,
> Caspar
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
>
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list