Skip to content

Commit ef7aebe

Browse files
authored
Merge pull request #3 from utsaslab/description2
Description2
2 parents 90688e2 + 3e12988 commit ef7aebe

File tree

1 file changed

+79
-1
lines changed

1 file changed

+79
-1
lines changed

README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,82 @@ That's it!
2222
Download the` OptFS VM`: [Link to VM](http://pages.cs.wisc.edu/~vijayc/optfs-vm.tar.gz).
2323
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.
2424

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+
void foo() {
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+
void osync_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+
void foo() {
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+
void dsync_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+
void foo(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

Comments
 (0)