From owner-svn-src-user@freebsd.org Thu Sep 17 08:54:51 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AAF09CEC4B for ; Thu, 17 Sep 2015 08:54:51 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C486149D; Thu, 17 Sep 2015 08:54:51 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8H8spc4090124; Thu, 17 Sep 2015 08:54:51 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8H8soWg090118; Thu, 17 Sep 2015 08:54:50 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201509170854.t8H8soWg090118@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Thu, 17 Sep 2015 08:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r287910 - 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.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2015 08:54:51 -0000 Author: pho Date: Thu Sep 17 08:54:49 2015 New Revision: 287910 URL: https://svnweb.freebsd.org/changeset/base/287910 Log: The combination of SUJ and NULLFS(5) has known issues. Skip tests until this is resolved. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/nullfs2.sh user/pho/stress2/misc/nullfs3.sh user/pho/stress2/misc/nullfs5.sh user/pho/stress2/misc/nullfs7.sh Modified: user/pho/stress2/misc/nullfs2.sh ============================================================================== --- user/pho/stress2/misc/nullfs2.sh Thu Sep 17 07:04:15 2015 (r287909) +++ user/pho/stress2/misc/nullfs2.sh Thu Sep 17 08:54:49 2015 (r287910) @@ -38,6 +38,11 @@ . ../default.cfg +# NULLFS(5) and SUJ has known issues. +mount | grep "on `df $RUNDIR | sed '1d;s/.* //'` " | \ + grep -q "journaled soft-updates" && + { echo "Skipping test due to SUJ."; exit 0; } + mount | grep -q "on $mntpoint " && umount -f $mntpoint mount -t nullfs $RUNDIR $mntpoint Modified: user/pho/stress2/misc/nullfs3.sh ============================================================================== --- user/pho/stress2/misc/nullfs3.sh Thu Sep 17 07:04:15 2015 (r287909) +++ user/pho/stress2/misc/nullfs3.sh Thu Sep 17 08:54:49 2015 (r287910) @@ -36,6 +36,11 @@ . ../default.cfg +# NULLFS(5) and SUJ has known issues. +mount | grep "on `df $RUNDIR | sed '1d;s/.* //'` " | \ + grep -q "journaled soft-updates" && + { echo "Skipping test due to SUJ."; exit 0; } + [ -d $RUNDIR/stressX ] || mkdir -p $RUNDIR/stressX mp=$mntpoint Modified: user/pho/stress2/misc/nullfs5.sh ============================================================================== --- user/pho/stress2/misc/nullfs5.sh Thu Sep 17 07:04:15 2015 (r287909) +++ user/pho/stress2/misc/nullfs5.sh Thu Sep 17 08:54:49 2015 (r287910) @@ -28,15 +28,26 @@ # $FreeBSD$ # -# Composit test: nullfs2.sh + kinfo.sh +# Composite test: nullfs2.sh + kinfo.sh # Kernel page fault with the following non-sleepable locks held from # nullfs/null_vnops.c:531 +# Fatal trap 12: page fault while in kernel mode +# https://people.freebsd.org/~pho/stress/log/jeff106.txt + +# panic: vholdl: inactive held vnode: +# https://people.freebsd.org/~pho/stress/log/kostik815.txt + [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 . ../default.cfg +# NULLFS(5) and SUJ has known issues. +mount | grep "on `df $RUNDIR | sed '1d;s/.* //'` " | \ + grep -q "journaled soft-updates" && + { echo "Skipping test due to SUJ."; exit 0; } + odir=`pwd` cd /tmp sed '1,/^EOF/d;s/60/600/' < $odir/kinfo.sh > kinfo.c @@ -62,7 +73,5 @@ umount $mntpoint 2>&1 | grep -v busy mount | grep -q $mntpoint && umount -f $mntpoint -for j in `jot 5`; do - wait -done +wait rm -f /tmp/kinfo Modified: user/pho/stress2/misc/nullfs7.sh ============================================================================== --- user/pho/stress2/misc/nullfs7.sh Thu Sep 17 07:04:15 2015 (r287909) +++ user/pho/stress2/misc/nullfs7.sh Thu Sep 17 08:54:49 2015 (r287910) @@ -36,6 +36,11 @@ . ../default.cfg +# NULLFS(5) and SUJ has known issues. +mount | grep "on `df $RUNDIR | sed '1d;s/.* //'` " | \ + grep -q "journaled soft-updates" && + { echo "Skipping test due to SUJ."; exit 0; } + mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart From owner-svn-src-user@freebsd.org Fri Sep 18 12:50:04 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DE279CDA02 for ; Fri, 18 Sep 2015 12:50:04 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E70251952; Fri, 18 Sep 2015 12:50:03 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8ICo3fw033110; Fri, 18 Sep 2015 12:50:03 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8ICo3Fh033109; Fri, 18 Sep 2015 12:50:03 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201509181250.t8ICo3Fh033109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 18 Sep 2015 12:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r287958 - 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.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2015 12:50:04 -0000 Author: pho Date: Fri Sep 18 12:50:03 2015 New Revision: 287958 URL: https://svnweb.freebsd.org/changeset/base/287958 Log: Added a regression test. Sponsored by: EMC / Isilon storage division Added: user/pho/stress2/misc/mlockall5.sh (contents, props changed) Added: user/pho/stress2/misc/mlockall5.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mlockall5.sh Fri Sep 18 12:50:03 2015 (r287958) @@ -0,0 +1,167 @@ +#!/bin/sh + +# +# Copyright (c) 2015 EMC Corp. +# 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$ +# + +# Regression test for r287591: + +# From the commit log: +# Remove a check which caused spurious SIGSEGV on usermode access to the +# mapped address without valid pte installed, when parallel wiring of +# the entry happen. The entry must be copy on write. If entry is COW +# but was already copied, and parallel wiring set +# MAP_ENTRY_IN_TRANSITION, vm_fault() would sleep waiting for the +# MAP_ENTRY_IN_TRANSITION flag to clear. After that, the fault handler +# is restarted and vm_map_lookup() or vm_map_lookup_locked() trip over +# the check. Note that this is race, if the address is accessed after +# the wiring is done, the entry does not fault at all. + +# Test scenario by kib@. + +. ../default.cfg + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +dir=/tmp +odir=`pwd` +cd $dir +sed '1,/^EOF/d' < $odir/$0 > $dir/mlockall5.c +mycc -o mlockall5 -Wall -Wextra -O0 -g mlockall5.c -lpthread || exit 1 +rm -f mlockall5.c +cd $odir + +mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 512m -u $mdstart || exit 1 +bsdlabel -w md$mdstart auto +newfs $newfs_flags -n md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint || exit 1 + +(cd $mntpoint; /tmp/mlockall5 || echo FAIL) + +n=0 +while mount | grep "on $mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 + n=$((n + 1)) + [ $n -gt 10 ] && { echo FAIL; exit 1; } +done +mdconfig -d -u $mdstart +rm -rf /tmp/mlockall5 +exit + +EOF +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +size_t clen; +volatile u_int share; +int ps; +char *c; + +void * +touch(void *arg __unused) +{ + + int i; + + while (share == 0) + ; + for (i = 0; i < (int)clen; i += ps) + c[i] = 1; + + return (NULL); +} + +void * +ml(void *arg __unused) +{ + while (share == 0) + ; + if (mlockall(MCL_CURRENT | MCL_FUTURE) == -1) + err(1, "mlock"); + + return (NULL); +} + +int +test(void) +{ + pthread_t tid[2]; + int i, rc, status; + + if (fork() == 0) { + alarm(60); + rc = pthread_create(&tid[0], NULL, touch, NULL); + if (rc != 0) + errc(1, rc, "pthread_create()"); + rc = pthread_create(&tid[1], NULL, ml, NULL); + if (rc != 0) + errc(1, rc, "pthread_create()"); + atomic_add_int(&share, 1); + for (i = 0; i < (int)nitems(tid); i++) { + rc = pthread_join(tid[i], NULL); + if (rc != 0) + errc(1, rc, "pthread_join(%d)", i); + } + _exit(0); + } + + + if (wait(&status) == -1) + err(1, "wait"); + + return (WTERMSIG(status)); +} + +int +main(void) +{ + int s; + + ps = getpagesize(); + clen = 32 * 1024; + if ((c = mmap(NULL, clen, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED, + -1, 0)) == MAP_FAILED) + err(1, "mmap"); + + s = test(); + + return (s); +} From owner-svn-src-user@freebsd.org Fri Sep 18 17:17:41 2015 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCC169CF95C for ; Fri, 18 Sep 2015 17:17:41 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA68E141A; Fri, 18 Sep 2015 17:17:41 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8IHHfdD070950; Fri, 18 Sep 2015 17:17:41 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8IHHfUP070949; Fri, 18 Sep 2015 17:17:41 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201509181717.t8IHHfUP070949@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 18 Sep 2015 17:17:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r287962 - 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.20 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2015 17:17:41 -0000 Author: pho Date: Fri Sep 18 17:17:40 2015 New Revision: 287962 URL: https://svnweb.freebsd.org/changeset/base/287962 Log: No need to use atomic_*. Pointed out by: kib Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/mlockall5.sh Modified: user/pho/stress2/misc/mlockall5.sh ============================================================================== --- user/pho/stress2/misc/mlockall5.sh Fri Sep 18 17:09:59 2015 (r287961) +++ user/pho/stress2/misc/mlockall5.sh Fri Sep 18 17:17:40 2015 (r287962) @@ -80,8 +80,6 @@ EOF #include #include -#include - #include #include #include @@ -134,7 +132,7 @@ test(void) rc = pthread_create(&tid[1], NULL, ml, NULL); if (rc != 0) errc(1, rc, "pthread_create()"); - atomic_add_int(&share, 1); + share = 1; for (i = 0; i < (int)nitems(tid); i++) { rc = pthread_join(tid[i], NULL); if (rc != 0)