On Tue, Apr 21, 2015 at 2:30 PM, wrote: > Does this mean, that Plan9 by default supposes that A=B if hash(A)=hash(B)? > Yes. > That this was not the default before, but it is now? > Yes. > That I still have the possibility of a "full check" of A=B (and not > supposing > it after checking hash(A)=hash(B)) by changing "int verifywrites = 1;" in > "lump.c"? > Yes. > I just want to know why the > default was changed, I believe I changed it, because I was working on performance, and reading data from disk to run a memcmp whose answer is already known is an obvious operation to cut to make a disk-bound server faster. Since you (quite reasonably) don't want to reopen the debate over whether that's a reasonable optimization, I won't justify it further. My paper with Sean Rhea and Alex Pesterev documents the performance effect of double-checking the equality in some detail. https://www.usenix.org/legacy/event/usenix08/tech/full_papers/rhea/rhea.pdf. (Caveat: in the usual academic tradition, the paper uses "Venti" to mean the system described in the original paper, not the system in Plan 9 today. The current Plan 9 implementation is much closer to what the paper calls "Foundation: Compare by Hash".) > why originaly A=B was checked even if one was sure > that the probability of error by only checking hash(A)=hash(B) is > negligible, why the possibility of changing this default exists. > I didn't write the original code, so I can't answer that definitively. That said, it seems to me quite reasonable to check A=B in the initial version of a server, since you might have bugs in your implementation such that (for example) hash(x) = 0 for all x. Once the system is more stable it also seems to me reasonable to remove those checks if they incur significant cost, much as one turns off costly asserts or other debugging code. Hope this helps. Russ