private void flushImpl() throws IOException {
    //flush is logically a read-op, hence only readLock is needed. But we also need to update
    // a modified region, which is write-op. By holding readLock (above) we already ensured
    // nobody _modifies_ page concurrently with us. The only possible contender is another .flush()
    // call -- hence we use 'this' lock to avoid concurrent flushes.

    //'this' lock is mostly uncontended: other than here, it guards .regionModified() --
    // which is invoked only under pageLock.writeLock, so 'this' never contended there.
    // Here it _could_ be contended, but only against concurrent .flush() invocations,
    // which are possible, but rare. This is why I use lock instead of update modifiedRegion
    // with CAS: uncontended lock is cheap and simpler to use, and I need some lock to prevent
    // concurrent .flush() anyway.
    synchronized (this) {
      final long modifiedRegion = modifiedRegionPacked;
      if (modifiedRegion == EMPTY_MODIFIED_REGION) {
        //competing flush: somebody else already did the job
        return;
      }
      final int minOffsetModified = unpackMinOffsetModified(modifiedRegion);
      final int maxOffsetModifiedExclusive = unpackMaxOffsetModifiedExclusive(modifiedRegion);

      //we won the CAS competition: execute the flush
      final ByteBuffer sliceToSave = data.duplicate()
        .order(data.order());
      sliceToSave.position(minOffsetModified)
        .limit(maxOffsetModifiedExclusive);

      storageHandle.flushBytes(sliceToSave, offsetInFile() + minOffsetModified);
      storageHandle.pageBecomeClean();
      modifiedRegionPacked = EMPTY_MODIFIED_REGION;
    }
  }
private void flushImpl()