Exclude areas not assigned to Mckernel from direct map of all phys. memory
It's enabled by adding -s to mcreboot.sh. Cherry-pick of the following commit: commit b5c13ce51a5a4926c2cf11c817cd0d369ac4402d Author: Katsuya Horigome <katsuya.horigome.rj@ps.hitachi-solutions.com> Date: Mon Nov 20 09:40:41 2017 +0900 Include measures to prevent memory destruction on Linux side (This is rebase commit for merging to development+hfi)
This commit is contained in:
committed by
Masamichi Takagi
parent
221ce34da2
commit
38c3b2358a
@@ -39,6 +39,8 @@ extern char _head[], _end[];
|
|||||||
|
|
||||||
extern unsigned long x86_kernel_phys_base;
|
extern unsigned long x86_kernel_phys_base;
|
||||||
|
|
||||||
|
int safe_kernel_map = 0;
|
||||||
|
|
||||||
/* Arch specific early allocation routine */
|
/* Arch specific early allocation routine */
|
||||||
void *early_alloc_pages(int nr_pages)
|
void *early_alloc_pages(int nr_pages)
|
||||||
{
|
{
|
||||||
@@ -2545,22 +2547,54 @@ static void init_linux_kernel_mapping(struct page_table *pt)
|
|||||||
{
|
{
|
||||||
unsigned long map_start, map_end, phys;
|
unsigned long map_start, map_end, phys;
|
||||||
void *virt;
|
void *virt;
|
||||||
|
int nr_memory_chunks, chunk_id, numa_id;
|
||||||
|
|
||||||
/* Map 2 TB for now */
|
/* In case of safe_kernel_map option (safe_kernel_map == 1),
|
||||||
map_start = 0;
|
* processing to prevent destruction of the memory area on Linux side
|
||||||
map_end = 0x20000000000;
|
* is executed */
|
||||||
|
if (safe_kernel_map == 0) {
|
||||||
|
kprintf("Straight-map entire physical memory\n");
|
||||||
|
|
||||||
virt = (void *)LINUX_PAGE_OFFSET;
|
/* Map 2 TB for now */
|
||||||
|
map_start = 0;
|
||||||
|
map_end = 0x20000000000;
|
||||||
|
|
||||||
kprintf("Linux kernel virtual: 0x%lx - 0x%lx -> 0x%lx - 0x%lx\n",
|
virt = (void *)LINUX_PAGE_OFFSET;
|
||||||
LINUX_PAGE_OFFSET, LINUX_PAGE_OFFSET + map_end, 0, map_end);
|
|
||||||
|
|
||||||
for (phys = map_start; phys < map_end; phs += LARGE_PAGE_SIZE) {
|
kprintf("Linux kernel virtual: 0x%lx - 0x%lx -> 0x%lx - 0x%lx\n",
|
||||||
if (set_pt_large_page(pt, virt, phys, PTATTR_WRITABLE) != 0) {
|
LINUX_PAGE_OFFSET, LINUX_PAGE_OFFSET + map_end, 0, map_end);
|
||||||
kprintf("%s: error setting mapping for 0x%lx\n",
|
|
||||||
__func__, virt);
|
for (phys = map_start; phys < map_end; phys += LARGE_PAGE_SIZE) {
|
||||||
|
if (set_pt_large_page(pt, virt, phys, PTATTR_WRITABLE) != 0) {
|
||||||
|
kprintf("%s: error setting mapping for 0x%lx\n", __FUNCTION__, virt);
|
||||||
|
}
|
||||||
|
virt += LARGE_PAGE_SIZE;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
kprintf("Straight-map physical memory areas allocated to McKernel\n");
|
||||||
|
|
||||||
|
nr_memory_chunks = ihk_mc_get_nr_memory_chunks();
|
||||||
|
if (nr_memory_chunks == 0) {
|
||||||
|
kprintf("%s: ERROR: No memory chunk available.\n", __FUNCTION__);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (chunk_id = 0; chunk_id < nr_memory_chunks; chunk_id++) {
|
||||||
|
if (ihk_mc_get_memory_chunk(chunk_id, &map_start, &map_end, &numa_id)) {
|
||||||
|
kprintf("%s: ERROR: Memory chunk id (%d) out of range.\n", __FUNCTION__, chunk_id);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
dkprintf("Linux kernel virtual: 0x%lx - 0x%lx -> 0x%lx - 0x%lx\n",
|
||||||
|
LINUX_PAGE_OFFSET + map_start, LINUX_PAGE_OFFSET + map_end, map_start, map_end);
|
||||||
|
|
||||||
|
virt = (void *)(LINUX_PAGE_OFFSET + map_start);
|
||||||
|
for (phys = map_start; phys < map_end; phys += LARGE_PAGE_SIZE, virt += LARGE_PAGE_SIZE) {
|
||||||
|
if (set_pt_large_page(pt, virt, phys, PTATTR_WRITABLE) != 0) {
|
||||||
|
kprintf("%s: set_pt_large_page() failed for 0x%lx\n", __FUNCTION__, virt);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
virt += LARGE_PAGE_SIZE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -45,11 +45,12 @@ fi
|
|||||||
|
|
||||||
turbo=""
|
turbo=""
|
||||||
ihk_irq=""
|
ihk_irq=""
|
||||||
|
safe_kernel_map=""
|
||||||
umask_old=`umask`
|
umask_old=`umask`
|
||||||
idle_halt=""
|
idle_halt=""
|
||||||
allow_oversubscribe=""
|
allow_oversubscribe=""
|
||||||
|
|
||||||
while getopts :tk:c:m:o:f:r:q:i:d:e:hO OPT
|
while getopts :stk:c:m:o:f:r:q:i:d:e:hO OPT
|
||||||
do
|
do
|
||||||
case ${OPT} in
|
case ${OPT} in
|
||||||
f) facility=${OPTARG}
|
f) facility=${OPTARG}
|
||||||
@@ -62,6 +63,8 @@ do
|
|||||||
;;
|
;;
|
||||||
m) mem=${OPTARG}
|
m) mem=${OPTARG}
|
||||||
;;
|
;;
|
||||||
|
s) safe_kernel_map="safe_kernel_map"
|
||||||
|
;;
|
||||||
r) ikc_map=${OPTARG}
|
r) ikc_map=${OPTARG}
|
||||||
;;
|
;;
|
||||||
q) ihk_irq=${OPTARG}
|
q) ihk_irq=${OPTARG}
|
||||||
@@ -446,7 +449,7 @@ if ! ${SBINDIR}/ihkosctl 0 load ${KERNDIR}/mckernel.img; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Set kernel arguments
|
# Set kernel arguments
|
||||||
if ! ${SBINDIR}/ihkosctl 0 kargs "hidos $turbo $idle_halt dump_level=${DUMP_LEVEL} $extra_kopts $allow_oversubscribe"; then
|
if ! ${SBINDIR}/ihkosctl 0 kargs "hidos $turbo $safe_kernel_map $idle_halt dump_level=${DUMP_LEVEL} $extra_kopts $allow_oversubscribe"; then
|
||||||
echo "error: setting kernel arguments" >&2
|
echo "error: setting kernel arguments" >&2
|
||||||
error_exit "os_created"
|
error_exit "os_created"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -123,6 +123,8 @@ char *find_command_line(char *name)
|
|||||||
return strstr(cmdline, name);
|
return strstr(cmdline, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int safe_kernel_map;
|
||||||
|
|
||||||
static void parse_kargs(void)
|
static void parse_kargs(void)
|
||||||
{
|
{
|
||||||
char *ptr;
|
char *ptr;
|
||||||
@@ -143,6 +145,11 @@ static void parse_kargs(void)
|
|||||||
}
|
}
|
||||||
ihk_mc_set_dump_level(dump_level);
|
ihk_mc_set_dump_level(dump_level);
|
||||||
|
|
||||||
|
ptr = find_command_line("safe_kernel_map");
|
||||||
|
if (ptr) {
|
||||||
|
safe_kernel_map = 1;
|
||||||
|
}
|
||||||
|
|
||||||
/* idle_halt option */
|
/* idle_halt option */
|
||||||
ptr = find_command_line("idle_halt");
|
ptr = find_command_line("idle_halt");
|
||||||
if (ptr) {
|
if (ptr) {
|
||||||
|
|||||||
100
test/mem_dest_prev/LTP_testcase.txt
Normal file
100
test/mem_dest_prev/LTP_testcase.txt
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
brk01
|
||||||
|
clone01
|
||||||
|
clone03
|
||||||
|
clone04
|
||||||
|
clone06
|
||||||
|
clone07
|
||||||
|
close01
|
||||||
|
close02
|
||||||
|
dup01
|
||||||
|
dup02
|
||||||
|
dup03
|
||||||
|
dup04
|
||||||
|
dup05
|
||||||
|
dup06
|
||||||
|
dup07
|
||||||
|
fork01
|
||||||
|
fork02
|
||||||
|
fork03
|
||||||
|
fork04
|
||||||
|
fork07
|
||||||
|
fork08
|
||||||
|
fork09
|
||||||
|
fork10
|
||||||
|
fork11
|
||||||
|
mbind01
|
||||||
|
mem01
|
||||||
|
mem02
|
||||||
|
mem03
|
||||||
|
memcpy01
|
||||||
|
memfd_create02
|
||||||
|
memset01
|
||||||
|
mkdir01
|
||||||
|
mkdir08
|
||||||
|
mkdirat01
|
||||||
|
mknodat01
|
||||||
|
mmap001
|
||||||
|
mmap01
|
||||||
|
mmap02
|
||||||
|
mmap03
|
||||||
|
mmap04
|
||||||
|
mmap06
|
||||||
|
mmap07
|
||||||
|
mmap08
|
||||||
|
mmap09
|
||||||
|
mmap12
|
||||||
|
mmapstress02
|
||||||
|
mmapstress04
|
||||||
|
mmapstress05
|
||||||
|
mremap01
|
||||||
|
mremap05
|
||||||
|
open01
|
||||||
|
open03
|
||||||
|
open04
|
||||||
|
open06
|
||||||
|
open07
|
||||||
|
open09
|
||||||
|
open13
|
||||||
|
poll01
|
||||||
|
posix_fadvise01
|
||||||
|
read01
|
||||||
|
read02
|
||||||
|
read03
|
||||||
|
read04
|
||||||
|
sbrk01
|
||||||
|
sbrk02
|
||||||
|
sendfile02
|
||||||
|
sendfile03
|
||||||
|
sendfile04
|
||||||
|
sendfile05
|
||||||
|
sendfile06
|
||||||
|
sendfile07
|
||||||
|
sendfile08
|
||||||
|
sendfile09
|
||||||
|
semctl01
|
||||||
|
semctl03
|
||||||
|
semctl05
|
||||||
|
socket01
|
||||||
|
socket02
|
||||||
|
stream01
|
||||||
|
stream02
|
||||||
|
stream03
|
||||||
|
stream04
|
||||||
|
stream05
|
||||||
|
unlink05
|
||||||
|
unlink06
|
||||||
|
unlink07
|
||||||
|
unlink08
|
||||||
|
vfork01
|
||||||
|
vfork02
|
||||||
|
vma01
|
||||||
|
vmsplice01
|
||||||
|
vmsplice02
|
||||||
|
write01
|
||||||
|
write03
|
||||||
|
write04
|
||||||
|
write05
|
||||||
|
writetest
|
||||||
|
writev01
|
||||||
|
writev02
|
||||||
|
writev07
|
||||||
25
test/mem_dest_prev/README
Normal file
25
test/mem_dest_prev/README
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
===================
|
||||||
|
Advance preparation
|
||||||
|
===================
|
||||||
|
1)Implement patch of test_memtest_destroy.patch
|
||||||
|
cd mckernel
|
||||||
|
patch -p0 < test_memtest_destroy.patch
|
||||||
|
make
|
||||||
|
make install
|
||||||
|
|
||||||
|
|
||||||
|
2)Compile command execution processing
|
||||||
|
cd mckernel/test/mem_dest_prev/mcexec_test_proc/
|
||||||
|
make
|
||||||
|
|
||||||
|
3)Write the LTP path to LTP_DIR in the configuration file
|
||||||
|
vi config
|
||||||
|
|
||||||
|
ex) LTP_DIR=$HOME/test/mem_dest_prev/ltp/testcases/bin/
|
||||||
|
|
||||||
|
|
||||||
|
==========
|
||||||
|
How to run
|
||||||
|
==========
|
||||||
|
./go_test_McKernal.sh
|
||||||
|
|
||||||
13
test/mem_dest_prev/config
Normal file
13
test/mem_dest_prev/config
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
MCMOD_DIR=$HOME/ppos
|
||||||
|
LTP_DIR=$HOME/test/mem_dest_prev/ltp/testcases/bin/
|
||||||
|
LTP_TESTCASE_FILE=LTP_testcase.txt
|
||||||
|
MCRBT_OPT_LTP="-m 3G@0,3G@1 -s"
|
||||||
|
USR_PROC="mcexec_test_proc/memtest_destroy"
|
||||||
|
OS_IDX=0
|
||||||
|
|
||||||
|
export MCMOD_DIR
|
||||||
|
export LTP_DIR
|
||||||
|
export LTP_TESTCASE_FILE
|
||||||
|
export MCRBT_OPT_LTP
|
||||||
|
export USR_PROC
|
||||||
|
export OS_IDX
|
||||||
101
test/mem_dest_prev/go_test_McKernal.sh
Executable file
101
test/mem_dest_prev/go_test_McKernal.sh
Executable file
@@ -0,0 +1,101 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# read config
|
||||||
|
source ./config
|
||||||
|
|
||||||
|
#logfile="./result/test_result.log"
|
||||||
|
|
||||||
|
# mcexec processのkill
|
||||||
|
./utils/kill_mcexec.sh &> /dev/null
|
||||||
|
|
||||||
|
for test_case in `ls -1 ./testcases/*.txt`
|
||||||
|
do
|
||||||
|
# read testcase param
|
||||||
|
source ${test_case}
|
||||||
|
case_name=`basename ${test_case} .txt`
|
||||||
|
echo "####################"
|
||||||
|
echo "Test No:${case_name}"
|
||||||
|
|
||||||
|
# Out-of-range address Test(Before correspondence)
|
||||||
|
echo ">>> Out-of-range address Test(Before correspondence) Start"
|
||||||
|
|
||||||
|
# stop mckernel
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcstop+release.sh
|
||||||
|
sleep 1
|
||||||
|
# boot mckernel
|
||||||
|
echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_BEFORE%,}"
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_BEFORE%,}
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo " ${MCMOD_DIR}/bin/mcexec ${USR_PROC}"
|
||||||
|
timeout -sKILL 5 ${MCMOD_DIR}/bin/mcexec ${USR_PROC}
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
|
echo "${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg"
|
||||||
|
sudo ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg
|
||||||
|
|
||||||
|
if [ "$STATUS" -ne 21 ];
|
||||||
|
then
|
||||||
|
echo ">>> Out-of-range address Test End(Timeout!!!)"
|
||||||
|
else
|
||||||
|
echo ">>> Out-of-range address Test End"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Out-of-range address Test(After correspondence)
|
||||||
|
echo ">>> Out-of-range address(After correspondence) Test Start"
|
||||||
|
|
||||||
|
# stop mckernel
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcstop+release.sh
|
||||||
|
sleep 1
|
||||||
|
# boot mckernel
|
||||||
|
echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_AFTER%,}"
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_AFTER%,}
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
echo " ${MCMOD_DIR}/bin/mcexec ${USR_PROC}"
|
||||||
|
timeout -sKILL 5 ${MCMOD_DIR}/bin/mcexec ${USR_PROC}
|
||||||
|
STATUS=$?
|
||||||
|
|
||||||
|
echo "${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg"
|
||||||
|
sudo ${MCMOD_DIR}/sbin/ihkosctl ${OS_IDX} kmsg
|
||||||
|
|
||||||
|
if [ "$STATUS" -ne 21 ];
|
||||||
|
then
|
||||||
|
echo ">>> Out-of-range address Test End(Timeout!!!)"
|
||||||
|
else
|
||||||
|
echo ">>> Out-of-range address Test End"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
### LTP START ##################################################
|
||||||
|
# stop mckernel
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcstop+release.sh
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
# boot mckernel
|
||||||
|
echo "${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_LTP%,}"
|
||||||
|
sudo ${MCMOD_DIR}/sbin/mcreboot.sh ${MCRBT_OPT_LTP%,}
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
if [ ! -e "/dev/mcos0" ]; then
|
||||||
|
echo "Error: failed to mcreboot"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
TEST_NUM=`wc -l ${LTP_TESTCASE_FILE} | awk '{print $1}'`
|
||||||
|
echo ">>> LTP Test Start( $TEST_NUM counts )"
|
||||||
|
|
||||||
|
# exec mckernel test program
|
||||||
|
COUNT=0
|
||||||
|
while read line
|
||||||
|
do
|
||||||
|
((COUNT++))
|
||||||
|
echo "$COUNT:${MCMOD_DIR}/bin/mcexec ${LTP_DIR}$line"
|
||||||
|
# ${MCMOD_DIR}/bin/mcexec ${LTP_DIR}$line &>> ${logfile}
|
||||||
|
${MCMOD_DIR}/bin/mcexec ${LTP_DIR}$line
|
||||||
|
done < ${LTP_TESTCASE_FILE}
|
||||||
|
|
||||||
|
echo ">>> LTP Test End"
|
||||||
|
### LTP END ####################################################
|
||||||
|
|
||||||
7
test/mem_dest_prev/mcexec_test_proc/Makefile
Normal file
7
test/mem_dest_prev/mcexec_test_proc/Makefile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
OBJS = memtest_destroy
|
||||||
|
|
||||||
|
all:$(OBJS)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm $(OBJS)
|
||||||
|
|
||||||
13
test/mem_dest_prev/mcexec_test_proc/memtest_destroy.c
Normal file
13
test/mem_dest_prev/mcexec_test_proc/memtest_destroy.c
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#define _GNU_SOURCE
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/syscall.h>
|
||||||
|
|
||||||
|
main() {
|
||||||
|
int rst = 0;
|
||||||
|
|
||||||
|
rst = syscall(950);
|
||||||
|
printf("mem_destroy result:%d\n",rst);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
50
test/mem_dest_prev/test_memtest_destroy.patch
Normal file
50
test/mem_dest_prev/test_memtest_destroy.patch
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
diff --git arch/x86/kernel/include/syscall_list.h arch/x86/kernel/include/syscall_list.h
|
||||||
|
index 42d1e2e..f5769b8 100644
|
||||||
|
--- arch/x86/kernel/include/syscall_list.h
|
||||||
|
+++ arch/x86/kernel/include/syscall_list.h
|
||||||
|
@@ -156,5 +156,7 @@ SYSCALL_HANDLED(__NR_profile, profile)
|
||||||
|
SYSCALL_HANDLED(730, util_migrate_inter_kernel)
|
||||||
|
SYSCALL_HANDLED(731, util_indicate_clone)
|
||||||
|
SYSCALL_HANDLED(732, get_system)
|
||||||
|
+/* McKernel Specific */
|
||||||
|
+SYSCALL_HANDLED(950, mem_destroy)
|
||||||
|
|
||||||
|
/**** End of File ****/
|
||||||
|
diff --git arch/x86/kernel/syscall.c arch/x86/kernel/syscall.c
|
||||||
|
index 2260b66..e96776a 100644
|
||||||
|
--- arch/x86/kernel/syscall.c
|
||||||
|
+++ arch/x86/kernel/syscall.c
|
||||||
|
@@ -1887,4 +1887,33 @@ save_uctx(void *uctx, struct x86_user_context *regs)
|
||||||
|
ctx->fregsize = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+
|
||||||
|
+#define ADD_ADDR_VAL 0x400
|
||||||
|
+SYSCALL_DECLARE(mem_destroy)
|
||||||
|
+{
|
||||||
|
+ int rst = 0;
|
||||||
|
+ int mem_chunks_num, chunk_id, get_numa_id;
|
||||||
|
+ unsigned long get_start, get_end;
|
||||||
|
+ unsigned long *addr;
|
||||||
|
+
|
||||||
|
+ mem_chunks_num = ihk_mc_get_nr_memory_chunks();
|
||||||
|
+ kprintf("%s: memory chunk %d.\n", __FUNCTION__, mem_chunks_num);
|
||||||
|
+
|
||||||
|
+ for (chunk_id = 0; chunk_id < mem_chunks_num; chunk_id++) {
|
||||||
|
+ rst = ihk_mc_get_memory_chunk(chunk_id, &get_start, &get_end, &get_numa_id);
|
||||||
|
+ kprintf("%s: mem chunk[%d] numa ID(%d)\n"
|
||||||
|
+ ,__FUNCTION__ ,chunk_id ,get_numa_id);
|
||||||
|
+ kprintf(" phys(0x%lx - 0x%lx) virt(0x%lx - 0x%lx)\n"
|
||||||
|
+ ,get_start ,get_end ,phys_to_virt(get_start) ,phys_to_virt(get_end));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ addr = phys_to_virt(get_end + ADD_ADDR_VAL);
|
||||||
|
+#if 1
|
||||||
|
+ *addr = 0x1;
|
||||||
|
+#endif
|
||||||
|
+ kprintf("%s: Address out of range 0x%lx(val:%d)\n",__FUNCTION__ ,addr ,*addr);
|
||||||
|
+
|
||||||
|
+ return rst;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/*** End of File ***/
|
||||||
2
test/mem_dest_prev/testcases/0001.txt
Normal file
2
test/mem_dest_prev/testcases/0001.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 3G 1`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 3G 1` -s"
|
||||||
2
test/mem_dest_prev/testcases/0002.txt
Normal file
2
test/mem_dest_prev/testcases/0002.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 2`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 2` -s"
|
||||||
2
test/mem_dest_prev/testcases/0003.txt
Normal file
2
test/mem_dest_prev/testcases/0003.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 4`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 4` -s"
|
||||||
2
test/mem_dest_prev/testcases/0004.txt
Normal file
2
test/mem_dest_prev/testcases/0004.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 8`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 8` -s"
|
||||||
2
test/mem_dest_prev/testcases/0005.txt
Normal file
2
test/mem_dest_prev/testcases/0005.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 16` -s"
|
||||||
2
test/mem_dest_prev/testcases/0006.txt
Normal file
2
test/mem_dest_prev/testcases/0006.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 32`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 32` -s"
|
||||||
2
test/mem_dest_prev/testcases/0007.txt
Normal file
2
test/mem_dest_prev/testcases/0007.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 48`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 48` -s"
|
||||||
2
test/mem_dest_prev/testcases/0008.txt
Normal file
2
test/mem_dest_prev/testcases/0008.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 64`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 64` -s"
|
||||||
2
test/mem_dest_prev/testcases/0009.txt
Normal file
2
test/mem_dest_prev/testcases/0009.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 96`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 96` -s"
|
||||||
2
test/mem_dest_prev/testcases/0010.txt
Normal file
2
test/mem_dest_prev/testcases/0010.txt
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
MCRBT_OPT_BEFORE="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128`"
|
||||||
|
MCRBT_OPT_AFTER="-m `./utils/gen_mem_chunks.sh "0 1" 32M 128` -s"
|
||||||
16
test/mem_dest_prev/utils/gen_mem_chunks.sh
Executable file
16
test/mem_dest_prev/utils/gen_mem_chunks.sh
Executable file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
NUMAS=$1
|
||||||
|
MEM_SIZE=$2
|
||||||
|
REP=$3
|
||||||
|
CHUNKS=""
|
||||||
|
|
||||||
|
for numa in ${NUMAS}
|
||||||
|
do
|
||||||
|
for rep in `seq 1 ${REP}`
|
||||||
|
do
|
||||||
|
CHUNKS="${CHUNKS}${MEM_SIZE}@${numa},"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
echo ${CHUNKS%,}
|
||||||
10
test/mem_dest_prev/utils/kill_mcexec.sh
Executable file
10
test/mem_dest_prev/utils/kill_mcexec.sh
Executable file
@@ -0,0 +1,10 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
count=`pgrep -c -f 'mcexec '`
|
||||||
|
if [ ${count} -gt 0 ]
|
||||||
|
then
|
||||||
|
echo "kill process :" ${count}
|
||||||
|
pgrep -l -f 'mcexec '
|
||||||
|
pgrep -f 'mcexec ' | xargs kill -9
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user