Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard coded "mm01 mmap001 -m 10000" in runtest/mm causes test failure #664

Open
ywangwrs opened this issue Apr 16, 2020 · 9 comments
Open

Comments

@ywangwrs
Copy link

In runtest/mm, mm01 is defined as "mmap001 -m 10000", here the pages is set to 10000.
Normally, PAGE_SIZE = 4KB, so 40MB of mmap will be tested, but if a kernel has set PAGE_SIZE to 64KB, 10000 x 64KB = 640MB, this may exceed available memory in the system and cause failures.
For example: in a aarch64 system:
<<<test_start>>>
tag=mm01 stime=1565786038
cmdline="mmap001 -m 10000"
contacts=""
analysis=exit
<<<test_output>>>
mmap001 0 TINFO : mmap()ing file of 10000 pages or 655360000 bytes
mmap001 1 TPASS : mmap() completed successfully.
mmap001 0 TINFO : touching mmaped memory
mmap001 2 TBROK : tst_sig.c:233: unexpected signal SIGBUS(7) received (pid = 27075).
mmap001 3 TBROK : tst_sig.c:233: Remaining cases broken
<<<execution_status>>>
initiation_status="ok"
duration=36 termination_type=exited termination_id=2 corefile=no
cutime=48 cstime=53
<<<test_end>>>

@xuyang0410
Copy link
Member

Maybe we can lower this value to 5000, I guess most systems have so much available memory.

@ywangwrs
Copy link
Author

Hmmm... That could be too large for some aarch64 board as well.
Is that possible to use variable and test available size of memory?

@xuyang0410
Copy link
Member

xuyang0410 commented Apr 17, 2020

Maybe we can add a check in mmap01.c, ie hugetlb: limit hugepages according to MemAvailable.

@pevik
Copy link
Member

pevik commented Apr 17, 2020

There could be even some API function to use % size of the memory.

@metan-ucw
Copy link
Member

Indeed there should be an API for figuring out how much memory a test can use, then we could use this function and divide it by a page size in this case.

@xuyang0410
Copy link
Member

I will cleanup this case and add api to figure out the available memory .

@ywangwrs
Copy link
Author

Any update on this issue?

@metan-ucw
Copy link
Member

@xuyang0410 have you had time to look into this?

@xuyang0410
Copy link
Member

I plan to pick up msgstress case again and then look into this case in November if nobody does it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants