From owner-svn-src-user@FreeBSD.ORG Fri Mar 1 06:56:44 2013 Return-Path: <owner-svn-src-user@FreeBSD.ORG> Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9400617B; Fri, 1 Mar 2013 06:56:44 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 740ADB6D; Fri, 1 Mar 2013 06:56:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r216uhYR031810; Fri, 1 Mar 2013 06:56:43 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r216uh2Y031807; Fri, 1 Mar 2013 06:56:43 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201303010656.r216uh2Y031807@svn.freebsd.org> From: Peter Holm <pho@FreeBSD.org> Date: Fri, 1 Mar 2013 06:56:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r247530 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" <svn-src-user.freebsd.org> List-Unsubscribe: <http://lists.freebsd.org/mailman/options/svn-src-user>, <mailto:svn-src-user-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-user> List-Post: <mailto:svn-src-user@freebsd.org> List-Help: <mailto:svn-src-user-request@freebsd.org?subject=help> List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/svn-src-user>, <mailto:svn-src-user-request@freebsd.org?subject=subscribe> X-List-Received-Date: Fri, 01 Mar 2013 06:56:44 -0000 Author: pho Date: Fri Mar 1 06:56:43 2013 New Revision: 247530 URL: http://svnweb.freebsd.org/changeset/base/247530 Log: Added two "umount -f" scenarios. Added: user/pho/stress2/misc/umountf5.sh (contents, props changed) user/pho/stress2/misc/umountf6.sh (contents, props changed) Added: user/pho/stress2/misc/umountf5.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/umountf5.sh Fri Mar 1 06:56:43 2013 (r247530) @@ -0,0 +1,63 @@ +#!/bin/sh + +# +# Copyright (c) 2008-2013 Peter Holm <pho@FreeBSD.org> +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Test with "umount -f" and SU + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +D=$diskimage +dd if=/dev/zero of=$D$m bs=1m count=10 2>&1 | + egrep -v "records|transferred" + +mount | grep "$mntpoint" | grep md${mdstart}$part > /dev/null && umount $mntpoint +mdconfig -l | grep md${mdstart} > /dev/null && mdconfig -d -u ${mdstart} + +mdconfig -a -t vnode -f $D -u ${mdstart} +bsdlabel -w md${mdstart} auto +newfs -U md${mdstart}$part > /dev/null 2>&1 +mount /dev/md${mdstart}$part $mntpoint + +export RUNDIR=$mntpoint/stressX +export runRUNTIME=2m +cd ..; ./run.sh vfs.cfg > /dev/null 2>&1 & +pid=$! + +sleep 30 + +umount -f $mntpoint +mdconfig -d -u $mdstart +rm -f $D + +while ps | egrep "testcases|swap|mkdir|creat" | grep -vq grep; do + ps | egrep "testcases|swap|mkdir|creat" | grep -v grep | awk '{print $1}' | xargs kill + sleep 1 +done Added: user/pho/stress2/misc/umountf6.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/umountf6.sh Fri Mar 1 06:56:43 2013 (r247530) @@ -0,0 +1,91 @@ +#!/bin/sh + +# +# Copyright (c) 2008-2013 Peter Holm <pho@FreeBSD.org> +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Variation of umountf4.sh; FS with "soft updates" + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +. ../default.cfg + +mounts=15 # Number of parallel scripts +mdstart=$mdstart # Use md unit numbers from this point +D=$diskimage + +if [ $# -eq 0 ]; then + for i in `jot $mounts`; do + m=$(( i + mdstart - 1 )) + [ ! -d ${mntpoint}$m ] && mkdir ${mntpoint}$m + mount | grep "$mntpoint" | grep -q md$m && umount ${mntpoint}$m + mdconfig -l | grep -q md$m && mdconfig -d -u $m + + dede $D$m 1m 10 + dd if=/dev/zero of=$D$m bs=1m count=10 2>&1 | + egrep -v "records|transferred" + mdconfig -a -t vnode -f $D$m -u $m + bsdlabel -w md$m auto + newfs -U md${m}$part > /dev/null 2>&1 + done + + # start the parallel tests + for i in `jot $mounts`; do + m=$((i + mdstart - 1)) + ./$0 $m & + ./$0 find & + done + + for i in `jot $mounts`; do + wait; wait + done + + for i in `jot $mounts`; do + m=$((i + mdstart - 1)) + mdconfig -d -u $m + rm -f $D$m + done + +else + if [ $1 = find ]; then + for i in `jot 100`; do + find ${mntpoint}* -type f > /dev/null 2>&1 + done + else + + # The test: Parallel mount and unmounts + for i in `jot 100`; do + m=$1 + opt=`[ $(( m % 2 )) -eq 0 ] && echo -f` + mount $opt /dev/md${m}$part ${mntpoint}$m + cp -r /usr/include/machine/a* ${mntpoint}$m + while mount | grep -qw $mntpoint$m; do + umount -f ${mntpoint}$m > /dev/null 2>&1 + done + done + fi +fi