Closed bxatnarf closed 5 years ago
I used the merge branch, commit id "13be3cc6108f59487eb1a2fa58f4b3960773e53" for two ARM64 VMs, and run mt
from popcorn-kernel-lib. It is good. I tested two cases: 1) THREADS=32, LOOPS=100. 2) THREADS=2, LOOPS=2.
[ 97.294419] [235] zap ffffc17ad000
popcorn@arm01:~$
popcorn@arm01:~$ uname -a
Linux arm01 4.19.0-rc5-popcorn+ #148 SMP Sun Dec 16 22:36:17 EST 2018 aarch64 GNU/Linux
[ 95.236460] [234] zap ffffa7183000
[ 95.236825] [234] zap ffffa7184000
popcorn@arm02:~$ uname -a
Linux arm02 4.19.0-rc5-popcorn+ #148 SMP Sun Dec 16 22:36:17 EST 2018 aarch64 GNU/Linu
Here is the the mt binary that I'm seeing problems with. I tested with the same kernel version. If this mt binary doesn't trigger the bug then we should compare our linux build configurations
The version of mt that triggers the bug has LOOP=1, THREADS=32
I also added a printf
statement to print out the current loop number, but that shouldn't make a difference.
diff --git a/lib/migrate.c b/lib/migrate.c
index 552ac34..a062900 100644
--- a/lib/migrate.c
+++ b/lib/migrate.c
@@ -10,22 +10,22 @@
#include <string.h>
#ifdef __x86_64__
-#define SYSCALL_POPCORN_MIGRATE 330
-#define SYSCALL_POPCORN_PROPOSE_MIGRATION 331
-#define SYSCALL_POPCORN_GET_THREAD_STATUS 332
-#define SYSCALL_POPCORN_GET_NODE_INFO 333
+#define SYSCALL_POPCORN_MIGRATE 335
+#define SYSCALL_POPCORN_PROPOSE_MIGRATION 336
+#define SYSCALL_POPCORN_GET_THREAD_STATUS 337
+#define SYSCALL_POPCORN_GET_NODE_INFO 338
#define SYSCALL_GETTID 186
#elif __aarch64__
-#define SYSCALL_POPCORN_MIGRATE 285
-#define SYSCALL_POPCORN_PROPOSE_MIGRATION 286
-#define SYSCALL_POPCORN_GET_THREAD_STATUS 287
-#define SYSCALL_POPCORN_GET_NODE_INFO 288
+#define SYSCALL_POPCORN_MIGRATE 294
+#define SYSCALL_POPCORN_PROPOSE_MIGRATION 295
+#define SYSCALL_POPCORN_GET_THREAD_STATUS 296
+#define SYSCALL_POPCORN_GET_NODE_INFO 297
#define SYSCALL_GETTID 178
#elif __powerpc64__
-#define SYSCALL_POPCORN_MIGRATE 379
-#define SYSCALL_POPCORN_PROPOSE_MIGRATION 380
-#define SYSCALL_POPCORN_GET_THREAD_STATUS 381
-#define SYSCALL_POPCORN_GET_NODE_INFO 382
+#define SYSCALL_POPCORN_MIGRATE 389
+#define SYSCALL_POPCORN_PROPOSE_MIGRATION 390
+#define SYSCALL_POPCORN_GET_THREAD_STATUS 391
+#define SYSCALL_POPCORN_GET_NODE_INFO 392
#define SYSCALL_GETTID 207
#else
#error Does not support this architecture
diff --git a/src/mt.c b/src/mt.c
index ca68a85..5e43cb1 100644
--- a/src/mt.c
+++ b/src/mt.c
@@ -7,7 +7,7 @@
#include "migrate.h"
const int THREADS = 32;
-const int LOOPS = 100;
+const int LOOPS = 1;
pthread_barrier_t barrier_start;
pthread_barrier_t barrier_end;
@@ -33,6 +33,7 @@ void *child(void *arg)
int i;
for (i = 0; i < LOOPS; i++) {
+ printf("--------loop %d ---\n", i);
printf("Entering %d %d\n", param->tid, tid);
pthread_barrier_wait(&barrier_start);
printf("Entered %d %d\n", param->tid, tid);
This bug seems to be fixed in https://github.com/ssrg-vt/popcorn-kernel/commit/bf0c818be9a088502956fc058c99a4783156d376 . mt now runs on arm (even with 32 threads and 32 loops)
.bx
A page sever panic happens when the mt example from https://github.com/ssrg-vt/popcorn-kernel-lib is executed on arm64. This is likely related to issue https://github.com/ssrg-vt/popcorn-kernel/issues/61.
The kernel panic occurs when
pthread_join
is called for the final time by the origin process. TheLOOPS
constant can be set to equal 1.The kernel log for the origin kernel looks as follows: