Lines Matching +full:cost +full:- +full:effective
1 // SPDX-License-Identifier: GPL-2.0
11 * |---> [worker A]
12 * |---> [worker B]
13 * [combined queue] .---> [worker C]
14 * |---> [worker D]
15 * |---> [worker E]
17 * While the second model, enabled via --multiq option, uses multiple
23 * [queue A] ---> [worker]
24 * [queue B] ---> [worker]
25 * [queue C] ---> [worker]
26 * [queue D] ---> [worker]
27 * [queue E] ---> [worker]
52 * ... where [others] is the cost of re-adding the fd (EPOLLET),
83 #include <subcmd/parse-options.h>
106 static bool et; /* edge-trigger */
120 int epollfd; /* for --multiq */
140 OPT_BOOLEAN( 'E', "edge", &et, "Use Edge-triggered interface (default is LT)"),
153 * Only effective if N is much smaller than RAND_MAX;
155 * number generator. -- Ben Pfaff.
171 size_t j = i + rand() / (RAND_MAX / (n - i) + 1); in shuffle()
187 unsigned long ops = w->ops; in workerfn()
190 int to = nonblocking? 0 : -1; in workerfn()
191 int efd = multiq ? w->epollfd : epollfd; in workerfn()
194 threads_starting--; in workerfn()
234 close(w->epollfd); in workerfn()
236 w->ops = ops; in workerfn()
244 int efd = multiq ? w->epollfd : epollfd; in nest_epollfd()
262 for (i = nested - 1; i; i--) { in nest_epollfd()
263 if (epoll_ctl(epollfdp[i - 1], EPOLL_CTL_ADD, in nest_epollfd()
287 printf("\nAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n", in print_summary()
321 w->epollfd = epoll_create(1); in do_threads()
322 if (w->epollfd < 0) in do_threads()
329 w->tid = i; in do_threads()
330 w->fdmap = calloc(nfds, sizeof(int)); in do_threads()
331 if (!w->fdmap) in do_threads()
335 int efd = multiq ? w->epollfd : epollfd; in do_threads()
338 w->fdmap[j] = eventfd(0, EFD_NONBLOCK); in do_threads()
339 if (w->fdmap[j] < 0) in do_threads()
342 ev.data.fd = w->fdmap[j]; in do_threads()
346 w->fdmap[j], &ev); in do_threads()
365 ret = pthread_create(&w->thread, attrp, workerfn, in do_threads()
389 printinfo("starting writer-thread: doing %s writes ...\n", in writerfn()
401 shuffle((void *)w->fdmap, nfds, sizeof(int)); in writerfn()
406 sz = write(w->fdmap[j], &val, sizeof(val)); in writerfn()
414 printinfo("exiting writer-thread (total full-loops: %zd)\n", iter); in writerfn()
423 return w1->tid > w2->tid; in cmpworker()
469 nthreads = perf_cpu_map__nr(cpu) - 1; in bench_epoll_wait()
485 "%d file-descriptors for %d secs.\n\n", in bench_epoll_wait()
546 &worker[i].fdmap[nfds-1], t); in bench_epoll_wait()