From owner-svn-src-user@freebsd.org Fri Jun 5 15:09:05 2020 Return-Path: Delivered-To: svn-src-user@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B39332E555 for ; Fri, 5 Jun 2020 15:09:05 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49dmJK2HyYz446Q; Fri, 5 Jun 2020 15:09:05 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 31787127F0; Fri, 5 Jun 2020 15:09:05 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 055F95Ng065599; Fri, 5 Jun 2020 15:09:05 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 055F92FD065580; Fri, 5 Jun 2020 15:09:02 GMT (envelope-from pho@FreeBSD.org) Message-Id: <202006051509.055F92FD065580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 5 Jun 2020 15:09:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r361836 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 361836 X-SVN-Commit-Repository: base 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.33 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, 05 Jun 2020 15:09:05 -0000 Author: pho Date: Fri Jun 5 15:09:02 2020 New Revision: 361836 URL: https://svnweb.freebsd.org/changeset/base/361836 Log: Fix a copy/paste error in multiple files. Modified: user/pho/stress2/misc/callout_reset_on.sh user/pho/stress2/misc/sendfile.sh user/pho/stress2/misc/sendfile10.sh user/pho/stress2/misc/sendfile11.sh user/pho/stress2/misc/sendfile12.sh user/pho/stress2/misc/sendfile13.sh user/pho/stress2/misc/sendfile14.sh user/pho/stress2/misc/sendfile19.sh user/pho/stress2/misc/sendfile20.sh user/pho/stress2/misc/sendfile22.sh user/pho/stress2/misc/sendfile3.sh user/pho/stress2/misc/sendfile8.sh user/pho/stress2/misc/sendfile9.sh Modified: user/pho/stress2/misc/callout_reset_on.sh ============================================================================== --- user/pho/stress2/misc/callout_reset_on.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/callout_reset_on.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -253,7 +253,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile.sh ============================================================================== --- user/pho/stress2/misc/sendfile.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -163,7 +163,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile10.sh ============================================================================== --- user/pho/stress2/misc/sendfile10.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile10.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -38,9 +38,9 @@ dir=/tmp odir=`pwd` cd $dir -sed '1,/^EOF/d' < $odir/$0 > $dir/semdfile10.c -mycc -o semdfile10 -Wall -Wextra -O0 -g semdfile10.c || exit 1 -rm -f semdfile10.c +sed '1,/^EOF/d' < $odir/$0 > $dir/sendfile10.c +mycc -o sendfile10 -Wall -Wextra -O0 -g sendfile10.c || exit 1 +rm -f sendfile10.c cd $odir mount | grep "on $mntpoint " | grep -q /dev/md && umount -f $mntpoint @@ -51,8 +51,8 @@ newfs $newfs_flags -n md${mdstart}$part > /dev/null mount /dev/md${mdstart}$part $mntpoint cd $mntpoint -dd if=/dev/random of=template bs=1m count=50 2>&1 | egrep -v "records|transferred" -/tmp/semdfile10 template in out 76543 +dd if=/dev/random of=template bs=1m count=50 status=none +/tmp/sendfile10 template in out 76543 s=$? cd $odir @@ -62,7 +62,7 @@ for i in `jot 6`; do done [ $i -eq 6 ] && exit 1 mdconfig -d -u $mdstart -rm -rf /tmp/semdfile10 +rm -rf /tmp/sendfile10 exit $s EOF @@ -142,16 +142,18 @@ reader(void) { err(1, "listen(), %s:%d", __FILE__, __LINE__); len = sizeof(inetpeer); + alarm(10); if ((msgsock = accept(tcpsock, (struct sockaddr *)&inetpeer, &len)) < 0) err(1, "accept(), %s:%d", __FILE__, __LINE__); + alarm(0); t = 0; if ((buf = malloc(BUFSIZE)) == NULL) - err(1, "malloc(%d), %s:%d", BUFSIZE, __FILE__, __LINE__); + err(1, "malloc(%d), %s:%d", BUFSIZE, __FILE__, __LINE__); if ((fd = open(output, O_RDWR | O_CREAT | O_TRUNC, 0640)) == -1) - err(1, "open(%s)", output); + err(1, "open(%s)", output); for (;;) { if ((n = read(msgsock, buf, BUFSIZE)) < 0) @@ -207,7 +209,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile11.sh ============================================================================== --- user/pho/stress2/misc/sendfile11.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile11.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -32,6 +32,7 @@ # sendfile(2) && block size > page size: # panic: vnode_pager_generic_getpages: sector size 8192 too large +# https://people.freebsd.org/~pho/stress/log/sendfile11.txt . ../default.cfg @@ -179,7 +180,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile12.sh ============================================================================== --- user/pho/stress2/misc/sendfile12.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile12.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -180,7 +180,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile13.sh ============================================================================== --- user/pho/stress2/misc/sendfile13.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile13.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -48,7 +48,7 @@ cd $odir set -e size="$((`sysctl -n hw.usermem` / 2 / 1024 / 1024 / 1024))" -size="$((size * 8 / 10))g" +size="$((size * 7 / 10))g" [ "$size" = "0g" ] && exit 0 [ "$newfs_flags" = "-U" ] || exit 0 newfs_flags="-j" @@ -57,17 +57,17 @@ mp1=$mntpoint mkdir -p $mp1 md1=$mdstart mount | grep "on $mp1 " | grep -q /dev/md && umount -f $mp1 -[ -c /dev/md$md1 ] && mdconfig -d -u $md1 +[ -c /dev/md$md1 ] && mdconfig -d -u $md1 mdconfig -a -t swap -s $size -u $md1 bsdlabel -w md$md1 auto newfs $newfs_flags -n md${md1}$part > /dev/null 2>&1 mount /dev/md${md1}$part $mp1 -mp2=${mntpoint}2 -mkdir -p $mp2 md2=$((mdstart + 1)) +mp2=${mntpoint}$md2 +mkdir -p $mp2 mount | grep "on $mp2 " | grep -q /dev/md && umount -f $mp2 -[ -c /dev/md$md2 ] && mdconfig -d -u $md2 +[ -c /dev/md$md2 ] && mdconfig -d -u $md2 mdconfig -a -t swap -s $size -u $md2 bsdlabel -w md$md2 auto newfs $newfs_flags -n md${md2}$part > /dev/null 2>&1 @@ -75,16 +75,18 @@ mount /dev/md${md2}$part $mp2 set +e free=`df $mp1 | tail -1 | awk '{print $4}'` -$dir/sendfile13 5432 $mp1 $mp2 $((free * 8 / 10)) & -$dir/sendfile13 5433 $mp2 $mp1 $((free * 8 / 10)) & +$dir/sendfile13 5432 $mp1 $mp2 $((free / 2)) & +p1=$! +$dir/sendfile13 5433 $mp2 $mp1 $((free / 2)) & +p2=$! cd $odir -while [ ! -f $mp1/done ]; do - sleep 1 -done s=0 -wait +wait $p1; code=$? +[ $code -ne 0 ] && { s=$code; echo "$p1 exit status $code"; } +wait $p2; code=$? +[ $code -ne 0 ] && { s=$code; echo "$p2 exit status $code"; } [ -f sendfile13.core -a $s -eq 0 ] && - { ls -l sendfile13.core; mv sendfile13.core /tmp; s=1; } + { ls -l sendfile13.core; mv sendfile13.core /tmp; } cd $odir for i in `jot 6`; do @@ -93,8 +95,16 @@ for i in `jot 6`; do [ $i -eq 6 ] && { echo FATAL; fstat -mf $mp1; exit 1; } done +for i in `jot 6`; do + mount | grep -q "on $mp2 " || break + umount $mp2 && break || sleep 10 + [ $i -eq 6 ] && + { echo FATAL; fstat -mf $mp2; exit 1; } +done checkfs /dev/md${md1}$part || s=1 +checkfs /dev/md${md2}$part || s=1 mdconfig -d -u $md1 || s=1 +mdconfig -d -u $md2 || s=1 for i in `jot 6`; do mount | grep -q "on $mp2 " || break @@ -160,9 +170,6 @@ create(char *path, size_t size) close(ifd); files++; } - if ((fd = open("done", O_WRONLY | O_CREAT, 0640)) == -1) - err(1, "create(%s)", file); - close(fd); snprintf(help, sizeof(help), "umount %s 2>&1 | grep -v 'Device busy'", path); system(help); @@ -211,11 +218,13 @@ server(void) idx = 0; len = sizeof(inetpeer); for (;;) { + alarm(120); if ((msgsock = accept(tcpsock, (struct sockaddr *)&inetpeer, &len)) < 0) err(1, "accept(), %s:%d", __FILE__, __LINE__); if ((pid = fork()) == 0) { + alarm(120); t = 0; if ((buf = malloc(BUFSIZE)) == NULL) err(1, "malloc(%d), %s:%d", BUFSIZE, @@ -237,7 +246,7 @@ server(void) if (n == 0) break; if ((write(fd, buf, n)) != n) - err(1, "write"); + err(1, "write n=%d", n); } close(msgsock); close(fd); @@ -262,6 +271,7 @@ writer(char *inputFile) { size_t size; int i, fd, on, r, tcpsock; + alarm(120); on = 1; for (i = 1; i < 5; i++) { if ((tcpsock = socket(AF_INET, SOCK_STREAM, 0)) < 0) @@ -282,7 +292,6 @@ writer(char *inputFile) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); @@ -304,7 +313,7 @@ writer(char *inputFile) { if (sendfile(fd, tcpsock, 0, statb.st_size, NULL, &off, SF_NOCACHE) == -1) - err(1, "sendfile"); + warn("sendfile()"); close(fd); return; @@ -327,7 +336,7 @@ main(int argc, char *argv[]) { pid_t spid; size_t size; - int e, i; + int i, status; if (argc != 5) { fprintf(stderr, @@ -340,7 +349,6 @@ main(int argc, char *argv[]) if (chdir(fromdir) == -1) err(1, "chdir(%s)", fromdir); todir = argv[3]; - e = 0; sscanf(argv[4], "%zd", &size); size = size * 1024; create(fromdir, size); @@ -352,8 +360,14 @@ main(int argc, char *argv[]) move(i); sleep(10); } - if (waitpid(spid, NULL, 0) != spid) + if (waitpid(spid, &status, 0) != spid) err(1, "waitpid"); + if (status != 0) { + if (WIFSIGNALED(status)) + fprintf(stderr, + "pid %d exit signal %d\n", + spid, WTERMSIG(status)); + } - return (e); + return (status == 0 ? 0 : 1); } Modified: user/pho/stress2/misc/sendfile14.sh ============================================================================== --- user/pho/stress2/misc/sendfile14.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile14.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -286,7 +286,6 @@ writer(char *inputFile) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile19.sh ============================================================================== --- user/pho/stress2/misc/sendfile19.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile19.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -196,7 +196,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile20.sh ============================================================================== --- user/pho/stress2/misc/sendfile20.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile20.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -197,7 +197,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile22.sh ============================================================================== --- user/pho/stress2/misc/sendfile22.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile22.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -156,7 +156,6 @@ test(void) sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile3.sh ============================================================================== --- user/pho/stress2/misc/sendfile3.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile3.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -162,7 +162,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile8.sh ============================================================================== --- user/pho/stress2/misc/sendfile8.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile8.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -191,7 +191,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr); Modified: user/pho/stress2/misc/sendfile9.sh ============================================================================== --- user/pho/stress2/misc/sendfile9.sh Fri Jun 5 15:06:58 2020 (r361835) +++ user/pho/stress2/misc/sendfile9.sh Fri Jun 5 15:09:02 2020 (r361836) @@ -190,7 +190,6 @@ writer(void) { sizeof (struct in_addr)); inetaddr.sin_family = AF_INET; - inetaddr.sin_addr.s_addr = INADDR_ANY; inetaddr.sin_port = htons(port); inetaddr.sin_len = sizeof(inetaddr);