diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2015-01-03 21:33:02 -0800 |
---|---|---|
committer | Fengguang Wu <fengguang.wu@intel.com> | 2015-01-03 21:33:02 -0800 |
commit | ccf4438f87902d2520b8ae60b035d48a45b51e6b (patch) | |
tree | 3199a54e06ec4be298184f00427e22c6d01d5a77 | |
parent | 868f1f28ae131d1944900c96726f00478c79b653 (diff) | |
download | vm-scalability-ccf4438f87902d2520b8ae60b035d48a45b51e6b.tar.gz |
switch cases to /bin/sh
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
61 files changed, 143 insertions, 143 deletions
diff --git a/case-000-anon b/case-000-anon index 430a036..f66972b 100755 --- a/case-000-anon +++ b/case-000-anon @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh # fill memory with anon pages -source ./hw_vars +. ./hw_vars $USEMEM $((mem/3)) --detach --sleep 100000 --pid-file $PIDFILE diff --git a/case-000-shm b/case-000-shm index a3a24fd..16146a1 100755 --- a/case-000-shm +++ b/case-000-shm @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # fill memory with shm/tmpfs pages -source ./hw_vars +. ./hw_vars create_sparse_file $TMPFS_MNT/XXX $shm_size diff --git a/case-000-shm-clean b/case-000-shm-clean index d47fd95..c58cbfe 100755 --- a/case-000-shm-clean +++ b/case-000-shm-clean @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # fill memory with clean shm/tmpfs pages -source ./hw_vars +. ./hw_vars create_sparse_file $TMPFS_MNT/XXX $shm_size diff --git a/case-anon-cow-rand b/case-anon-cow-rand index 5de808c..5404207 100755 --- a/case-anon-cow-rand +++ b/case-anon-cow-rand @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu --prealloc --prefault --random $((mem / nr_cpu / 2)) diff --git a/case-anon-cow-rand-mt b/case-anon-cow-rand-mt index 64037df..bb8ede1 100755 --- a/case-anon-cow-rand-mt +++ b/case-anon-cow-rand-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc --prefault --random $((mem / nr_cpu / 2)) diff --git a/case-anon-cow-seq b/case-anon-cow-seq index 68eceb1..8349948 100755 --- a/case-anon-cow-seq +++ b/case-anon-cow-seq @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu --prealloc --prefault $((mem / nr_cpu / 2)) diff --git a/case-anon-cow-seq-mt b/case-anon-cow-seq-mt index 53be7a0..77ddb40 100755 --- a/case-anon-cow-seq-mt +++ b/case-anon-cow-seq-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc --prefault $((mem / nr_cpu / 2)) diff --git a/case-anon-r-rand b/case-anon-r-rand index fcb0c32..7375013 100755 --- a/case-anon-r-rand +++ b/case-anon-r-rand @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars # prevent OOM: limit pagetable pages to half memory -(( ROTATE_BYTES > (mem << 8) )) && (( ROTATE_BYTES = (mem << 8) )) +[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 )) $USEMEM -n $nr_cpu --readonly --random $((ROTATE_BYTES / nr_cpu)) diff --git a/case-anon-r-rand-mt b/case-anon-r-rand-mt index 6f4eaa6..e005014 100755 --- a/case-anon-r-rand-mt +++ b/case-anon-r-rand-mt @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars # prevent OOM: limit pagetable pages to half memory -(( ROTATE_BYTES > (mem << 8) )) && (( ROTATE_BYTES = (mem << 8) )) +[ "$ROTATE_BYTES" -gt $(( mem << 8 )) ] && ROTATE_BYTES=$(( mem << 8 )) $USEMEM -t $nr_cpu --readonly --random $((ROTATE_BYTES / nr_cpu)) diff --git a/case-anon-r-seq b/case-anon-r-seq index 1625d9a..9e8cbca 100755 --- a/case-anon-r-seq +++ b/case-anon-r-seq @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars size=$((PTE_LIMIT / nr_cpu)) -(( size > AS_LIMIT )) && size=$AS_LIMIT +[ "$size" -gt "$AS_LIMIT" ] && size=$AS_LIMIT $USEMEM -n $nr_cpu --readonly $size diff --git a/case-anon-r-seq-mt b/case-anon-r-seq-mt index 4c4f0ad..2a77aca 100755 --- a/case-anon-r-seq-mt +++ b/case-anon-r-seq-mt @@ -1,7 +1,7 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars -(( PTE_LIMIT > AS_LIMIT )) && PTE_LIMIT=$AS_LIMIT +[ "$PTE_LIMIT" -gt "$AS_LIMIT" ] && PTE_LIMIT=$AS_LIMIT $USEMEM -t $nr_cpu --readonly $((PTE_LIMIT / nr_cpu)) diff --git a/case-anon-rx-rand-mt b/case-anon-rx-rand-mt index 159291b..a01f04b 100755 --- a/case-anon-rx-rand-mt +++ b/case-anon-rx-rand-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc --readonly --random $((ROTATE_BYTES / nr_cpu)) diff --git a/case-anon-rx-seq-mt b/case-anon-rx-seq-mt index c15fd3e..f8f16bf 100755 --- a/case-anon-rx-seq-mt +++ b/case-anon-rx-seq-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc --readonly $((ROTATE_BYTES)) diff --git a/case-anon-w-rand b/case-anon-w-rand index ca246ff..21bf035 100755 --- a/case-anon-w-rand +++ b/case-anon-w-rand @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu --random $((mem / nr_cpu / 2)) diff --git a/case-anon-w-rand-mt b/case-anon-w-rand-mt index 2674bbe..d2ac120 100755 --- a/case-anon-w-rand-mt +++ b/case-anon-w-rand-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --random $((mem / nr_cpu / 2)) diff --git a/case-anon-w-seq b/case-anon-w-seq index 5bf15d2..dc43298 100755 --- a/case-anon-w-seq +++ b/case-anon-w-seq @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu $((mem / nr_cpu / 2)) diff --git a/case-anon-w-seq-mt b/case-anon-w-seq-mt index ae1de60..d05e8b7 100755 --- a/case-anon-w-seq-mt +++ b/case-anon-w-seq-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu $((mem / nr_cpu / 2)) diff --git a/case-anon-wx-rand-mt b/case-anon-wx-rand-mt index 25c3af3..70939c2 100755 --- a/case-anon-wx-rand-mt +++ b/case-anon-wx-rand-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc --random $((mem / nr_cpu / 2)) diff --git a/case-anon-wx-seq-mt b/case-anon-wx-seq-mt index ac3f867..23aa9ae 100755 --- a/case-anon-wx-seq-mt +++ b/case-anon-wx-seq-mt @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --prealloc $((mem / nr_cpu / 2)) diff --git a/case-direct-write b/case-direct-write index b3a48c9..e66d332 100755 --- a/case-direct-write +++ b/case-direct-write @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Exercises functions in filemap.c of mm/ # # -source ./hw_vars +. ./hw_vars USEMEM_DIRECT_WRITE=./usemem_direct_write @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n 20000 0 diff --git a/case-fork-sleep b/case-fork-sleep index 9fa36c0..0f46328 100755 --- a/case-fork-sleep +++ b/case-fork-sleep @@ -1,5 +1,5 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars $USEMEM -n 20000 0 --sleep 10 diff --git a/case-hugetlb b/case-hugetlb index 4eb34df..f1b10eb 100755 --- a/case-hugetlb +++ b/case-hugetlb @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars # XXX: due to fragmentation, it normally allocates much less memory echo $((mem/Hugepagesize/1024 / 3)) > /proc/sys/vm/nr_hugepages @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # This case exercises the ksm functionality of the kernel -source ./hw_vars +. ./hw_vars # Trun on the ksm echo 1 > /sys/kernel/mm/ksm/run diff --git a/case-ksm-hugepages b/case-ksm-hugepages index 5454edd..5fc8153 100755 --- a/case-ksm-hugepages +++ b/case-ksm-hugepages @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars # Turn on transparent hugepage support echo always > /sys/kernel/mm/transparent_hugepage/enabled diff --git a/case-lru-file-mmap-read b/case-lru-file-mmap-read index fb59b8c..af6f2c8 100755 --- a/case-lru-file-mmap-read +++ b/case-lru-file-mmap-read @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with use-once page cache reads @@ -6,7 +6,7 @@ # 1781926 ____pagevec_lru_add # 736056 shrink_inactive_list -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do diff --git a/case-lru-file-mmap-read-rand b/case-lru-file-mmap-read-rand index 0282767..2539280 100755 --- a/case-lru-file-mmap-read-rand +++ b/case-lru-file-mmap-read-rand @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with use-once page cache reads @@ -6,7 +6,7 @@ # 1781926 ____pagevec_lru_add # 736056 shrink_inactive_list -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do diff --git a/case-lru-file-readonce b/case-lru-file-readonce index 74a0c4b..09038d9 100755 --- a/case-lru-file-readonce +++ b/case-lru-file-readonce @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with use-once page cache reads @@ -6,7 +6,7 @@ # 1781926 ____pagevec_lru_add # 736056 shrink_inactive_list -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do @@ -19,7 +19,7 @@ sleep 1 for file in $TMPFS_MNT/dd-output-* do - [[ -s $file ]] || { + [ -s "$file" ] || { echo "dd output file empty: $file" >&2 } cat $file diff --git a/case-lru-file-readtwice b/case-lru-file-readtwice index ecb1fcb..53254c2 100755 --- a/case-lru-file-readtwice +++ b/case-lru-file-readtwice @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with use-twice page cache reads @@ -13,7 +13,7 @@ # 33637385 free_pcppages_bulk # 33650227 rmqueue_bulk -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do @@ -27,7 +27,7 @@ sleep 1 for file in $TMPFS_MNT/dd-output-* do - [[ -s $file ]] || { + [ -s "$file" ] || { echo "dd output file empty: $file" >&2 } cat $file diff --git a/case-lru-memcg b/case-lru-memcg index b08d678..b44b749 100755 --- a/case-lru-memcg +++ b/case-lru-memcg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # mem_cgroup->reclaim_param_lock # 1801700 mem_cgroup_note_reclaim_priority @@ -11,20 +11,20 @@ # 449081 free_pcppages_bulk # 441317 rmqueue_bulk -source ./hw_vars +. ./hw_vars CGROUP=$(mount -t cgroup | grep memory | cut -f3 -d' ') -if [[ -z $CGROUP ]]; then +if [ -z "$CGROUP" ]; then CGROUP=/cgroup - [[ -d $CGROUP ]] || mkdir $CGROUP || exit - [[ -n $(ls $CGROUP) ]] && echo "$CGROUP not empty" && exit + [ -d "$CGROUP" ] || mkdir $CGROUP || exit + [ -n "$(ls $CGROUP)" ] && echo "$CGROUP not empty" && exit mount -t cgroup none $CGROUP -o memory || exit fi -[[ -d $CGROUP/vmscale ]] || mkdir $CGROUP/vmscale || exit +[ -d "$CGROUP/vmscale" ] || mkdir $CGROUP/vmscale || exit echo $$ > $CGROUP/vmscale/tasks echo $((mem / 3)) > $CGROUP/vmscale/memory.limit_in_bytes -source case-lru-file-readonce +. case-lru-file-readonce diff --git a/case-lru-shm b/case-lru-shm index 0e43bd5..e64f755 100755 --- a/case-lru-shm +++ b/case-lru-shm @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with readonly shm/tmpfs pages @@ -10,7 +10,7 @@ # 1781926 ____pagevec_lru_add # 736056 shrink_inactive_list -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do diff --git a/case-lru-shm-rand b/case-lru-shm-rand index bc8aefa..28799d9 100755 --- a/case-lru-shm-rand +++ b/case-lru-shm-rand @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # flush memory with use-once page cache reads @@ -6,7 +6,7 @@ # 1781926 ____pagevec_lru_add # 736056 shrink_inactive_list -source ./hw_vars +. ./hw_vars for i in `seq 1 $nr_cpu` do @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars # usemem_mbind fails randomly. subsequent runs succeed. --have to fix that USEMEM_MBIND=./usemem_mbind diff --git a/case-migrate b/case-migrate index f93a1ba..571e97e 100755 --- a/case-migrate +++ b/case-migrate @@ -1,13 +1,13 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $mem migrate_unit=$((mem/nr_node/2)) numactl --interleave=all $USEMEM -f $SPARSE_FILE --readonly $migrate_unit --detach --sleep $((runtime * 2)) --pid-file $PIDFILE -pid=$(<$PIDFILE) +pid=$(cat $PIDFILE) rm $PIDFILE rm $SPARSE_FILE @@ -22,9 +22,9 @@ do migratepages $pid $((i-1)) $i now=$(date +%s%N) now=${now%???} - (( count++ )) - (( usecs = now - start_time )) - (( usecs > ${runtime}000000 )) && break 2 + [ -n "$count++" -a "$count++" != 0 ] + usecs=$(( now - start_time )) + [ "$usecs" -gt ${runtime}000000 ] && break 2 done done @@ -35,7 +35,7 @@ kill -INT $pid # the sleep is necessary for umount to succeed # it takes some time to kill the usemem process -while [[ -d /proc/$pid && $(</proc/$pid/comm) = usemem ]] +while [[ -d /proc/$pid && $(cat /proc/$pid/comm) = usemem ]] do sleep 0.1 done diff --git a/case-migrate-across-nodes b/case-migrate-across-nodes index 1f78cc2..1de992a 100755 --- a/case-migrate-across-nodes +++ b/case-migrate-across-nodes @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # This case migrates pages across nodes -source ./hw_vars +. ./hw_vars USEMEM_MIGRATE=./usemem_migrate diff --git a/case-mincore b/case-mincore index ca0edb3..7303040 100755 --- a/case-mincore +++ b/case-mincore @@ -1,12 +1,12 @@ -#!/bin/bash +#!/bin/sh # # Exercises code in mincore.c mm/ # -source ./hw_vars +. ./hw_vars #check for max shared memory allowed on system -MAX_SHARE_SEGMENT=$(</proc/sys/kernel/shmmax) +MAX_SHARE_SEGMENT=$(cat /proc/sys/kernel/shmmax) #segment size being requested SHM_SIZE=$((mem / nr_cpu)) diff --git a/case-mincore-hugepages b/case-mincore-hugepages index 40ffbfa..62d7e86 100755 --- a/case-mincore-hugepages +++ b/case-mincore-hugepages @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Exercises code in mincore.c mm/ # -source ./hw_vars +. ./hw_vars # set number of hugepages in the system echo never > /sys/kernel/mm/transparent_hugepage/enabled @@ -12,7 +12,7 @@ echo $((mem/Hugepagesize/1024 / 20)) > /proc/sys/vm/nr_hugepages echo $((mem/Hugepagesize/1024 / 10)) > /proc/sys/vm/nr_overcommit_hugepages #check for max shared memory allowed on system -MAX_HUGEPAGES=$(($(</proc/sys/vm/nr_hugepages)+$(</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)) @@ -21,7 +21,7 @@ SHM_SIZE=$(($MAX_HUGEPAGES*$hugepagesize / nr_cpu)) echo $SHM_SIZE > /proc/sys/kernel/shmmax #check to see if the request can be satisfied else exit with error -MAX_SHARE_SEGMENT=$(</proc/sys/kernel/shmmax) +MAX_SHARE_SEGMENT=$(cat /proc/sys/kernel/shmmax) if [ $SHM_SIZE -gt $MAX_SHARE_SEGMENT ] then echo "Cannot allocate more shared memory segment than $MAX_SHARE_SEGMENT" @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # lru_lock coverage # 1077642 putback_lru_page @@ -9,6 +9,6 @@ # 41206 free_pcppages_bulk # 29641 rmqueue_bulk -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu --mlock $((reclaimable / nr_cpu / 3)) diff --git a/case-mmap-pread-rand b/case-mmap-pread-rand index 51c78c1..824a917 100755 --- a/case-mmap-pread-rand +++ b/case-mmap-pread-rand @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu)) diff --git a/case-mmap-pread-rand-mt b/case-mmap-pread-rand-mt index d8de195..7c904fb 100755 --- a/case-mmap-pread-rand-mt +++ b/case-mmap-pread-rand-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu)) diff --git a/case-mmap-pread-seq b/case-mmap-pread-seq index 9754241..7ab76ca 100755 --- a/case-mmap-pread-seq +++ b/case-mmap-pread-seq @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES)) diff --git a/case-mmap-pread-seq-mt b/case-mmap-pread-seq-mt index 8c897af..e821235 100755 --- a/case-mmap-pread-seq-mt +++ b/case-mmap-pread-seq-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES)) diff --git a/case-mmap-xread-rand-mt b/case-mmap-xread-rand-mt index 5903c5c..d3df657 100755 --- a/case-mmap-xread-rand-mt +++ b/case-mmap-xread-rand-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES / nr_cpu)) diff --git a/case-mmap-xread-seq-mt b/case-mmap-xread-seq-mt index b575df5..c7e389b 100755 --- a/case-mmap-xread-seq-mt +++ b/case-mmap-xread-seq-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SPARSE_FILE $((ROTATE_BYTES)) diff --git a/case-mremap-xread-rand-mt b/case-mremap-xread-rand-mt index cfb13ea..89e93f8 100755 --- a/case-mremap-xread-rand-mt +++ b/case-mremap-xread-rand-mt @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Exercises code in mremap.c of mm/ @@ -8,7 +8,7 @@ # process. Then remaps it after scaling it by SCALE_FACTOR defined in usemem. # -source ./hw_vars +. ./hw_vars for i in `seq $nr_cpu` do @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars SIZE=$((mem / nr_cpu / 2)) diff --git a/case-msync-mt b/case-msync-mt index e49f491..6ed43af 100755 --- a/case-msync-mt +++ b/case-msync-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars SIZE=$((mem / nr_cpu / 2)) diff --git a/case-posix-fadvise b/case-posix-fadvise index d5d68c0..558312d 100755 --- a/case-posix-fadvise +++ b/case-posix-fadvise @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Exercises the functions in fadvise.c of mm/ @@ -7,7 +7,7 @@ # # -source ./hw_vars +. ./hw_vars for i in `seq $nr_cpu` @@ -1,10 +1,10 @@ -#!/bin/bash +#!/bin/sh # # Exercises functions in fremap.c of mm/ # # -source ./hw_vars +. ./hw_vars USEMEM_REMAP=./usemem_remap @@ -20,7 +20,7 @@ wait now=$(date +%s%N) now=${now%???} -(( usecs = now - start_time )) +usecs=$(( now - start_time )) throughput=$((mem / 2 / usecs)) echo "$((mem / 2)) bytes remapped, $usecs usecs, $throughput MB/s" diff --git a/case-shm-lock-unlock b/case-shm-lock-unlock index 9cd322f..9784c6d 100755 --- a/case-shm-lock-unlock +++ b/case-shm-lock-unlock @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # # Exercises the SYS V IPC code of mm/ @@ -8,13 +8,13 @@ # to calling process's VM and then unlocks and releases it. # -source ./hw_vars +. ./hw_vars #segment size being requested SHM_SIZE=$((shm_size / nr_cpu / 2)) #check for max shared memory allowed on system -MAX_SHARE_SEGMENT=$(</proc/sys/kernel/shmmax) +MAX_SHARE_SEGMENT=$(cat /proc/sys/kernel/shmmax) echo "MAX SEGMENT is $MAX_SHARE_SEGMENT total asking is $((shm_size / 2))" diff --git a/case-shm-pread-rand b/case-shm-pread-rand index 9a02576..19daeaa 100755 --- a/case-shm-pread-rand +++ b/case-shm-pread-rand @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-pread-rand-mt b/case-shm-pread-rand-mt index 073de07..472be4a 100755 --- a/case-shm-pread-rand-mt +++ b/case-shm-pread-rand-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-pread-seq b/case-shm-pread-seq index c32c525..9338944 100755 --- a/case-shm-pread-seq +++ b/case-shm-pread-seq @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-pread-seq-mt b/case-shm-pread-seq-mt index ab43968..4a4f037 100755 --- a/case-shm-pread-seq-mt +++ b/case-shm-pread-seq-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-xread-rand b/case-shm-xread-rand index 5cae1b7..100aea1 100755 --- a/case-shm-xread-rand +++ b/case-shm-xread-rand @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-xread-rand-mt b/case-shm-xread-rand-mt index bab3b80..7f08bab 100755 --- a/case-shm-xread-rand-mt +++ b/case-shm-xread-rand-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-xread-seq b/case-shm-xread-seq index 7f78457..6200a97 100755 --- a/case-shm-xread-seq +++ b/case-shm-xread-seq @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-shm-xread-seq-mt b/case-shm-xread-seq-mt index 5f10f37..5c2be5e 100755 --- a/case-shm-xread-seq-mt +++ b/case-shm-xread-seq-mt @@ -1,6 +1,6 @@ -#!/bin/bash +#!/bin/sh -source ./hw_vars +. ./hw_vars create_sparse_file $SHM_FILE $shm_size diff --git a/case-small-allocs b/case-small-allocs index a300875..25c3deb 100755 --- a/case-small-allocs +++ b/case-small-allocs @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # flush memory and # create lots of small continuous VMAs -source ./hw_vars +. ./hw_vars $USEMEM -n $nr_cpu --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_cpu)) diff --git a/case-small-allocs-mt b/case-small-allocs-mt index 3396c7f..56cad7f 100755 --- a/case-small-allocs-mt +++ b/case-small-allocs-mt @@ -1,8 +1,8 @@ -#!/bin/bash +#!/bin/sh # flush memory and # create lots of small continuous VMAs -source ./hw_vars +. ./hw_vars $USEMEM -t $nr_cpu --readonly --unit $((10 * pagesize)) $((ROTATE_BYTES / nr_cpu)) diff --git a/case-truncate b/case-truncate index e612210..bcfe991 100755 --- a/case-truncate +++ b/case-truncate @@ -1,9 +1,9 @@ -#!/bin/bash +#!/bin/sh # step 1) fill $mem with $nr_cpu files # step 2) truncate the files concurrently -source ./hw_vars +. ./hw_vars for i in `seq $nr_cpu` do |