svn commit: r282919 - user/pho/stress2/misc

Peter Holm pho at FreeBSD.org
Thu May 14 19:49:00 UTC 2015


Author: pho
Date: Thu May 14 19:48:57 2015
New Revision: 282919
URL: https://svnweb.freebsd.org/changeset/base/282919

Log:
  Trim back the VM pressure if no swap disk is used,
  
  Sponsored by:	 EMC / Isilon storage division

Modified:
  user/pho/stress2/misc/crossmp3.sh
  user/pho/stress2/misc/crossmp4.sh
  user/pho/stress2/misc/crossmp5.sh
  user/pho/stress2/misc/mlockall2.sh
  user/pho/stress2/misc/pfl.sh
  user/pho/stress2/misc/pfl2.sh
  user/pho/stress2/misc/tmpfs.sh
  user/pho/stress2/misc/tmpfs13.sh

Modified: user/pho/stress2/misc/crossmp3.sh
==============================================================================
--- user/pho/stress2/misc/crossmp3.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/crossmp3.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -41,7 +41,9 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
-size=$((`sysctl -n hw.usermem` / 1024 / 1024 / N))
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((usermem / 1024 / 1024 / N))
 
 mounts=$N		# Number of parallel scripts
 

Modified: user/pho/stress2/misc/crossmp4.sh
==============================================================================
--- user/pho/stress2/misc/crossmp4.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/crossmp4.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -39,7 +39,9 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
-size=$((`sysctl -n hw.usermem` / 1024 / 1024))
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((usermem / 1024 / 1024 / N))
 
 mounts=$N		# Number of parallel scripts
 

Modified: user/pho/stress2/misc/crossmp5.sh
==============================================================================
--- user/pho/stress2/misc/crossmp5.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/crossmp5.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -35,7 +35,9 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
-size=$((`sysctl -n hw.usermem` / 1024 / 1024 / N))
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((usermem / 1024 / 1024 / N))
 
 mounts=$N		# Number of parallel scripts
 

Modified: user/pho/stress2/misc/mlockall2.sh
==============================================================================
--- user/pho/stress2/misc/mlockall2.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/mlockall2.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -35,7 +35,8 @@
 # core dumps seen in watchdogd after mlockall() was added.
 # This scenario demonstrates the problem. Fixed in r242012.
 
-mem=`sysctl hw.usermem | awk '{print $NF}'`
+mem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && mem=$((mem/100*60))
 
 here=`pwd`
 cd /tmp

Modified: user/pho/stress2/misc/pfl.sh
==============================================================================
--- user/pho/stress2/misc/pfl.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/pfl.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -47,10 +47,17 @@ mp2=${mntpoint}2
 md1=$mdstart
 md2=$((mdstart + 1))
 
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((2 * 1024 * 1024 * 1024))	# Ideal disk size is 2G
+[ $((size * 2)) -gt $usermem ] && size=$((usermem / 2))
+size=$((size / 1024 / 1024))
+
 opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-j" || echo "-U")
+[ "$newfs_flags" = "-U" ] || opt=""
 mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1
 mdconfig -l | grep -q md$md1 &&  mdconfig -d -u $md1
-mdconfig -a -t swap -s 2g -u $md1
+mdconfig -a -t swap -s ${size}m -u $md1
 bsdlabel -w md$md1 auto
 newfs $opt md${md1}$part > /dev/null
 mount /dev/md${md1}$part $mp1
@@ -58,7 +65,7 @@ chmod 777 $mp1
 
 mount | grep "on $mp2 " | grep -q /dev/md && umount -f $mp2
 mdconfig -l | grep -q md$md2 &&  mdconfig -d -u $md2
-mdconfig -a -t swap -s 2g -u $md2
+mdconfig -a -t swap -s ${size}m -u $md2
 bsdlabel -w md$md2 auto
 newfs $opt md${md2}$part > /dev/null
 mount /dev/md${md2}$part $mp2

Modified: user/pho/stress2/misc/pfl2.sh
==============================================================================
--- user/pho/stress2/misc/pfl2.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/pfl2.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -36,16 +36,24 @@
 
 . ../default.cfg
 
+[ `swapinfo | wc -l` -eq 1 ] && exit 0
+
 mp1=$mntpoint
 mp2=${mntpoint}2
 [ -d $mp2 ] || mkdir -p $mp2
 md1=$mdstart
 md2=$((mdstart + 1))
 
+usermem=`sysctl -n hw.usermem`
+size=$((2 * 1024 * 1024 * 1024))	# Ideal disk size is 2G
+[ $((size * 2)) -gt $usermem ] && size=$((usermem / 2))
+size=$((size / 1024 / 1024))
+
 opt=$([ $((`date '+%s'` % 2)) -eq 0 ] && echo "-j" || echo "-U")
+[ "$newfs_flags" = "-U" ] || opt=""
 mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1
 mdconfig -l | grep -q md$md1 &&  mdconfig -d -u $md1
-mdconfig -a -t swap -s 2g -u $md1
+mdconfig -a -t swap -s ${size}m -u $md1
 bsdlabel -w md$md1 auto
 newfs $opt md${md1}$part > /dev/null
 mount /dev/md${md1}$part $mp1
@@ -53,7 +61,7 @@ chmod 777 $mp1
 
 mount | grep "on $mp2 " | grep -q /dev/md && umount -f $mp2
 mdconfig -l | grep -q md$md2 &&  mdconfig -d -u $md2
-mdconfig -a -t swap -s 2g -u $md2
+mdconfig -a -t swap -s ${size}m -u $md2
 bsdlabel -w md$md2 auto
 newfs $opt md${md2}$part > /dev/null
 mount /dev/md${md2}$part $mp2

Modified: user/pho/stress2/misc/tmpfs.sh
==============================================================================
--- user/pho/stress2/misc/tmpfs.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/tmpfs.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -35,7 +35,10 @@
 . ../default.cfg
 
 mount | grep "$mntpoint" | grep -q tmpfs && umount $mntpoint
-mount -t tmpfs tmpfs  $mntpoint
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((usermem / 1024 / 1024 / 2))
+mount -o size=${size}m -t tmpfs tmpfs  $mntpoint
 
 export RUNDIR=$mntpoint/stressX
 export runRUNTIME=10m            # Run tests for 10 minutes

Modified: user/pho/stress2/misc/tmpfs13.sh
==============================================================================
--- user/pho/stress2/misc/tmpfs13.sh	Thu May 14 19:48:15 2015	(r282918)
+++ user/pho/stress2/misc/tmpfs13.sh	Thu May 14 19:48:57 2015	(r282919)
@@ -39,7 +39,9 @@
 . ../default.cfg
 
 N=`sysctl -n hw.ncpu`
-size=$((`sysctl -n hw.usermem` / 1024 / 1024 / N))
+usermem=`sysctl -n hw.usermem`
+[ `swapinfo | wc -l` -eq 1 ] && usermem=$((usermem/100*80))
+size=$((usermem / 1024 / 1024 / 2))
 
 export runRUNTIME=15m
 export RUNDIR=$mp1/stressX


More information about the svn-src-user mailing list