diff options
author | Fengguang Wu <fengguang.wu@intel.com> | 2014-02-28 20:27:23 +0800 |
---|---|---|
committer | Fengguang Wu <fengguang.wu@intel.com> | 2014-02-28 20:27:23 +0800 |
commit | 4d04a0b9d7d205a473446425c1fc39cb3ac5f3ef (patch) | |
tree | 25f5ed81081161930fbc539df9b52c526e6ef4d6 | |
parent | 9f026a1d8894df6bd4d546588753b9a37686b13c (diff) | |
download | vm-scalability-4d04a0b9d7d205a473446425c1fc39cb3ac5f3ef.tar.gz |
fix undefined shm_size
Root caused and fixed by Wanlong:
2014-02-26 19:31:41.830115500 [lkp process-result-queue 36526] truncate: option requires an argument -- 's'
2014-02-26 19:31:41.830117500 Try 'truncate --help' for more information.
2014-02-26 19:31:41.844520500 [lkp process-result-queue 36526] moved bad result from
/lkp/result/brickland2/micro/vm-scalability/16G-shm-xread-rand-m
t/x86_64-lkp/4e61e14b4be48e4b7264a304b0306d0c49a8d521/0 to
/lkp/bad-result/brickland2/micro/vm-scalability/16G-shm-xread-rand-mt/x86_64-lkp/4e61e14b4
be48e4b7264a304b0306d0c49a8d521/0
[allen@G08FNSTD121251 ~]$ cd
/lkp/bad-result/brickland2/micro/vm-scalability/16G-shm-xread-rand-mt/x86_64-lkp/4e61e14b4be48e4b7264a304b0306d0c49a8d521/0/
[allen@G08FNSTD121251 0]$ cat reproduce.sh
2014-02-26 19:30:12 mount -t tmpfs -o size=100% vm-scalability-tmp /tmp/vm-scalability-tmp
2014-02-26 19:30:12 truncate -s 135079759872 /tmp/vm-scalability.img
2014-02-26 19:30:12 mkfs.xfs -q /tmp/vm-scalability.img
2014-02-26 19:30:12 mount -o loop /tmp/vm-scalability.img /tmp/vm-scalability
2014-02-26 19:30:12 ./case-shm-xread-rand-mt
2014-02-26 19:30:12 truncate /tmp/vm-scalability-tmp/sparse-shm-xread-rand-mt -s <====== ERROR
2014-02-26 19:30:12 ./usemem --runtime 300 -t 120 -f /tmp/vm-scalability-tmp/sparse-shm-xread-rand-mt --prealloc --readonly --random 0
2014-02-26 19:30:12 umount /tmp/vm-scalability-tmp
2014-02-26 19:30:12 umount /tmp/vm-scalability
2014-02-26 19:30:12 rm /tmp/vm-scalability.img
[allen@G08FNSTD121251 vm-scalability]$ cat case-shm-xread-rand-mt
source ./hw_vars
create_sparse_file $SHM_FILE $shm_size <======== ERROR
$USEMEM -t $nr_cpu -f $SHM_FILE --prealloc --readonly --random $((shm_size / 2))
rm $SHM_FILE
[allen@G08FNSTD121251 vm-scalability]$ cat hw_vars
...
mount_tmpfs()
{
if [[ -d $TMPFS_MNT ]]; then
mountpoint -q $TMPFS_MNT && umount $TMPFS_MNT
else
mkdir $TMPFS_MNT
fi
$CMD mount -t tmpfs -o size=100% vm-scalability-tmp $TMPFS_MNT
shm_size=$(/usr/bin/stat -f -c "%b*%S" $TMPFS_MNT)
shm_size=$((shm_size)) <=== Here is shm_size
}
...
create_sparse_file () {
name=$1
size=$2
# echo "$name is of size $size"
$CMD truncate $name -s $size
# dd if=/dev/zero of=$name bs=1k count=1 seek=$((size >> 10)) 2>/dev/null
# ls $SPARSE_ROOT
# ls /tmp/vm-scalability/*
}
...
So, we should export shm_size variable there since the test case cannot
get this variable.
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
-rwxr-xr-x | hw_vars | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -25,7 +25,7 @@ mount_tmpfs() $CMD mount -t tmpfs -o size=100% vm-scalability-tmp $TMPFS_MNT shm_size=$(/usr/bin/stat -f -c "%b*%S" $TMPFS_MNT) - shm_size=$((shm_size)) + export shm_size=$((shm_size)) } # sparse files won't work as expected on tmpfs/nfs |