Skip to content

Multi-V-VM/MVVM

Repository files navigation

Migratable Velocity Virtual Machine

MacOSMacOSUbuntuGenerate page

arch

Just run

wamrc --opt-level=3 --threshold-bits=16 --disable-aux-stack-check --enable-counter-loop-checkpoint -o bc.aot bench/bc.aot
./MVVM_checkpoint -t bench/bc.aot -a -g20,-n1000
./MVVM_restore -t bench/bc.aot

Policy for wamrc

  1. counter loop checkpoint --enable-counter-loop-checkpoint
  2. loop threshold for 1 << x per checkpoint
  3. loop checkpoint --enable-loop-checkpoint, meaning without the counter to checkpoint
  4. loop dirty checkpoint --enable-loop-dirty-checkpoint, meaning use the dirty bit to checkpoint
  5. --enable-checkpoint, enable function level checkpoint

To debug mode checkpoint and migrate a WAMR nano process

First comment out the following in checkpoint.cpp

wamr->get_int3_addr();
wamr->replace_int3_with_nop();
wamr->replace_mfence_with_nop();

Then

python3 ../artifact/common_util.py # return $recv is 193
SPDLOG_LEVEL=debug ./MVVM_checkpoint -t test/tcp_client.aot -f 193 -c 0 -x 10 -a "10" -e OMP_NUM_THREADS=1 -i
SPDLOG_LEVEL=debug ./MVVM_restore -t test/tcp_client.aot # All the wasi env will be restored
  1. -t Target: The path to the WASM interpreter or AOT executable
  2. -i Debug Mode: Switch on for debugging
  3. -f Function: The function to stop and checkpoint
  4. -x Function Counter: The WASM function counter to stop and checkpoint
  5. -c Counter: The WASM instruction counter to stop and checkpoint(Conflict with -f and -x)
  6. -a Arguments: The arguments to the function
  7. -e Environment: The environment variables to the function
image

Design Doc

  1. All the pointers will be stored as offset to the linear memory.
  2. Go forward and never go back, all the calling into WASI land will row back to the call on recovery.
  3. Use AOT compiler convention with a stable point to achieve cross-platform.

Performance

image image

Usecase

  1. Cloud Edge integration
  2. Optimistic Computing
  3. FAASM Warm start
image