[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[LTP] mmap001 questions



I have a question about the "-m" option for mmap001.  I have a Linux box
with 380MB ram installed.  I usually have about 355 to 360 MB of free
memory (389 when swap space is included)....according to "free -m -t".  I'm
trying to push the limits of the memory and get the manager to start using
the swap space, so I specify enough calculated pages to go over the 355
limit.  By running "top", I able to watch the memory usage increase during
the test.  The problem is that memory usage always stops at the 355
limit....no matter what I put in the "-m" option.  I even went as far as
specifing 2GB of memory and the test "PASSED" on all parts.  My question is
on the validity of the test, since I'm able to set a memory limit of 2GB on
a machine with only 380MB and get "PASS" on every case.

I've just finished porting a similar test that uses mmap to write and then
reads what was written and compares the data using a checksum.  Using this
test I'm able to push the memory to the limit of crashing the box, but if I
specify more memory than I actually have the appropriate "Cannot allocate
memory" message occurs and the test is aborted.  I've compared my test to
mmap001, and the only major differences are that I use the PROT_WRITE and
PROT_READ options on mmap, actually read from the written array for
verification, and don't perform the msync.  I'm not trying to "beat up" on
the mmap001 test....it's good and I've been using it to help my debugging
efforts on my ported testcase....I'm just trying to understand the "hidden"
protection within the mmap001 test.


- Robbie

Robert V. Williamson
Linux System Test
Linux Technology Center
Phone: (512) 838-9295   T/L: 638-9295
Email: robbiew@us.ibm.com