#include #include #include #include #include #include #include void alloc_and_die(void) { uint64_t i; uint64_t n = 4*1024*1024*1024ll; char *x = malloc(n); printf("touching pages\n"); /* touch each page once */ for (i=0;i 10*1024*1024ll) { counter++; if (counter%2) { fsync(fd); lseek(fd, 0, SEEK_SET); } else { unlink(fname); close(fd); strncpy(fname, "iothreadXXXXXX", sizeof(fname)); fd = mkstemp(fname); if (fd == -1) { perror("mkstemp"); abort(); } } for (i=0;i