You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+79-1Lines changed: 79 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,4 +22,82 @@ That's it!
22
22
Download the` OptFS VM`: [Link to VM](http://pages.cs.wisc.edu/~vijayc/optfs-vm.tar.gz).
23
23
It's already setup, so you just need to install the dependencies for the covnerted library, compile it, and then benchmark it to observe the performance difference.
24
24
25
-
By Subrat Mainali and Tom Gong, undergrads at UT Austin.
25
+
By Subrat Mainali and Tom Gong, undergrads at UT Austin.Authors: Tom Gong and Subrat Mainali
26
+
27
+
### Overview of the Tool ###
28
+
This tool makes multiple parses of the library directory (pull request with imporevement welcome).
29
+
In every parse, it tries to determine a function that is an `fsync_wrapper`, a function that is either `fsync` or eventually calls `fsync`, by parsing down the AST nodes.
30
+
Once it has determined all the `fsync_wrappers` in the library directory, it goes through every `fsync_wrapper` AST node and generates two versions of functions (and the associated function declarations) for every `fsync_wrapper`.
31
+
1. The first type of function is called an osync definition, and it's simply the function name prepended with `osync_`. The definition on this function is also different in that all the `fsync_wrappers` that are called inside this function are changed so they call the osync wrapper of their functions instead. So, for instance, this:
32
+
```C
33
+
voidfoo() {
34
+
bar1(); // bar1 is an fsync wrapper
35
+
bar2(); // bar2 is an fsync wrapper
36
+
}
37
+
38
+
```
39
+
would get a second function definition:
40
+
```C
41
+
voidosync_foo() {
42
+
osync_bar1();
43
+
osync_bar2();
44
+
}
45
+
```
46
+
2. The second type of function is called a dsync definition and it's simply the function name prependied with `dsync_`
47
+
In this case, all the function calls inside the function definition are converted to `osync`, except the last one, which is converted to `dsync`. So, for instance, this:
48
+
```C
49
+
voidfoo() {
50
+
bar1(); // bar1 is an fsync wrapper
51
+
bar2(); // bar2 is an fsync wrapper
52
+
}
53
+
54
+
```
55
+
would get a second function definition:
56
+
```C
57
+
voiddsync_foo() {
58
+
osync_bar1(); // bar1 is an fsync wrapper
59
+
dsync_bar2(); // bar2 is an fsync wrapper
60
+
}
61
+
62
+
```
63
+
3. Special case of `fsync`: Since `fsync` is an `fsync_wrapper` too, it must get its own version of osync definition and dsync definition. And it does! The osync definition of `fsync` is called `osync` and it's a system call that guarantees order and eventual durability. The dsync definition of `fsync` is called `dsync` and it's a system call that guaratess immediate durability (blocks). For more details, check the Optimistic Crash Cosnsistency paper linked above.
64
+
### Safety of the Script_Optfs ###
65
+
Optfs needs some improvements in cases of conditionals, as it is possible to compromise program correctness if an `fsync_wrapper` is called inside a conditional. Consider the following case:
66
+
```C
67
+
voidfoo(x) {
68
+
bar1();
69
+
if (x == 0) {
70
+
bar1();
71
+
}
72
+
else {
73
+
bar1();
74
+
}
75
+
}
76
+
```
77
+
This would get converted to:
78
+
```C
79
+
void osync_foo(x) { /* this osync definition is correct */
80
+
osync_bar1();
81
+
if (x == 0) {
82
+
osync_bar1();
83
+
}
84
+
else {
85
+
osync_bar1();
86
+
}
87
+
}
88
+
89
+
void dsync_foo(x) { /* this dsync definition is not correct */
90
+
osync_bar1();
91
+
if (x == 0) {
92
+
osync_bar1();
93
+
}
94
+
else {
95
+
dsync_bar1();
96
+
}
97
+
}
98
+
```
99
+
In this case, our code doesn't work for the case where `x = 0`.
100
+
We have noticed that in most cases libraries tend not to use this kind of code, so it should work well in most cases.
101
+
### Authors ###
102
+
Tom Gong (tom.gong@utexas.edu) and Subrat Mainali (mainali.subrat@utexas.edu)
103
+
Under [Dr. Vijay Chidambram](http://www.cs.utexas.edu/~vijay/), UT Austin.
0 commit comments