"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "stress-dev-shm.c" between
stress-ng-0.12.09.tar.xz and stress-ng-0.12.10.tar.xz

About: stress-ng will stress test a computer system in various selectable ways. It was designed to exercise various physical subsystems of a computer as well as the various operating system kernel interfaces.

stress-dev-shm.c  (stress-ng-0.12.09.tar.xz):stress-dev-shm.c  (stress-ng-0.12.10.tar.xz)
skipping to change at line 90 skipping to change at line 90
} }
if (sz > 0) { if (sz > 0) {
/* /*
* Now try to map this into our address space * Now try to map this into our address space
*/ */
if (!keep_stressing(args)) if (!keep_stressing(args))
break; break;
addr = mmap(NULL, (size_t)sz, PROT_READ | PROT_WRITE, addr = mmap(NULL, (size_t)sz, PROT_READ | PROT_WRITE,
MAP_SHARED, fd, 0); MAP_SHARED, fd, 0);
if (addr != MAP_FAILED) { if (addr != MAP_FAILED) {
const size_t words = page_size / sizeof(uint32_t) uint32_t *ptr, *end = addr + ((size_t)sz / sizeof
; (*end));
uint32_t *ptr, *end = addr + ((size_t)sz / sizeof const size_t words = page_size / sizeof(*ptr);
(uint32_t));
(void)stress_madvise_random(addr, (size_t)sz); (void)stress_madvise_random(addr, (size_t)sz);
/* Touch all pages with random data */ /* Touch all pages with random data */
for (ptr = addr; ptr < end; ptr += words) { for (ptr = addr; ptr < end; ptr += words) {
*ptr = stress_mwc32(); *ptr = stress_mwc32();
} }
(void)msync(addr, (size_t)sz, MS_INVALIDATE); (void)msync(addr, (size_t)sz, MS_INVALIDATE);
(void)munmap(addr, (size_t)sz); (void)munmap(addr, (size_t)sz);
} }
 End of changes. 1 change blocks. 
4 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)