Lines Matching +full:blocking +full:- +full:io

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]
37 * epoll_wait not finding any ready read events and blocking as this
40 * epoll_wait(2) blocking as the lineal writer thread will take "longer",
44 * not stress scenarios where multiple tasks are awoken per ready IO; ie:
52 * ... where [others] is the cost of re-adding the fd (EPOLLET),
58 * IO polling methods, for example. Hence everything is very adhoc and
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)"),
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()
314 w->epollfd = epoll_create(1); in do_threads()
315 if (w->epollfd < 0) in do_threads()
322 w->tid = i; in do_threads()
323 w->fdmap = calloc(nfds, sizeof(int)); in do_threads()
324 if (!w->fdmap) in do_threads()
328 int efd = multiq ? w->epollfd : epollfd; in do_threads()
331 w->fdmap[j] = eventfd(0, EFD_NONBLOCK); in do_threads()
332 if (w->fdmap[j] < 0) in do_threads()
335 ev.data.fd = w->fdmap[j]; in do_threads()
339 w->fdmap[j], &ev); in do_threads()
346 CPU_SET(cpu->map[i % cpu->nr], &cpuset); in do_threads()
355 ret = pthread_create(&w->thread, attrp, workerfn, in do_threads()
376 printinfo("starting writer-thread: doing %s writes ...\n", in writerfn()
388 shuffle((void *)w->fdmap, nfds, sizeof(int)); in writerfn()
393 sz = write(w->fdmap[j], &val, sizeof(val)); in writerfn()
401 printinfo("exiting writer-thread (total full-loops: %zd)\n", iter); in writerfn()
410 return w1->tid > w2->tid; in cmpworker()
456 nthreads = cpu->nr - 1; in bench_epoll_wait()
472 "%d file-descriptors for %d secs.\n\n", in bench_epoll_wait()
533 &worker[i].fdmap[nfds-1], t); in bench_epoll_wait()