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);
187 unsigned long ops = w->ops;
190 int to = nonblocking? 0 : -1;
191 int efd = multiq ? w->epollfd : epollfd;
194 threads_starting--;
234 close(w->epollfd);
236 w->ops = ops;
244 int efd = multiq ? w->epollfd : epollfd;
262 for (i = nested - 1; i; i--) {
263 if (epoll_ctl(epollfdp[i - 1], EPOLL_CTL_ADD,
287 printf("\nAveraged %ld operations/sec (+- %.2f%%), total secs = %d\n",
321 w->epollfd = epoll_create(1);
322 if (w->epollfd < 0)
329 w->tid = i;
330 w->fdmap = calloc(nfds, sizeof(int));
331 if (!w->fdmap)
335 int efd = multiq ? w->epollfd : epollfd;
338 w->fdmap[j] = eventfd(0, EFD_NONBLOCK);
339 if (w->fdmap[j] < 0)
342 ev.data.fd = w->fdmap[j];
346 w->fdmap[j], &ev);
365 ret = pthread_create(&w->thread, attrp, workerfn,
389 printinfo("starting writer-thread: doing %s writes ...\n",
401 shuffle((void *)w->fdmap, nfds, sizeof(int));
406 sz = write(w->fdmap[j], &val, sizeof(val));
414 printinfo("exiting writer-thread (total full-loops: %zd)\n", iter);
424 if (w1->tid > w2->tid)
426 if (w1->tid < w2->tid)
427 return -1;
474 nthreads = perf_cpu_map__nr(cpu) - 1;
490 "%d file-descriptors for %d secs.\n\n",
551 &worker[i].fdmap[nfds-1], t);