kdlucas / byte-unixbench

Automatically exported from code.google.com/p/byte-unixbench
GNU General Public License v2.0
1.27k stars 323 forks source link

Abnormally high score appears randomly in parallel fstime test while running large amount of benchmark copies with HDDs #103

Open Zengkai163 opened 2 days ago

Zengkai163 commented 2 days ago

Hi Glenn Strauss, We found some abnormally high scores that appeared randomly in parallel fstime tests while executing large amount of copies(for example, more than two hundred) of the benchmark with hard disk drives. abnormally high score: abnormally high score normal score: normal score After some debugging, I found that the dual sync operations in function c_test() would cause some fstime processes block waiting for a global rwsem lock for a long time(maybe larger than 120s), with the commit 81e9de5 ("fstime.c - Seperate r/w files for each parallel (#85)")" merged. ` /*

COUNT0: 1495245 COUNT1: 0 COUNT2: KBps TIME: 30.0 elapsed: 217.923324 // another fstime process lasts for 217s pid: 32804 status: 0

COUNT0: 1746359 COUNT1: 0 COUNT2: KBps TIME: 30.0 elapsed: 212.533035 pid: 32807 status: 0 ...... ` As a result, some fstime processes which have finished the dual sync operations will enter the file copy phase earlier than others that are still block waiting, so the actual amount of parallel file copy processes may be less than the number specified by the '-c' parameter in some early stages during the test, which is not the expected behavior for the test purpose, AFAICS. The less amount of the parallel file copy processes running, the less pressure to the memory bandwidth, so the score of each fstime process will grow under less memory bandwidth contention, all the fstime processes will still finish the test finally, but the total benchmark run time gets longer as shown in the "abnormally high score" figure, so the total score will be higher than the normal case.

Can we just call fsync to synchronize changes to the r/w files instead of doing the system-wide sync to avoid this issue?

Thanks!