diff options
author | Robert Morris <[email protected]> | 2019-06-11 09:57:14 -0400 |
---|---|---|
committer | Robert Morris <[email protected]> | 2019-06-11 09:57:14 -0400 |
commit | 5753553213df8f9de851adb68377db43faecb91f (patch) | |
tree | 3b629ff54897fca414146677532cb459a2ed11ba /stressfs.c | |
parent | 91ba81110acd3163f7de3580b677eece0c57f5e7 (diff) | |
download | xv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.gz xv6-labs-5753553213df8f9de851adb68377db43faecb91f.tar.bz2 xv6-labs-5753553213df8f9de851adb68377db43faecb91f.zip |
separate source into kernel/ user/ mkfs/
Diffstat (limited to 'stressfs.c')
-rw-r--r-- | stressfs.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/stressfs.c b/stressfs.c deleted file mode 100644 index c0a4743..0000000 --- a/stressfs.c +++ /dev/null @@ -1,49 +0,0 @@ -// Demonstrate that moving the "acquire" in iderw after the loop that -// appends to the idequeue results in a race. - -// For this to work, you should also add a spin within iderw's -// idequeue traversal loop. Adding the following demonstrated a panic -// after about 5 runs of stressfs in QEMU on a 2.1GHz CPU: -// for (i = 0; i < 40000; i++) -// asm volatile(""); - -#include "types.h" -#include "stat.h" -#include "user.h" -#include "fs.h" -#include "fcntl.h" - -int -main(int argc, char *argv[]) -{ - int fd, i; - char path[] = "stressfs0"; - char data[512]; - - printf(1, "stressfs starting\n"); - memset(data, 'a', sizeof(data)); - - for(i = 0; i < 4; i++) - if(fork() > 0) - break; - - printf(1, "write %d\n", i); - - path[8] += i; - fd = open(path, O_CREATE | O_RDWR); - for(i = 0; i < 20; i++) -// printf(fd, "%d\n", i); - write(fd, data, sizeof(data)); - close(fd); - - printf(1, "read\n"); - - fd = open(path, O_RDONLY); - for (i = 0; i < 20; i++) - read(fd, data, sizeof(data)); - close(fd); - - wait(); - - exit(); -} |