ssrg-vt / popcorn-kernel

Popcorn Linux kernel for distributed thread execution
Other
156 stars 22 forks source link

Popcorn-kernel test cases #67

Open xjtuwxg opened 5 years ago

xjtuwxg commented 5 years ago

Collect a set of test applications for popcorn. It would be useful for popcorn upgrade and future dev. Use this issue to track the collected applications. -------------Updated-------------- For x86 vanilla popcorn: popcorn-kernel-lib:

  1. basic
  2. stack
  3. pingpong (Preparation on two nodes: echo 0 > /tmp/ping, echo 1 > /tmp/ping on two nodes)
  4. mt
  5. kmeans (./kmeans -c 10 -n 2 -t 1 -p 5000)

For arm64 vanilla popcorn: popcorn-kernel-lib:

  1. basic
  2. stack
  3. pingpong (Preparation on two nodes: echo 0 > /tmp/ping, echo 1 > /tmp/ping on two nodes)
  4. mt
  5. kmeans (./kmeans -c 10 -n 2 -t 1 -p 5000)

The top-of-tree x86 popcorn Linux: popcorn-kernel-lib:

  1. basic
  2. stack
  3. pingpong (Preparation on two nodes: echo 0 > /tmp/ping, echo 1 > /tmp/ping on two nodes)
  4. mt (Sometimes failed) If we run ./basic ./stack ./rw before running ./mt, it is easier to repreduce:
    [  476.460016] EXITED [4108] remote / 0x40
    [  476.461057] EXITED [4103] remote / 0x40
    [  476.612097] WARNING: CPU: 0 PID: 906 at fs/ext4/inode.c:3896 ext4_set_page_dirty+0x3e/0x50
    [  476.614877] Modules linked in: msg_socket
    [  476.616010] CPU: 0 PID: 906 Comm: mt Tainted: G      D           4.19.0-rc5-popcorn+ #151
    [  476.616010] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014
    [  476.616010] RIP: 0010:ext4_set_page_dirty+0x3e/0x50
    [  476.616010] Code: 48 8b 00 a8 01 75 16 48 8b 57 08 48 8d 42 ff 83 e2 01 48 0f 44 c7 48 8b 00 a8 10 74 0d 48 8b 07 f6 c4 10 74 0f e9 12 8c fa ff <0f> 0b 48 8b 07 f6 c4 10 75 f1 0f 0b e9 01 8c fa ff 90 0f 1f 44 00
    [  476.616010] RSP: 0018:ffffc90000103be0 EFLAGS: 00010246
    [  476.616010] RAX: 800000000000106c RBX: 00007fa41f41e000 RCX: 0000000000000000
    [  476.616010] RDX: 0000000000000000 RSI: fff0000000000fff RDI: ffffea00044011c0
    [  476.616010] RBP: 00007fa41f41f000 R08: 0000000000000001 R09: 0000000000000000
    [  476.616010] R10: 0000000000000000 R11: 0000000000000040 R12: ffffea00044011c0
    [  476.616010] R13: 00007fa41f41f000 R14: ffff8801394140f0 R15: ffffc90000103d10
    [  476.616010] FS:  0000000000000000(0000) GS:ffff88013fc00000(0000) knlGS:0000000000000000
    [  476.616010] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [  476.616010] CR2: 00007f1af7422000 CR3: 000000013acf4000 CR4: 00000000000406f0
    [  476.616010] Call Trace:
    [  476.616010]  unmap_page_range+0x6de/0x7e0
    [  476.616010]  ? __switch_to_asm+0x34/0x70
    [  476.616010]  unmap_vmas+0x32/0x50
    [  476.616010]  unmap_region+0xae/0x120
    [  476.616010]  ? lock_timer_base+0x74/0x90
    [  476.616010]  ? try_to_del_timer_sync+0x4d/0x80
    [  476.616010]  ? __vma_rb_erase+0x11a/0x230
    [  476.616010]  do_munmap+0x25a/0x3c0
    [  476.616010]  vm_munmap+0x75/0xc0
    [  476.616010]  process_vma_op_request+0x24e/0x2e0
    [  476.616010]  remote_worker_main+0x480/0x510
    [  476.616010]  kthread+0xf8/0x130
    [  476.616010]  ? handle_clone_request+0x70/0x70
    [  476.616010]  ? kthread_park+0x90/0x90
    [  476.616010]  ret_from_fork+0x35/0x40
    [  476.616010] ---[ end trace 9bcf544c4910c38f ]---
    [  476.616020] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
  5. kmeans (./kmeans -c 10 -n 2 -t 1 -p 5000)

The top-of-tree arm64 popcorn Linux:

71 #72 #69

bxatnarf commented 5 years ago

We should try to get the tests to cover entire popcorn protocol, which may mean sharing threads between three different machines and ensuring the pages are fetched from the correct machines. It would be useful to first enumerate all possible protocol states.

bxatnarf commented 5 years ago

Article on linux kernel testing philosophy: https://www.linuxjournal.com/content/linux-kernel-testing-and-debugging Possibly related: http://linux-test-project.github.io/

Linux test scripts can be found in https://github.com/ssrg-vt/popcorn-kernel/tree/master/tools/testing/selftests Here are the virtual memory tests they created: https://github.com/ssrg-vt/popcorn-kernel/tree/master/tools/testing/selftests/vm

bxatnarf commented 5 years ago

In particular, we may want to take a look at https://github.com/ssrg-vt/popcorn-kernel/blob/master/tools/testing/selftests/vm/userfaultfd.c