aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2015-01-21 20:09:58 -0800
committerFengguang Wu <fengguang.wu@intel.com>2015-01-21 20:09:58 -0800
commit124eb93a07aa6996c9407d177e9b9a3f6d7f782c (patch)
tree90e27bba97fae6358341338495fc08d2ee52e021
parent6fe4abe9281925b2bfb14d670a5e961553eb9ee6 (diff)
downloadvm-scalability-124eb93a07aa6996c9407d177e9b9a3f6d7f782c.tar.gz
Add support to specify processes/threads via nr_task
Do that via the command line as below: sed -i s/nr_cpu/nr_task/g [^h]* Then modify hw_vars manually. Signed-off-by: Huang, Ying <ying.huang@intel.com>
-rwxr-xr-xcase-anon-cow-rand2
-rwxr-xr-xcase-anon-cow-rand-mt2
-rwxr-xr-xcase-anon-cow-seq2
-rwxr-xr-xcase-anon-cow-seq-mt2
-rwxr-xr-xcase-anon-r-rand2
-rwxr-xr-xcase-anon-r-rand-mt2
-rwxr-xr-xcase-anon-r-seq4
-rwxr-xr-xcase-anon-r-seq-mt2
-rwxr-xr-xcase-anon-rx-rand-mt2
-rwxr-xr-xcase-anon-rx-seq-mt2
-rwxr-xr-xcase-anon-w-rand2
-rwxr-xr-xcase-anon-w-rand-mt2
-rwxr-xr-xcase-anon-w-seq2
-rwxr-xr-xcase-anon-w-seq-mt2
-rwxr-xr-xcase-anon-wx-rand-mt2
-rwxr-xr-xcase-anon-wx-seq-mt2
-rwxr-xr-xcase-direct-write4
-rwxr-xr-xcase-ksm-hugepages4
-rwxr-xr-xcase-lru-file-mmap-read8
-rwxr-xr-xcase-lru-file-mmap-read-rand8
-rwxr-xr-xcase-lru-file-readonce6
-rwxr-xr-xcase-lru-file-readtwice6
-rwxr-xr-xcase-lru-shm6
-rwxr-xr-xcase-lru-shm-rand6
-rwxr-xr-xcase-mbind4
-rwxr-xr-xcase-migrate-across-nodes2
-rwxr-xr-xcase-mincore6
-rwxr-xr-xcase-mincore-hugepages4
-rwxr-xr-xcase-mlock2
-rwxr-xr-xcase-mmap-pread-rand4
-rwxr-xr-xcase-mmap-pread-rand-mt4
-rwxr-xr-xcase-mmap-pread-seq2
-rwxr-xr-xcase-mmap-pread-seq-mt2
-rwxr-xr-xcase-mmap-xread-rand-mt4
-rwxr-xr-xcase-mmap-xread-seq-mt2
-rwxr-xr-xcase-mremap-xread-rand-mt6
-rwxr-xr-xcase-msync4
-rwxr-xr-xcase-msync-mt4
-rwxr-xr-xcase-posix-fadvise4
-rwxr-xr-xcase-remap6
-rwxr-xr-xcase-shm-lock-unlock4
-rwxr-xr-xcase-shm-pread-rand2
-rwxr-xr-xcase-shm-pread-rand-mt2
-rwxr-xr-xcase-shm-pread-seq2
-rwxr-xr-xcase-shm-pread-seq-mt2
-rwxr-xr-xcase-shm-xread-rand2
-rwxr-xr-xcase-shm-xread-rand-mt2
-rwxr-xr-xcase-shm-xread-seq2
-rwxr-xr-xcase-shm-xread-seq-mt2
-rwxr-xr-xcase-small-allocs2
-rwxr-xr-xcase-small-allocs-mt2
-rwxr-xr-xcase-truncate8
-rwxr-xr-xhw_vars2
-rwxr-xr-xrun2
54 files changed, 90 insertions, 88 deletions
diff --git a/case-anon-cow-rand b/case-anon-cow-rand
index 5404207..de35b06 100755
--- a/case-anon-cow-rand
+++ b/case-anon-cow-rand
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu --prealloc --prefault --random $((mem / nr_cpu / 2))
+$USEMEM -n $nr_task --prealloc --prefault --random $((mem / nr_task / 2))
diff --git a/case-anon-cow-rand-mt b/case-anon-cow-rand-mt
index bb8ede1..caeb488 100755
--- a/case-anon-cow-rand-mt
+++ b/case-anon-cow-rand-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc --prefault --random $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task --prealloc --prefault --random $((mem / nr_task / 2))
diff --git a/case-anon-cow-seq b/case-anon-cow-seq
index 8349948..b687c79 100755
--- a/case-anon-cow-seq
+++ b/case-anon-cow-seq
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu --prealloc --prefault $((mem / nr_cpu / 2))
+$USEMEM -n $nr_task --prealloc --prefault $((mem / nr_task / 2))
diff --git a/case-anon-cow-seq-mt b/case-anon-cow-seq-mt
index 77ddb40..fc01235 100755
--- a/case-anon-cow-seq-mt
+++ b/case-anon-cow-seq-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc --prefault $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task --prealloc --prefault $((mem / nr_task / 2))
diff --git a/case-anon-r-rand b/case-anon-r-rand
index 7375013..f829738 100755
--- a/case-anon-r-rand
+++ b/case-anon-r-rand
@@ -5,4 +5,4 @@
# prevent OOM: limit pagetable pages to half memory
[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 ))
-$USEMEM -n $nr_cpu --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -n $nr_task --readonly --random $((ROTATE_BYTES / nr_task))
diff --git a/case-anon-r-rand-mt b/case-anon-r-rand-mt
index e005014..0838756 100755
--- a/case-anon-r-rand-mt
+++ b/case-anon-r-rand-mt
@@ -5,4 +5,4 @@
# prevent OOM: limit pagetable pages to half memory
[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 ))
-$USEMEM -t $nr_cpu --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -t $nr_task --readonly --random $((ROTATE_BYTES / nr_task))
diff --git a/case-anon-r-seq b/case-anon-r-seq
index 9e8cbca..1f16f8c 100755
--- a/case-anon-r-seq
+++ b/case-anon-r-seq
@@ -2,7 +2,7 @@
. ./hw_vars
-size=$((PTE_LIMIT / nr_cpu))
+size=$((PTE_LIMIT / nr_task))
[ "$size" -gt "$AS_LIMIT" ] && size=$AS_LIMIT
-$USEMEM -n $nr_cpu --readonly $size
+$USEMEM -n $nr_task --readonly $size
diff --git a/case-anon-r-seq-mt b/case-anon-r-seq-mt
index 2a77aca..a028381 100755
--- a/case-anon-r-seq-mt
+++ b/case-anon-r-seq-mt
@@ -4,4 +4,4 @@
[ "$PTE_LIMIT" -gt "$AS_LIMIT" ] && PTE_LIMIT=$AS_LIMIT
-$USEMEM -t $nr_cpu --readonly $((PTE_LIMIT / nr_cpu))
+$USEMEM -t $nr_task --readonly $((PTE_LIMIT / nr_task))
diff --git a/case-anon-rx-rand-mt b/case-anon-rx-rand-mt
index a01f04b..f5694d9 100755
--- a/case-anon-rx-rand-mt
+++ b/case-anon-rx-rand-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -t $nr_task --prealloc --readonly --random $((ROTATE_BYTES / nr_task))
diff --git a/case-anon-rx-seq-mt b/case-anon-rx-seq-mt
index f8f16bf..55c7ff3 100755
--- a/case-anon-rx-seq-mt
+++ b/case-anon-rx-seq-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc --readonly $((ROTATE_BYTES))
+$USEMEM -t $nr_task --prealloc --readonly $((ROTATE_BYTES))
diff --git a/case-anon-w-rand b/case-anon-w-rand
index 21bf035..55485d3 100755
--- a/case-anon-w-rand
+++ b/case-anon-w-rand
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu --random $((mem / nr_cpu / 2))
+$USEMEM -n $nr_task --random $((mem / nr_task / 2))
diff --git a/case-anon-w-rand-mt b/case-anon-w-rand-mt
index d2ac120..dfdb0a0 100755
--- a/case-anon-w-rand-mt
+++ b/case-anon-w-rand-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --random $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task --random $((mem / nr_task / 2))
diff --git a/case-anon-w-seq b/case-anon-w-seq
index dc43298..bdf307a 100755
--- a/case-anon-w-seq
+++ b/case-anon-w-seq
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu $((mem / nr_cpu / 2))
+$USEMEM -n $nr_task $((mem / nr_task / 2))
diff --git a/case-anon-w-seq-mt b/case-anon-w-seq-mt
index d05e8b7..f8c434f 100755
--- a/case-anon-w-seq-mt
+++ b/case-anon-w-seq-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task $((mem / nr_task / 2))
diff --git a/case-anon-wx-rand-mt b/case-anon-wx-rand-mt
index 70939c2..76171b6 100755
--- a/case-anon-wx-rand-mt
+++ b/case-anon-wx-rand-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc --random $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task --prealloc --random $((mem / nr_task / 2))
diff --git a/case-anon-wx-seq-mt b/case-anon-wx-seq-mt
index 23aa9ae..1a9cea9 100755
--- a/case-anon-wx-seq-mt
+++ b/case-anon-wx-seq-mt
@@ -2,4 +2,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --prealloc $((mem / nr_cpu / 2))
+$USEMEM -t $nr_task --prealloc $((mem / nr_task / 2))
diff --git a/case-direct-write b/case-direct-write
index e66d332..0963283 100755
--- a/case-direct-write
+++ b/case-direct-write
@@ -8,10 +8,10 @@
USEMEM_DIRECT_WRITE=./usemem_direct_write
-SIZE=$((mem / nr_cpu ))
+SIZE=$((mem / nr_task ))
-for i in $(seq $nr_cpu)
+for i in $(seq $nr_task)
do
create_sparse_file $SPARSE_FILE-$i $SIZE
$USEMEM_DIRECT_WRITE $SPARSE_FILE-$i $SIZE &
diff --git a/case-ksm-hugepages b/case-ksm-hugepages
index 5fc8153..601c187 100755
--- a/case-ksm-hugepages
+++ b/case-ksm-hugepages
@@ -16,9 +16,9 @@ echo 0 > /sys/kernel/mm/transparent_hugepage/khugepaged/scan_sleep_millisecs
USEMEM_KSM_HUGEPAGES=./usemem_ksm_hugepages
# run as many instances as there are number of cpus
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
-$USEMEM_KSM_HUGEPAGES $((mem / nr_cpu / 2)) &
+$USEMEM_KSM_HUGEPAGES $((mem / nr_task / 2)) &
done
wait
diff --git a/case-lru-file-mmap-read b/case-lru-file-mmap-read
index af6f2c8..c8d07b4 100755
--- a/case-lru-file-mmap-read
+++ b/case-lru-file-mmap-read
@@ -8,12 +8,12 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
- $USEMEM -f $SPARSE_FILE-$i --readonly $((ROTATE_BYTES / nr_cpu)) &
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
+ $USEMEM -f $SPARSE_FILE-$i --readonly $((ROTATE_BYTES / nr_task)) &
done
wait
-rm `seq -f $SPARSE_FILE-%g 1 $nr_cpu`
+rm `seq -f $SPARSE_FILE-%g 1 $nr_task`
diff --git a/case-lru-file-mmap-read-rand b/case-lru-file-mmap-read-rand
index 2539280..c19b3fc 100755
--- a/case-lru-file-mmap-read-rand
+++ b/case-lru-file-mmap-read-rand
@@ -8,12 +8,12 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
- $USEMEM -f $SPARSE_FILE-$i --readonly --random $((ROTATE_BYTES / nr_cpu)) &
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
+ $USEMEM -f $SPARSE_FILE-$i --readonly --random $((ROTATE_BYTES / nr_task)) &
done
wait
-rm `seq -f $SPARSE_FILE-%g 1 $nr_cpu`
+rm `seq -f $SPARSE_FILE-%g 1 $nr_task`
diff --git a/case-lru-file-readonce b/case-lru-file-readonce
index 09038d9..8fa3e92 100755
--- a/case-lru-file-readonce
+++ b/case-lru-file-readonce
@@ -8,9 +8,9 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
timeout --foreground -s INT ${runtime:-600} dd bs=4k if=$SPARSE_FILE-$i of=/dev/null > $TMPFS_MNT/dd-output-$i 2>&1 &
done
@@ -26,4 +26,4 @@ do
rm $file
done
-rm `seq -f $SPARSE_FILE-%g 1 $nr_cpu`
+rm `seq -f $SPARSE_FILE-%g 1 $nr_task`
diff --git a/case-lru-file-readtwice b/case-lru-file-readtwice
index 53254c2..85533b2 100755
--- a/case-lru-file-readtwice
+++ b/case-lru-file-readtwice
@@ -15,9 +15,9 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
timeout --foreground -s INT ${runtime:-600} dd bs=4k if=$SPARSE_FILE-$i of=/dev/null > $TMPFS_MNT/dd-output-1-$i 2>&1 &
timeout --foreground -s INT ${runtime:-600} dd bs=4k if=$SPARSE_FILE-$i of=/dev/null > $TMPFS_MNT/dd-output-2-$i 2>&1 &
done
@@ -34,4 +34,4 @@ do
rm $file
done
-rm `seq -f $SPARSE_FILE-%g 1 $nr_cpu`
+rm `seq -f $SPARSE_FILE-%g 1 $nr_task`
diff --git a/case-lru-shm b/case-lru-shm
index e64f755..b93ff3c 100755
--- a/case-lru-shm
+++ b/case-lru-shm
@@ -12,12 +12,12 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
create_sparse_file $SHM_FILE-$i $shm_size
- $USEMEM -f $SHM_FILE-$i --readonly $((shm_size / nr_cpu / 2)) &
+ $USEMEM -f $SHM_FILE-$i --readonly $((shm_size / nr_task / 2)) &
done
wait
-rm `seq -f $SHM_FILE-%g 1 $nr_cpu`
+rm `seq -f $SHM_FILE-%g 1 $nr_task`
diff --git a/case-lru-shm-rand b/case-lru-shm-rand
index 28799d9..c9c261a 100755
--- a/case-lru-shm-rand
+++ b/case-lru-shm-rand
@@ -8,12 +8,12 @@
. ./hw_vars
-for i in `seq 1 $nr_cpu`
+for i in `seq 1 $nr_task`
do
create_sparse_file $SHM_FILE-$i $shm_size
- $USEMEM -f $SHM_FILE-$i --readonly --random $((shm_size / nr_cpu / 2)) &
+ $USEMEM -f $SHM_FILE-$i --readonly --random $((shm_size / nr_task / 2)) &
done
wait
-rm `seq -f $SHM_FILE-%g 1 $nr_cpu`
+rm `seq -f $SHM_FILE-%g 1 $nr_task`
diff --git a/case-mbind b/case-mbind
index e0f9188..d67f565 100755
--- a/case-mbind
+++ b/case-mbind
@@ -6,10 +6,10 @@
USEMEM_MBIND=./usemem_mbind
# Allocate pages to scale with available free memory
-PAGES=$((MemFree / nr_cpu / 20))
+PAGES=$((MemFree / nr_task / 20))
# run it for each cpu in system
-for i in $(seq $nr_cpu)
+for i in $(seq $nr_task)
do
$USEMEM_MBIND $PAGES &
done
diff --git a/case-migrate-across-nodes b/case-migrate-across-nodes
index 1de992a..f6ee724 100755
--- a/case-migrate-across-nodes
+++ b/case-migrate-across-nodes
@@ -7,7 +7,7 @@
USEMEM_MIGRATE=./usemem_migrate
# Allocate pages to scale with available free memory
-PAGES=$((MemFree / nr_cpu / 10))
+PAGES=$((MemFree / nr_task / 10))
# set the ksm on
echo 1 > /sys/kernel/mm/ksm/run
diff --git a/case-mincore b/case-mincore
index 7303040..913a213 100755
--- a/case-mincore
+++ b/case-mincore
@@ -9,7 +9,7 @@
MAX_SHARE_SEGMENT=$(cat /proc/sys/kernel/shmmax)
#segment size being requested
-SHM_SIZE=$((mem / nr_cpu))
+SHM_SIZE=$((mem / nr_task))
#echo "shared segment size being requested $SHM_SIZE"
#echo "Max shared segment allocatable is set to $MAX_SHARE_SEGMENT"
@@ -22,10 +22,10 @@ then
exit 1 #exit on failure
fi
-for i in `seq nr_cpu`
+for i in `seq nr_task`
do
create_sparse_file $SPARSE_FILE-$i $SHM_SIZE
- $USEMEM -t $nr_cpu -f $SPARSE_FILE -N --prealloc --readonly --random $SHM_SIZE &
+ $USEMEM -t $nr_task -f $SPARSE_FILE -N --prealloc --readonly --random $SHM_SIZE &
done
wait
diff --git a/case-mincore-hugepages b/case-mincore-hugepages
index 62d7e86..c51fb0c 100755
--- a/case-mincore-hugepages
+++ b/case-mincore-hugepages
@@ -15,7 +15,7 @@ echo $((mem/Hugepagesize/1024 / 10)) > /proc/sys/vm/nr_overcommit_hugepages
MAX_HUGEPAGES=$(( $(cat /proc/sys/vm/nr_hugepages) + $(cat /proc/sys/vm/nr_overcommit_hugepages) ))
#segment size being requested
-SHM_SIZE=$(($MAX_HUGEPAGES*$hugepagesize / nr_cpu))
+SHM_SIZE=$(($MAX_HUGEPAGES*$hugepagesize / nr_task))
#set shmmax to accommodate the request
echo $SHM_SIZE > /proc/sys/kernel/shmmax
@@ -31,7 +31,7 @@ fi
create_sparse_file $SPARSE_FILE $SHM_SIZE
-$USEMEM -t $nr_cpu -f $SPARSE_FILE -H --prealloc --readonly --random $SHM_SIZE
+$USEMEM -t $nr_task -f $SPARSE_FILE -H --prealloc --readonly --random $SHM_SIZE
echo always > /sys/kernel/mm/transparent_hugepage/enabled
diff --git a/case-mlock b/case-mlock
index c879644..7bb5af2 100755
--- a/case-mlock
+++ b/case-mlock
@@ -11,4 +11,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu --mlock $((reclaimable / nr_cpu / 3))
+$USEMEM -n $nr_task --mlock $((reclaimable / nr_task / 3))
diff --git a/case-mmap-pread-rand b/case-mmap-pread-rand
index 824a917..7334bd9 100755
--- a/case-mmap-pread-rand
+++ b/case-mmap-pread-rand
@@ -2,8 +2,8 @@
. ./hw_vars
-create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu))
+create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_task))
-$USEMEM -n $nr_cpu -f $SPARSE_FILE --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -n $nr_task -f $SPARSE_FILE --readonly --random $((ROTATE_BYTES / nr_task))
rm $SPARSE_FILE
diff --git a/case-mmap-pread-rand-mt b/case-mmap-pread-rand-mt
index 7c904fb..361a8fa 100755
--- a/case-mmap-pread-rand-mt
+++ b/case-mmap-pread-rand-mt
@@ -2,8 +2,8 @@
. ./hw_vars
-create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu))
+create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_task))
-$USEMEM -t $nr_cpu -f $SPARSE_FILE --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -t $nr_task -f $SPARSE_FILE --readonly --random $((ROTATE_BYTES / nr_task))
rm $SPARSE_FILE
diff --git a/case-mmap-pread-seq b/case-mmap-pread-seq
index 7ab76ca..930b678 100755
--- a/case-mmap-pread-seq
+++ b/case-mmap-pread-seq
@@ -4,6 +4,6 @@
create_sparse_file $SPARSE_FILE $((ROTATE_BYTES))
-$USEMEM -n $nr_cpu -f $SPARSE_FILE --readonly $((ROTATE_BYTES))
+$USEMEM -n $nr_task -f $SPARSE_FILE --readonly $((ROTATE_BYTES))
rm $SPARSE_FILE
diff --git a/case-mmap-pread-seq-mt b/case-mmap-pread-seq-mt
index e821235..ce042cc 100755
--- a/case-mmap-pread-seq-mt
+++ b/case-mmap-pread-seq-mt
@@ -4,6 +4,6 @@
create_sparse_file $SPARSE_FILE $((ROTATE_BYTES))
-$USEMEM -t $nr_cpu -f $SPARSE_FILE --readonly $((ROTATE_BYTES >> 3))
+$USEMEM -t $nr_task -f $SPARSE_FILE --readonly $((ROTATE_BYTES >> 3))
rm $SPARSE_FILE
diff --git a/case-mmap-xread-rand-mt b/case-mmap-xread-rand-mt
index d3df657..c39ac74 100755
--- a/case-mmap-xread-rand-mt
+++ b/case-mmap-xread-rand-mt
@@ -2,8 +2,8 @@
. ./hw_vars
-create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu))
+create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_task))
-$USEMEM -t $nr_cpu -f $SPARSE_FILE --prealloc --readonly --random $((ROTATE_BYTES / nr_cpu))
+$USEMEM -t $nr_task -f $SPARSE_FILE --prealloc --readonly --random $((ROTATE_BYTES / nr_task))
rm $SPARSE_FILE
diff --git a/case-mmap-xread-seq-mt b/case-mmap-xread-seq-mt
index c7e389b..061061b 100755
--- a/case-mmap-xread-seq-mt
+++ b/case-mmap-xread-seq-mt
@@ -4,6 +4,6 @@
create_sparse_file $SPARSE_FILE $((ROTATE_BYTES))
-$USEMEM -t $nr_cpu -f $SPARSE_FILE --prealloc --readonly $((ROTATE_BYTES >> 3))
+$USEMEM -t $nr_task -f $SPARSE_FILE --prealloc --readonly $((ROTATE_BYTES >> 3))
rm $SPARSE_FILE
diff --git a/case-mremap-xread-rand-mt b/case-mremap-xread-rand-mt
index 89e93f8..e4ea76c 100755
--- a/case-mremap-xread-rand-mt
+++ b/case-mremap-xread-rand-mt
@@ -10,10 +10,10 @@
. ./hw_vars
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
- $USEMEM -t $nr_cpu -f $SPARSE_FILE-$i -E --prealloc --readonly --random $((ROTATE_BYTES / nr_cpu)) &
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
+ $USEMEM -t $nr_task -f $SPARSE_FILE-$i -E --prealloc --readonly --random $((ROTATE_BYTES / nr_task)) &
done
wait
diff --git a/case-msync b/case-msync
index 408cbc3..a859802 100755
--- a/case-msync
+++ b/case-msync
@@ -2,9 +2,9 @@
. ./hw_vars
-SIZE=$((mem / nr_cpu / 2))
+SIZE=$((mem / nr_task / 2))
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
create_sparse_file $SPARSE_FILE-$i $mem
$USEMEM -S -f $SPARSE_FILE-$i -F --prealloc --open-rw $SIZE &
diff --git a/case-msync-mt b/case-msync-mt
index 6ed43af..b2b6f61 100755
--- a/case-msync-mt
+++ b/case-msync-mt
@@ -2,10 +2,10 @@
. ./hw_vars
-SIZE=$((mem / nr_cpu / 2))
+SIZE=$((mem / nr_task / 2))
create_sparse_file $SPARSE_FILE $mem
-$USEMEM -S -t $nr_cpu -f $SPARSE_FILE -F --prealloc --open-rw $SIZE
+$USEMEM -S -t $nr_task -f $SPARSE_FILE -F --prealloc --open-rw $SIZE
rm $SPARSE_FILE
diff --git a/case-posix-fadvise b/case-posix-fadvise
index 558312d..bf244d1 100755
--- a/case-posix-fadvise
+++ b/case-posix-fadvise
@@ -10,9 +10,9 @@
. ./hw_vars
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_cpu))
+ create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
$USEMEM -D $SPARSE_FILE-$i --open-rw &
done
wait
diff --git a/case-remap b/case-remap
index a002db2..daf0b9b 100755
--- a/case-remap
+++ b/case-remap
@@ -11,10 +11,10 @@ USEMEM_REMAP=./usemem_remap
start_time=$(date +%s%N)
start_time=${start_time%???}
-for i in $(seq $nr_cpu)
+for i in $(seq $nr_task)
do
- create_sparse_file $SPARSE_FILE-$i $((mem / nr_cpu / 2))
- $USEMEM_REMAP $SPARSE_FILE-$i $((mem / nr_cpu / 2)) &
+ create_sparse_file $SPARSE_FILE-$i $((mem / nr_task / 2))
+ $USEMEM_REMAP $SPARSE_FILE-$i $((mem / nr_task / 2)) &
done
wait
diff --git a/case-shm-lock-unlock b/case-shm-lock-unlock
index 9784c6d..dcbae1f 100755
--- a/case-shm-lock-unlock
+++ b/case-shm-lock-unlock
@@ -11,7 +11,7 @@
. ./hw_vars
#segment size being requested
-SHM_SIZE=$((shm_size / nr_cpu / 2))
+SHM_SIZE=$((shm_size / nr_task / 2))
#check for max shared memory allowed on system
MAX_SHARE_SEGMENT=$(cat /proc/sys/kernel/shmmax)
@@ -26,4 +26,4 @@ then
exit 1 #exit on failure
fi
-$USEMEM -n $nr_cpu -L --random $SHM_SIZE
+$USEMEM -n $nr_task -L --random $SHM_SIZE
diff --git a/case-shm-pread-rand b/case-shm-pread-rand
index 19daeaa..c11eab5 100755
--- a/case-shm-pread-rand
+++ b/case-shm-pread-rand
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_cpu -f $SHM_FILE --readonly --random $((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --readonly --random $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-pread-rand-mt b/case-shm-pread-rand-mt
index 472be4a..ec9e8d6 100755
--- a/case-shm-pread-rand-mt
+++ b/case-shm-pread-rand-mt
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_cpu -f $SHM_FILE --readonly --random $((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --readonly --random $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-pread-seq b/case-shm-pread-seq
index 9338944..0107693 100755
--- a/case-shm-pread-seq
+++ b/case-shm-pread-seq
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_cpu -f $SHM_FILE --readonly $((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --readonly $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-pread-seq-mt b/case-shm-pread-seq-mt
index 4a4f037..8ce7f1f 100755
--- a/case-shm-pread-seq-mt
+++ b/case-shm-pread-seq-mt
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_cpu -f $SHM_FILE --readonly $((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --readonly $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-xread-rand b/case-shm-xread-rand
index 100aea1..be0c22a 100755
--- a/case-shm-xread-rand
+++ b/case-shm-xread-rand
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_cpu -f $SHM_FILE --prealloc --readonly --random $((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --prealloc --readonly --random $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-xread-rand-mt b/case-shm-xread-rand-mt
index 7f08bab..75dd863 100755
--- a/case-shm-xread-rand-mt
+++ b/case-shm-xread-rand-mt
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_cpu -f $SHM_FILE --prealloc --readonly --random $((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --prealloc --readonly --random $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-xread-seq b/case-shm-xread-seq
index 6200a97..e3ca854 100755
--- a/case-shm-xread-seq
+++ b/case-shm-xread-seq
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -n $nr_cpu -f $SHM_FILE --prealloc --readonly $((shm_size / 2))
+$USEMEM -n $nr_task -f $SHM_FILE --prealloc --readonly $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-shm-xread-seq-mt b/case-shm-xread-seq-mt
index 5c2be5e..efe3454 100755
--- a/case-shm-xread-seq-mt
+++ b/case-shm-xread-seq-mt
@@ -4,6 +4,6 @@
create_sparse_file $SHM_FILE $shm_size
-$USEMEM -t $nr_cpu -f $SHM_FILE --prealloc --readonly $((shm_size / 2))
+$USEMEM -t $nr_task -f $SHM_FILE --prealloc --readonly $((shm_size / 2))
rm $SHM_FILE
diff --git a/case-small-allocs b/case-small-allocs
index 25c3deb..bf4b259 100755
--- a/case-small-allocs
+++ b/case-small-allocs
@@ -5,4 +5,4 @@
. ./hw_vars
-$USEMEM -n $nr_cpu --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_cpu))
+$USEMEM -n $nr_task --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_task))
diff --git a/case-small-allocs-mt b/case-small-allocs-mt
index 56cad7f..634666e 100755
--- a/case-small-allocs-mt
+++ b/case-small-allocs-mt
@@ -5,4 +5,4 @@
. ./hw_vars
-$USEMEM -t $nr_cpu --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_cpu))
+$USEMEM -t $nr_task --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_task))
diff --git a/case-truncate b/case-truncate
index bcfe991..7d75f7b 100755
--- a/case-truncate
+++ b/case-truncate
@@ -1,19 +1,19 @@
#!/bin/sh
-# step 1) fill $mem with $nr_cpu files
+# step 1) fill $mem with $nr_task files
# step 2) truncate the files concurrently
. ./hw_vars
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
- create_sparse_file $SPARSE_FILE-$i $((mem / nr_cpu))
+ create_sparse_file $SPARSE_FILE-$i $((mem / nr_task))
cp $SPARSE_FILE-$i /dev/null
done
t0=$(date +%s.%N)
-for i in `seq $nr_cpu`
+for i in `seq $nr_task`
do
rm $SPARSE_FILE-$i &
done
diff --git a/hw_vars b/hw_vars
index fc62d97..376701e 100755
--- a/hw_vars
+++ b/hw_vars
@@ -100,6 +100,8 @@ pagesize=$(getconf PAGESIZE)
nr_cpu=$(grep -c processor /proc/cpuinfo)
nr_node=$(echo /sys/devices/system/node/node* | wc -w)
+nr_task=${nr_task:-$nr_cpu}
+
while read key val; do
[ -n "${val}" ] || continue
[ -z "${val##*[0-9]}" -a -z "${val%%[0-9]*}" ] || {
diff --git a/run b/run
index 2856edc..42fb6ca 100755
--- a/run
+++ b/run
@@ -93,7 +93,7 @@ perf_events=$(echo $perf_events | sed 's/ / -e /g')
. ./hw_vars
-OUT_DIR=$(hostname)-${nr_cpu}c-$(((mem + (1<<29))>>30))g
+OUT_DIR=$(hostname)-${nr_task}c-$(((mem + (1<<29))>>30))g
TEST_CASES=${@:-$(echo case-*)}
echo $((1<<30)) > /proc/sys/vm/max_map_count