Lines Matching +full:parallel +full:- +full:in
4 # SPDX-License-Identifier: BSD-2-Clause
8 # Redistribution and use in source and binary forms, with or without
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
20 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
54 #define PARALLEL 10
64 innerloop(int parallel)
71 for (i = 0; i < parallel; i++) {
76 if (sigaction(SIGUSR1, &sa, NULL) == -1)
84 if (pids[i] == -1)
87 for (i = 0; i < parallel; i++) {
89 err(1, "waitpid(%d) in looper", pids[i]);
100 int i, parallel;
106 if (sigaction(SIGUSR1, &sa, NULL) == -1)
113 setegid(pw->pw_gid) || setgid(pw->pw_gid) ||
114 seteuid(pw->pw_uid) || setuid(pw->pw_uid))
119 parallel = arc4random() % MAXP + 1;
120 parallel = parallel / PARALLEL * PARALLEL;
121 for (i = 0; i < PARALLEL; i++) {
123 innerloop(parallel / PARALLEL);
125 while (atomic_load(&share[RDY]) != parallel)
127 if (killpg(share[GID], SIGUSR1) == -1)
131 err(1, "waitpid(%d) in looper", pids[i]);
145 MAP_ANON | MAP_SHARED, -1, 0)) == MAP_FAILED)
149 while (time(NULL) - start < 120) {
161 sed -i '' "s#TUSER#$testuser#" /tmp/$prog.c
162 mycc -o /tmp/$prog -Wall -Wextra -O0 /tmp/$prog.c || exit 1
169 ../testcases/swap/swap -t 2m -i 20 > /dev/null &
172 while kill -0 $pid > /dev/null 2>&1; do
173 e=$((`date +%s` - st))
174 if [ $e -ge 120 ]; then
175 while pgrep -q swap; do pkill swap; done
177 if [ $e -ge 600 ]; then
178 echo "Failed in loop #$n after $e seconds."
179 ps -jU$testuser | head -20
181 pkill -U$testuser
183 rm -f /tmp/$prog
188 [ $((`date +%s` - start)) -ge 300 ] && break