diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2012-11-27 20:21:57 +0800 |
---|---|---|
committer | Fengguang Wu <fengguang.wu@intel.com> | 2012-11-27 20:29:07 +0800 |
commit | 4966a0b6e19d4588767893002357cf9bc7c181d4 (patch) | |
tree | 37745c94c80d5024056adc995baac9b552acd4fc | |
parent | fbbde796892195094fafa99867d2b6a5a2c3caba (diff) | |
download | vm-scalability-4966a0b6e19d4588767893002357cf9bc7c181d4.tar.gz |
Abhinav's work on case-mincore
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rw-r--r-- | case-mincore | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/case-mincore b/case-mincore new file mode 100644 index 0000000..ca0edb3 --- /dev/null +++ b/case-mincore @@ -0,0 +1,32 @@ +#!/bin/bash + +# +# Exercises code in mincore.c mm/ +# +source ./hw_vars + +#check for max shared memory allowed on system +MAX_SHARE_SEGMENT=$(</proc/sys/kernel/shmmax) + +#segment size being requested +SHM_SIZE=$((mem / nr_cpu)) +#echo "shared segment size being requested $SHM_SIZE" + +#echo "Max shared segment allocatable is set to $MAX_SHARE_SEGMENT" + +#check to see if the request can be satisfied else exit with error +if [ $MAX_SHARE_SEGMENT -lt $SHM_SIZE ] +then + echo "Cannot allocate more shared memory segment than $MAX_SHARE_SEGMENT" + echo "exiting now..." + exit 1 #exit on failure +fi + +for i in `seq nr_cpu` +do + create_sparse_file $SPARSE_FILE-$i $SHM_SIZE + $USEMEM -t $nr_cpu -f $SPARSE_FILE -N --prealloc --readonly --random $SHM_SIZE & +done +wait + +rm $SPARSE_FILE-* |