Suppose I memory map a 100G file and I have a single process which is constantly changing the values everywhere (e.g., a banking app with 1B accounts doing 1M DB/CR per second randomly over 100G of RAM).

If I do a snapshot on the volume that the file is in, is it done atomically so that all pages of the file are frozen in my app at a specific point in time? or does it take the snap incrementally over pages in my file so that some pages of my file might be snapshotted at a slightly different time (within a msec)?

I'm guessing that all files in a volume are atomically snapshotted at a single moment in time and that I have to wait for snapshot to return (a few msec) until I can be sure it is done and i can continue. So I should stop processing, snap and wait for snap to return, then start processing again so I know exactly what my state was when the snap is taken (since I don't want to take in the middle of a DB/CR txn since that would be an inconsistent state... i always want to snap after a known transaction completed).

Is there a way to avoid the 3 msec wait time for the snap to complete or that's the best you can do? I'm guessing i have to wait and i should just call it synchronously from within my app at the time everything is consistent.

And presumably doing fsync or sync before a snap makes no difference whatsoever as far as what snap is produced.