• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
CIS 657PROJECT 3EXPERIMENTAL ANALYSIS OF FREEBSD MEMORY MANAGEMENT
DRAFT EXPERIMENTAL DESIGNSINDHURA KANTAMANI(496107233)
1.Restrictions on the sizes of shared memory regions( the len field).(a) Minimum
Consider Process A and Process B on a 5.2 BSD system with 1024-byte pages.Process A takes a shared mapping here and Process B also takes a shared mapping.For different sizes of a file I test in the following way:
Consider that we have a file of size 4 GB and we know the contents of the file.
 Now we know the contents of this file.
For various ranges of sizes, say S we test various cases as follows:
Case 1:
We fill a block of memory of size two pages, and fill it with contents different from thefile we have.
Process A and Process B maps the subset of the file of pagesize (S) with known contentsinto the memory which is filled.
Process B reads the contents of the page at an address more than a page size and check if they are modified or the same.
Process B either reads the original contents of the address space or reads 0’s.
Process A writes to the memory at two different places, one is within the range of themapped file and one outside the range.
When Process A tries to write to an address space outside the address range, it either modifies the contents of the page or throws an error.
 
Process B reads the contents and check if they are modified or the same.
Case 2:
We fill a block of memory of 2* pagesize, and fill it with contents different from the filewe have.
Process A and Process B maps a subset of the file with size 512 bytes(S) with the knowncontents to the memory which is filled.
Process B reads the contents of the page at an address higher than 512 and check if theyare modified or the same.
Process B can either read the original contents of the address space or read 0’s.
Process A writes to the memory at two different places, one is within the range of themapped file and one outside the range.
When Process A tries to write to an address space outside the address range, it either modifies the contents of the page or throws an error.
Process B reads the contents and check if they are modified or the same.
Case 3:
We fill a block of memory of 2* pagesize, and fill it with contents different from the filewe have.
Process A and Process B maps a subset of the file with size 1 byte(S) into the memorywhich is filled.
Process B reads the contents of the page at an address higher than 1 byte and check if they are modified or the same.
Process B can either read the original contents of the address space or read 0’s.
Process A writes to the memory at two different places, one is within the range of themapped file and one outside the range.
When Process A tries to write to an address space outside the address range, it either modifies the contents of the page or throws an error.
Process B reads the contents and check if they are modified or the same.
 
From the three cases above, if the Process B is able to read the contents of the file in a similar way, thenwe can conclude that the minimum value of the len field is 1 byte, and if the behavior of the first twocases are similar and if mmap() fails in the third case , then we can conclude that the minimum size of thelen field is 512. If mamp() fails in the last two cases, then the minimum size of len field should be one pagesize.
(b)Maximum
Considering the same test cases used in part(a) and following the same steps, but if Process Aand Process B maps a subset of the file with sizes(S) of 1 GB, 2 GB, 3 GB, 4 GB.If mmap() fails when we memory map a 4 GB file, then we memory map a 3 GB file and test andif this succeeds, then we test for files of sizes 3 GB + 1, 3 GB +2, so on. If it fails for any of thesecases, then we conclude that the maximum limit for the len field is the previous value at which if fails.If memory mapping a 3 GB file fails, then we test for a 2 GB. If it succeeds for a 2 GB file,then we test for a file of sizes (2 GB + 1), ( 2 GB + 2) and so on. If it fails for any of these cases,then we conclude that the maximum limit for the len field is the previous value at which if fails.For example, if it fails for a file size of (2 GB +1), then we can conclude that maximum limit for the len field is 2 GB.
(c)Requirements as to multiple of some unit size
Considering the same test cases used in part(a) and following the same steps, but if Process A andProcess B maps a subset of the file with sizes(S) of one pagesize, 512 bytes, 1 byte. If mmap()succeeds for all the cases above, then we conclude that the len field should be a multiple of 1 byte. If mmap() fails for a file size of 1 byte and succeeds for 512bytes and one pagesize, then weconclude that the len field should be a multiple of 512 bytes. If mmap() fails for a file size of 512 bytes and succeeds for a file of one pagesize, then we conclude that the len field should be amultiple of pagesize.
2.Restrictions on the addr argument.(a). If addr is not page-aligned.
Consider a Process A and a Process B on a 5.2 BSD system with 1024-byte pages.Process A takes a shared mapping here and Process B also takes a shared mapping.
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...