From owner-svn-src-user@freebsd.org Mon Oct 5 06:40:11 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 3E1CCA10977 for ; Mon, 5 Oct 2015 06:40:11 +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 2CC2EEB8; Mon, 5 Oct 2015 06:40:11 +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 t956eBP6054475; Mon, 5 Oct 2015 06:40:11 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t956eAJJ054471; Mon, 5 Oct 2015 06:40:10 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201510050640.t956eAJJ054471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 5 Oct 2015 06:40:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r288691 - 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: Mon, 05 Oct 2015 06:40:11 -0000 Author: pho Date: Mon Oct 5 06:40:09 2015 New Revision: 288691 URL: https://svnweb.freebsd.org/changeset/base/288691 Log: These tests would run for an unreasonable long time. Fixed that. Sponsored by: EMC / Isilon storage division Modified: user/pho/stress2/misc/mmap10.sh user/pho/stress2/misc/mmap11.sh user/pho/stress2/misc/mmap15.sh user/pho/stress2/misc/mmap22.sh Modified: user/pho/stress2/misc/mmap10.sh ============================================================================== --- user/pho/stress2/misc/mmap10.sh Mon Oct 5 05:33:30 2015 (r288690) +++ user/pho/stress2/misc/mmap10.sh Mon Oct 5 06:40:09 2015 (r288691) @@ -43,11 +43,16 @@ mycc -o mmap10 -Wall -Wextra -O2 -g mmap rm -f mmap10.c daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)" -rnd=`od -An -N1 -t u1 /dev/random | sed 's/ //g'` -sleep $((rnd % 10)) +sleep `jot -r 1 0 9` for i in `jot 2`; do - /tmp/mmap10 + /tmp/mmap10 & done +sleep 300 +while pgrep -q mmap10; do + pkill -9 mmap10 + sleep 2 +done +wait killall -q swap rm -f /tmp/mmap10 /tmp/mmap10.core @@ -56,7 +61,6 @@ EOF #include #include #include -#include #include #include @@ -64,15 +68,13 @@ EOF #include #include #include -#include -#include #include #include #include -#include #include #define LOOPS 2 +#define MMSIZE (192 * 1024 * 1024) #define N (128 * 1024 / (int)sizeof(u_int32_t)) #define PARALLEL 50 @@ -122,12 +124,12 @@ void * tmmap(void *arg __unused) { size_t len; - int i, fd; + int i, j, fd; pthread_set_name_np(pthread_self(), __func__); - len = 1LL * 1024 * 1024 * 1024; + len = MMSIZE; - for (i = 0; i < 100; i++) { + for (i = 0, j = 0; i < 100; i++) { if ((fd = open("/dev/zero", O_RDWR)) == -1) err(1,"open()"); @@ -135,15 +137,19 @@ tmmap(void *arg __unused) fd, 0)) != MAP_FAILED) { usleep(100); munmap(p, len); + j++; } if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0)) != MAP_FAILED) { usleep(100); munmap(p, len); + j++; } close(fd); } + if (j == 0) + fprintf(stderr, "FAIL: all mmap(2) calls failed.\n"); return (NULL); } @@ -255,7 +261,6 @@ main(void) for (i = 0; i < N; i++) r[i] = arc4random(); - alarm(1200); for (i = 0; i < LOOPS; i++) { for (j = 0; j < PARALLEL; j++) { if (fork() == 0) Modified: user/pho/stress2/misc/mmap11.sh ============================================================================== --- user/pho/stress2/misc/mmap11.sh Mon Oct 5 05:33:30 2015 (r288690) +++ user/pho/stress2/misc/mmap11.sh Mon Oct 5 06:40:09 2015 (r288691) @@ -46,11 +46,16 @@ mycc -o mmap11 -Wall -Wextra -O2 -g mmap rm -f mmap11.c daemon sh -c "(cd $here/../testcases/swap; ./swap -t 2m -i 20 -k)" -rnd=`od -An -N1 -t u1 /dev/random | sed 's/ //g'` -sleep $((rnd % 10)) +sleep `jot -r 1 0 9` for i in `jot 2`; do - /tmp/mmap11 + /tmp/mmap11 & done +sleep 300 +while pgrep -q mmap11; do + pkill -9 mmap11 + sleep 2 +done +wait killall -q swap rm -f /tmp/mmap11 /tmp/mmap11.core @@ -59,7 +64,6 @@ EOF #include #include #include -#include #include #include @@ -67,15 +71,13 @@ EOF #include #include #include -#include -#include #include #include #include -#include #include #define LOOPS 2 +#define MMSIZE (192 * 1024 * 1024) #define N (128 * 1024 / (int)sizeof(u_int32_t)) #define PARALLEL 50 @@ -125,12 +127,12 @@ void * tmmap(void *arg __unused) { size_t len; - int i, fd; + int i, j, fd; pthread_set_name_np(pthread_self(), __func__); - len = 1LL * 1024 * 1024 * 1024; + len = MMSIZE; - for (i = 0; i < 100; i++) { + for (i = 0, j = 0; i < 100; i++) { if ((fd = open("/dev/zero", O_RDWR)) == -1) err(1,"open()"); @@ -138,15 +140,19 @@ tmmap(void *arg __unused) fd, 0)) != MAP_FAILED) { usleep(100); munmap(p, len); + j++; } if ((p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0)) != MAP_FAILED) { usleep(100); munmap(p, len); + j++; } close(fd); } + if (j == 0) + fprintf(stderr, "FAIL: all mmap(2) calls failed.\n"); return (NULL); } Modified: user/pho/stress2/misc/mmap15.sh ============================================================================== --- user/pho/stress2/misc/mmap15.sh Mon Oct 5 05:33:30 2015 (r288690) +++ user/pho/stress2/misc/mmap15.sh Mon Oct 5 06:40:09 2015 (r288691) @@ -49,8 +49,14 @@ mycc -o mmap15 -Wall -Wextra -O2 -g mmap rm -f mmap15.c for i in `jot 2`; do - su $testuser -c /tmp/mmap15 + su $testuser -c /tmp/mmap15 & done +sleep 300 +while pgrep -q mmap15; do + pkill -9 mmap15 + sleep 2 +done +wait rm -f /tmp/mmap15 /tmp/mmap15.core exit 0 @@ -74,6 +80,7 @@ EOF #include #define LOOPS 2 +#define MMSIZE (256 * 1024) #define N (128 * 1024 / (int)sizeof(u_int32_t)) #define PARALLEL 50 @@ -123,17 +130,23 @@ void * tmmap(void *arg __unused) { size_t len; - int i, fd; + int i, j, fd; pthread_set_name_np(pthread_self(), __func__); - len = 1LL * 128 * 1024 * 1024; + len = MMSIZE; if ((fd = open("/dev/zero", O_RDWR)) == -1) err(1,"open()"); - for (i = 0; i < 100; i++) { + for (i = 0, j = 0; i < 100; i++) { p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); + if (p != MAP_FAILED) + j++; p = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_ANON, -1, 0); + if (p != MAP_FAILED) + j++; } + if (j == 0) + fprintf(stderr, "FAIL: all mmap(2) calls failed.\n"); close(fd); return (NULL); @@ -195,7 +208,6 @@ main(void) { int i, j; - alarm(120); for (i = 0; i < N; i++) r[i] = arc4random(); Modified: user/pho/stress2/misc/mmap22.sh ============================================================================== --- user/pho/stress2/misc/mmap22.sh Mon Oct 5 05:33:30 2015 (r288690) +++ user/pho/stress2/misc/mmap22.sh Mon Oct 5 06:40:09 2015 (r288691) @@ -46,11 +46,14 @@ sed '1,/^EOF/d' < $here/$0 > mmap22.c mycc -o mmap22 -Wall -Wextra -O2 -g mmap22.c -lpthread || exit 1 rm -f mmap22.c -su $testuser -c /tmp/mmap22 +su $testuser -c /tmp/mmap22 & +sleep 300 while pgrep -q mmap22; do + pkill -9 mmap22 sleep 2 done +wait rm -f /tmp/mmap22 /tmp/mmap22.core exit 0 @@ -69,10 +72,9 @@ EOF #include #include -#define LOOPS 1 #define MMAPS 25 -#define PARALLEL 10 -#define SIZ (128 * 1024 * 1024) +#define PARALLEL 4 +#define SIZ (64 * 1024 * 1024) void * tmmap(void *arg __unused) @@ -118,7 +120,6 @@ main(void) { int i; - alarm(120); for (i = 0; i < PARALLEL; i++) { if (fork() == 0) test();