source: libcfa/src/concurrency/io.cfa@ 1a567d0

ADT ast-experimental enum pthread-emulation qualifiedEnum
Last change on this file since 1a567d0 was 4479890, checked in by Thierry Delisle <tdelisle@…>, 4 years ago

Implemented helping for io drain based on timestamps.

  • Property mode set to 100644
File size: 19.6 KB
Line 
1//
2// Cforall Version 1.0.0 Copyright (C) 2020 University of Waterloo
3//
4// The contents of this file are covered under the licence agreement in the
5// file "LICENCE" distributed with Cforall.
6//
7// io.cfa --
8//
9// Author : Thierry Delisle
10// Created On : Thu Apr 23 17:31:00 2020
11// Last Modified By :
12// Last Modified On :
13// Update Count :
14//
15
16#define __cforall_thread__
17#define _GNU_SOURCE
18
19#if defined(__CFA_DEBUG__)
20 // #define __CFA_DEBUG_PRINT_IO__
21 // #define __CFA_DEBUG_PRINT_IO_CORE__
22#endif
23
24
25#if defined(CFA_HAVE_LINUX_IO_URING_H)
26 #include <errno.h>
27 #include <signal.h>
28 #include <stdint.h>
29 #include <string.h>
30 #include <unistd.h>
31
32 extern "C" {
33 #include <sys/syscall.h>
34 #include <sys/eventfd.h>
35 #include <sys/uio.h>
36
37 #include <linux/io_uring.h>
38 }
39
40 #include "stats.hfa"
41 #include "kernel.hfa"
42 #include "kernel/fwd.hfa"
43 #include "kernel/private.hfa"
44 #include "kernel/cluster.hfa"
45 #include "io/types.hfa"
46
47 __attribute__((unused)) static const char * opcodes[] = {
48 "OP_NOP",
49 "OP_READV",
50 "OP_WRITEV",
51 "OP_FSYNC",
52 "OP_READ_FIXED",
53 "OP_WRITE_FIXED",
54 "OP_POLL_ADD",
55 "OP_POLL_REMOVE",
56 "OP_SYNC_FILE_RANGE",
57 "OP_SENDMSG",
58 "OP_RECVMSG",
59 "OP_TIMEOUT",
60 "OP_TIMEOUT_REMOVE",
61 "OP_ACCEPT",
62 "OP_ASYNC_CANCEL",
63 "OP_LINK_TIMEOUT",
64 "OP_CONNECT",
65 "OP_FALLOCATE",
66 "OP_OPENAT",
67 "OP_CLOSE",
68 "OP_FILES_UPDATE",
69 "OP_STATX",
70 "OP_READ",
71 "OP_WRITE",
72 "OP_FADVISE",
73 "OP_MADVISE",
74 "OP_SEND",
75 "OP_RECV",
76 "OP_OPENAT2",
77 "OP_EPOLL_CTL",
78 "OP_SPLICE",
79 "OP_PROVIDE_BUFFERS",
80 "OP_REMOVE_BUFFERS",
81 "OP_TEE",
82 "INVALID_OP"
83 };
84
85 static $io_context * __ioarbiter_allocate( $io_arbiter & this, __u32 idxs[], __u32 want );
86 static void __ioarbiter_submit( $io_context * , __u32 idxs[], __u32 have, bool lazy );
87 static void __ioarbiter_flush ( $io_context & );
88 static inline void __ioarbiter_notify( $io_context & ctx );
89//=============================================================================================
90// I/O Polling
91//=============================================================================================
92 static inline unsigned __flush( struct $io_context & );
93 static inline __u32 __release_sqes( struct $io_context & );
94 extern void __kernel_unpark( thread$ * thrd, unpark_hint );
95
96 static bool __cfa_do_drain( $io_context * ctx, cluster * cltr ) {
97 /* paranoid */ verify( ! __preemption_enabled() );
98 /* paranoid */ verify( ready_schedule_islocked() );
99 /* paranoid */ verify( ctx );
100
101 // Drain the queue
102 unsigned head = *ctx->cq.head;
103 unsigned tail = *ctx->cq.tail;
104 const __u32 mask = *ctx->cq.mask;
105
106 __u32 count = tail - head;
107 __STATS__( false, io.calls.drain++; io.calls.completed += count; )
108
109 if(count == 0) return false;
110
111 if(!__atomic_try_acquire(&ctx->cq.lock)) {
112 return false;
113 }
114
115 unsigned long long ts_prev = ctx->cq.ts;
116
117 for(i; count) {
118 unsigned idx = (head + i) & mask;
119 volatile struct io_uring_cqe & cqe = ctx->cq.cqes[idx];
120
121 /* paranoid */ verify(&cqe);
122
123 struct io_future_t * future = (struct io_future_t *)(uintptr_t)cqe.user_data;
124 __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", &cqe, cqe.res, future );
125
126 __kernel_unpark( fulfil( *future, cqe.res, false ), UNPARK_LOCAL );
127 }
128
129 __cfadbg_print_safe(io, "Kernel I/O : %u completed\n", count);
130 unsigned long long ts_next = ctx->cq.ts = rdtscl();
131
132 // Mark to the kernel that the cqe has been seen
133 // Ensure that the kernel only sees the new value of the head index after the CQEs have been read.
134 __atomic_store_n( ctx->cq.head, head + count, __ATOMIC_SEQ_CST );
135
136 /* paranoid */ verify( ready_schedule_islocked() );
137 /* paranoid */ verify( ! __preemption_enabled() );
138
139 __atomic_unlock(&ctx->cq.lock);
140
141 touch_tsc( cltr->sched.io.tscs, ctx->cq.id, ts_prev, ts_next );
142
143 return true;
144 }
145
146 bool __cfa_io_drain( processor * proc ) {
147 bool local = false;
148 bool remote = false;
149
150 cluster * const cltr = proc->cltr;
151 $io_context * const ctx = proc->io.ctx;
152 /* paranoid */ verify( cltr );
153 /* paranoid */ verify( ctx );
154
155 with(cltr->sched) {
156 const size_t ctxs_count = io.count;
157
158 /* paranoid */ verify( ready_schedule_islocked() );
159 /* paranoid */ verify( ! __preemption_enabled() );
160 /* paranoid */ verify( active_processor() == proc );
161 /* paranoid */ verify( __shard_factor.io > 0 );
162 /* paranoid */ verify( ctxs_count > 0 );
163 /* paranoid */ verify( ctx->cq.id < ctxs_count );
164
165 const unsigned this_cache = cache_id(cltr, ctx->cq.id / __shard_factor.io);
166 const unsigned long long ctsc = rdtscl();
167
168 if(proc->io.target == MAX) {
169 uint64_t chaos = __tls_rand();
170 unsigned ext = chaos & 0xff;
171 unsigned other = (chaos >> 8) % (ctxs_count);
172
173 if(ext < 3 || __atomic_load_n(&caches[other / __shard_factor.io].id, __ATOMIC_RELAXED) == this_cache) {
174 proc->io.target = other;
175 }
176 }
177 else {
178 const unsigned target = proc->io.target;
179 /* paranoid */ verify( io.tscs[target].tv != MAX );
180 if(target < ctxs_count) {
181 const unsigned long long cutoff = calc_cutoff(ctsc, ctx->cq.id, ctxs_count, io.data, io.tscs, __shard_factor.io);
182 const unsigned long long age = moving_average(ctsc, io.tscs[target].tv, io.tscs[target].ma);
183 // __cfadbg_print_safe(ready_queue, "Kernel : Help attempt on %u from %u, age %'llu vs cutoff %'llu, %s\n", target, this, age, cutoff, age > cutoff ? "yes" : "no");
184 if(age > cutoff) {
185 remote = __cfa_do_drain( io.data[target], cltr );
186 }
187 }
188 proc->io.target = MAX;
189 }
190 }
191
192
193 // Drain the local queue
194 local = __cfa_do_drain( proc->io.ctx, cltr );
195
196 /* paranoid */ verify( ready_schedule_islocked() );
197 /* paranoid */ verify( ! __preemption_enabled() );
198 /* paranoid */ verify( active_processor() == proc );
199 return local || remote;
200 }
201
202 bool __cfa_io_flush( processor * proc, int min_comp ) {
203 /* paranoid */ verify( ! __preemption_enabled() );
204 /* paranoid */ verify( proc );
205 /* paranoid */ verify( proc->io.ctx );
206
207 cluster * cltr = proc->cltr;
208 $io_context & ctx = *proc->io.ctx;
209
210 __ioarbiter_flush( ctx );
211
212 if(ctx.sq.to_submit != 0 || min_comp > 0) {
213
214 __STATS__( true, io.calls.flush++; )
215 int ret = syscall( __NR_io_uring_enter, ctx.fd, ctx.sq.to_submit, min_comp, min_comp > 0 ? IORING_ENTER_GETEVENTS : 0, (sigset_t *)0p, _NSIG / 8);
216 if( ret < 0 ) {
217 switch((int)errno) {
218 case EAGAIN:
219 case EINTR:
220 case EBUSY:
221 // Update statistics
222 __STATS__( false, io.calls.errors.busy ++; )
223 return false;
224 default:
225 abort( "KERNEL ERROR: IO_URING SYSCALL - (%d) %s\n", (int)errno, strerror(errno) );
226 }
227 }
228
229 __cfadbg_print_safe(io, "Kernel I/O : %u submitted to io_uring %d\n", ret, ctx.fd);
230 __STATS__( true, io.calls.submitted += ret; )
231 /* paranoid */ verify( ctx.sq.to_submit <= *ctx.sq.num );
232 /* paranoid */ verify( ctx.sq.to_submit >= ret );
233
234 ctx.sq.to_submit -= ret;
235
236 /* paranoid */ verify( ctx.sq.to_submit <= *ctx.sq.num );
237
238 // Release the consumed SQEs
239 __release_sqes( ctx );
240
241 /* paranoid */ verify( ! __preemption_enabled() );
242
243 __atomic_store_n(&ctx.proc->io.pending, false, __ATOMIC_RELAXED);
244 }
245
246 ready_schedule_lock();
247 bool ret = __cfa_io_drain( proc );
248 ready_schedule_unlock();
249 return ret;
250 }
251
252//=============================================================================================
253// I/O Submissions
254//=============================================================================================
255
256// Submition steps :
257// 1 - Allocate a queue entry. The ring already has memory for all entries but only the ones
258// listed in sq.array are visible by the kernel. For those not listed, the kernel does not
259// offer any assurance that an entry is not being filled by multiple flags. Therefore, we
260// need to write an allocator that allows allocating concurrently.
261//
262// 2 - Actually fill the submit entry, this is the only simple and straightforward step.
263//
264// 3 - Append the entry index to the array and adjust the tail accordingly. This operation
265// needs to arrive to two concensus at the same time:
266// A - The order in which entries are listed in the array: no two threads must pick the
267// same index for their entries
268// B - When can the tail be update for the kernel. EVERY entries in the array between
269// head and tail must be fully filled and shouldn't ever be touched again.
270//
271 //=============================================================================================
272 // Allocation
273 // for user's convenience fill the sqes from the indexes
274 static inline void __fill(struct io_uring_sqe * out_sqes[], __u32 want, __u32 idxs[], struct $io_context * ctx) {
275 struct io_uring_sqe * sqes = ctx->sq.sqes;
276 for(i; want) {
277 __cfadbg_print_safe(io, "Kernel I/O : filling loop\n");
278 out_sqes[i] = &sqes[idxs[i]];
279 }
280 }
281
282 // Try to directly allocate from the a given context
283 // Not thread-safe
284 static inline bool __alloc(struct $io_context * ctx, __u32 idxs[], __u32 want) {
285 __sub_ring_t & sq = ctx->sq;
286 const __u32 mask = *sq.mask;
287 __u32 fhead = sq.free_ring.head; // get the current head of the queue
288 __u32 ftail = sq.free_ring.tail; // get the current tail of the queue
289
290 // If we don't have enough sqes, fail
291 if((ftail - fhead) < want) { return false; }
292
293 // copy all the indexes we want from the available list
294 for(i; want) {
295 __cfadbg_print_safe(io, "Kernel I/O : allocating loop\n");
296 idxs[i] = sq.free_ring.array[(fhead + i) & mask];
297 }
298
299 // Advance the head to mark the indexes as consumed
300 __atomic_store_n(&sq.free_ring.head, fhead + want, __ATOMIC_RELEASE);
301
302 // return success
303 return true;
304 }
305
306 // Allocate an submit queue entry.
307 // The kernel cannot see these entries until they are submitted, but other threads must be
308 // able to see which entries can be used and which are already un used by an other thread
309 // for convenience, return both the index and the pointer to the sqe
310 // sqe == &sqes[idx]
311 struct $io_context * cfa_io_allocate(struct io_uring_sqe * sqes[], __u32 idxs[], __u32 want) {
312 __cfadbg_print_safe(io, "Kernel I/O : attempting to allocate %u\n", want);
313
314 disable_interrupts();
315 processor * proc = __cfaabi_tls.this_processor;
316 $io_context * ctx = proc->io.ctx;
317 /* paranoid */ verify( __cfaabi_tls.this_processor );
318 /* paranoid */ verify( ctx );
319
320 __cfadbg_print_safe(io, "Kernel I/O : attempting to fast allocation\n");
321
322 // We can proceed to the fast path
323 if( __alloc(ctx, idxs, want) ) {
324 // Allocation was successful
325 __STATS__( true, io.alloc.fast += 1; )
326 enable_interrupts();
327
328 __cfadbg_print_safe(io, "Kernel I/O : fast allocation successful from ring %d\n", ctx->fd);
329
330 __fill( sqes, want, idxs, ctx );
331 return ctx;
332 }
333 // The fast path failed, fallback
334 __STATS__( true, io.alloc.fail += 1; )
335
336 // Fast path failed, fallback on arbitration
337 __STATS__( true, io.alloc.slow += 1; )
338 enable_interrupts();
339
340 $io_arbiter * ioarb = proc->cltr->io.arbiter;
341 /* paranoid */ verify( ioarb );
342
343 __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for allocation\n");
344
345 struct $io_context * ret = __ioarbiter_allocate(*ioarb, idxs, want);
346
347 __cfadbg_print_safe(io, "Kernel I/O : slow allocation completed from ring %d\n", ret->fd);
348
349 __fill( sqes, want, idxs,ret );
350 return ret;
351 }
352
353 //=============================================================================================
354 // submission
355 static inline void __submit_only( struct $io_context * ctx, __u32 idxs[], __u32 have) {
356 // We can proceed to the fast path
357 // Get the right objects
358 __sub_ring_t & sq = ctx->sq;
359 const __u32 mask = *sq.mask;
360 __u32 tail = *sq.kring.tail;
361
362 // Add the sqes to the array
363 for( i; have ) {
364 __cfadbg_print_safe(io, "Kernel I/O : __submit loop\n");
365 sq.kring.array[ (tail + i) & mask ] = idxs[i];
366 }
367
368 // Make the sqes visible to the submitter
369 __atomic_store_n(sq.kring.tail, tail + have, __ATOMIC_RELEASE);
370 sq.to_submit += have;
371
372 __atomic_store_n(&ctx->proc->io.pending, true, __ATOMIC_RELAXED);
373 __atomic_store_n(&ctx->proc->io.dirty , true, __ATOMIC_RELAXED);
374 }
375
376 static inline void __submit( struct $io_context * ctx, __u32 idxs[], __u32 have, bool lazy) {
377 __sub_ring_t & sq = ctx->sq;
378 __submit_only(ctx, idxs, have);
379
380 if(sq.to_submit > 30) {
381 __tls_stats()->io.flush.full++;
382 __cfa_io_flush( ctx->proc, 0 );
383 }
384 if(!lazy) {
385 __tls_stats()->io.flush.eager++;
386 __cfa_io_flush( ctx->proc, 0 );
387 }
388 }
389
390 void cfa_io_submit( struct $io_context * inctx, __u32 idxs[], __u32 have, bool lazy ) __attribute__((nonnull (1))) {
391 __cfadbg_print_safe(io, "Kernel I/O : attempting to submit %u (%s)\n", have, lazy ? "lazy" : "eager");
392
393 disable_interrupts();
394 processor * proc = __cfaabi_tls.this_processor;
395 $io_context * ctx = proc->io.ctx;
396 /* paranoid */ verify( __cfaabi_tls.this_processor );
397 /* paranoid */ verify( ctx );
398
399 // Can we proceed to the fast path
400 if( ctx == inctx ) // We have the right instance?
401 {
402 __submit(ctx, idxs, have, lazy);
403
404 // Mark the instance as no longer in-use, re-enable interrupts and return
405 __STATS__( true, io.submit.fast += 1; )
406 enable_interrupts();
407
408 __cfadbg_print_safe(io, "Kernel I/O : submitted on fast path\n");
409 return;
410 }
411
412 // Fast path failed, fallback on arbitration
413 __STATS__( true, io.submit.slow += 1; )
414 enable_interrupts();
415
416 __cfadbg_print_safe(io, "Kernel I/O : falling back on arbiter for submission\n");
417
418 __ioarbiter_submit(inctx, idxs, have, lazy);
419 }
420
421 //=============================================================================================
422 // Flushing
423 // Go through the ring's submit queue and release everything that has already been consumed
424 // by io_uring
425 // This cannot be done by multiple threads
426 static __u32 __release_sqes( struct $io_context & ctx ) {
427 const __u32 mask = *ctx.sq.mask;
428
429 __attribute__((unused))
430 __u32 ctail = *ctx.sq.kring.tail; // get the current tail of the queue
431 __u32 chead = *ctx.sq.kring.head; // get the current head of the queue
432 __u32 phead = ctx.sq.kring.released; // get the head the last time we were here
433
434 __u32 ftail = ctx.sq.free_ring.tail; // get the current tail of the queue
435
436 // the 3 fields are organized like this diagram
437 // except it's are ring
438 // ---+--------+--------+----
439 // ---+--------+--------+----
440 // ^ ^ ^
441 // phead chead ctail
442
443 // make sure ctail doesn't wrap around and reach phead
444 /* paranoid */ verify(
445 (ctail >= chead && chead >= phead)
446 || (chead >= phead && phead >= ctail)
447 || (phead >= ctail && ctail >= chead)
448 );
449
450 // find the range we need to clear
451 __u32 count = chead - phead;
452
453 if(count == 0) {
454 return 0;
455 }
456
457 // We acquired an previous-head/current-head range
458 // go through the range and release the sqes
459 for( i; count ) {
460 __cfadbg_print_safe(io, "Kernel I/O : release loop\n");
461 __u32 idx = ctx.sq.kring.array[ (phead + i) & mask ];
462 ctx.sq.free_ring.array[ (ftail + i) & mask ] = idx;
463 }
464
465 ctx.sq.kring.released = chead; // note up to were we processed
466 __atomic_store_n(&ctx.sq.free_ring.tail, ftail + count, __ATOMIC_SEQ_CST);
467
468 __ioarbiter_notify(ctx);
469
470 return count;
471 }
472
473//=============================================================================================
474// I/O Arbiter
475//=============================================================================================
476 static inline bool enqueue(__outstanding_io_queue & queue, __outstanding_io & item) {
477 bool was_empty;
478
479 // Lock the list, it's not thread safe
480 lock( queue.lock __cfaabi_dbg_ctx2 );
481 {
482 was_empty = empty(queue.queue);
483
484 // Add our request to the list
485 add( queue.queue, item );
486
487 // Mark as pending
488 __atomic_store_n( &queue.empty, false, __ATOMIC_SEQ_CST );
489 }
490 unlock( queue.lock );
491
492 return was_empty;
493 }
494
495 static inline bool empty(__outstanding_io_queue & queue ) {
496 return __atomic_load_n( &queue.empty, __ATOMIC_SEQ_CST);
497 }
498
499 static $io_context * __ioarbiter_allocate( $io_arbiter & this, __u32 idxs[], __u32 want ) {
500 __cfadbg_print_safe(io, "Kernel I/O : arbiter allocating\n");
501
502 __STATS__( false, io.alloc.block += 1; )
503
504 // No one has any resources left, wait for something to finish
505 // We need to add ourself to a list of pending allocs and wait for an answer
506 __pending_alloc pa;
507 pa.idxs = idxs;
508 pa.want = want;
509
510 enqueue(this.pending, (__outstanding_io&)pa);
511
512 wait( pa.sem );
513
514 return pa.ctx;
515
516 }
517
518 static void __ioarbiter_notify( $io_arbiter & this, $io_context * ctx ) {
519 /* paranoid */ verify( !empty(this.pending.queue) );
520
521 lock( this.pending.lock __cfaabi_dbg_ctx2 );
522 {
523 while( !empty(this.pending.queue) ) {
524 __cfadbg_print_safe(io, "Kernel I/O : notifying\n");
525 __u32 have = ctx->sq.free_ring.tail - ctx->sq.free_ring.head;
526 __pending_alloc & pa = (__pending_alloc&)head( this.pending.queue );
527
528 if( have > pa.want ) goto DONE;
529 drop( this.pending.queue );
530
531 /* paranoid */__attribute__((unused)) bool ret =
532
533 __alloc(ctx, pa.idxs, pa.want);
534
535 /* paranoid */ verify( ret );
536
537 pa.ctx = ctx;
538
539 post( pa.sem );
540 }
541
542 this.pending.empty = true;
543 DONE:;
544 }
545 unlock( this.pending.lock );
546 }
547
548 static void __ioarbiter_notify( $io_context & ctx ) {
549 if(!empty( ctx.arbiter->pending )) {
550 __ioarbiter_notify( *ctx.arbiter, &ctx );
551 }
552 }
553
554 // Simply append to the pending
555 static void __ioarbiter_submit( $io_context * ctx, __u32 idxs[], __u32 have, bool lazy ) {
556 __cfadbg_print_safe(io, "Kernel I/O : submitting %u from the arbiter to context %u\n", have, ctx->fd);
557
558 __cfadbg_print_safe(io, "Kernel I/O : waiting to submit %u\n", have);
559
560 __external_io ei;
561 ei.idxs = idxs;
562 ei.have = have;
563 ei.lazy = lazy;
564
565 bool we = enqueue(ctx->ext_sq, (__outstanding_io&)ei);
566
567 __atomic_store_n(&ctx->proc->io.pending, true, __ATOMIC_SEQ_CST);
568
569 if( we ) {
570 sigval_t value = { PREEMPT_IO };
571 pthread_sigqueue(ctx->proc->kernel_thread, SIGUSR1, value);
572 }
573
574 wait( ei.sem );
575
576 __cfadbg_print_safe(io, "Kernel I/O : %u submitted from arbiter\n", have);
577 }
578
579 static void __ioarbiter_flush( $io_context & ctx ) {
580 if(!empty( ctx.ext_sq )) {
581 __STATS__( false, io.flush.external += 1; )
582
583 __cfadbg_print_safe(io, "Kernel I/O : arbiter flushing\n");
584
585 lock( ctx.ext_sq.lock __cfaabi_dbg_ctx2 );
586 {
587 while( !empty(ctx.ext_sq.queue) ) {
588 __external_io & ei = (__external_io&)drop( ctx.ext_sq.queue );
589
590 __submit_only(&ctx, ei.idxs, ei.have);
591
592 post( ei.sem );
593 }
594
595 ctx.ext_sq.empty = true;
596 }
597 unlock(ctx.ext_sq.lock );
598 }
599 }
600
601 #if defined(CFA_WITH_IO_URING_IDLE)
602 bool __kernel_read(processor * proc, io_future_t & future, iovec & iov, int fd) {
603 $io_context * ctx = proc->io.ctx;
604 /* paranoid */ verify( ! __preemption_enabled() );
605 /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
606 /* paranoid */ verify( ctx );
607
608 __u32 idx;
609 struct io_uring_sqe * sqe;
610
611 // We can proceed to the fast path
612 if( !__alloc(ctx, &idx, 1) ) return false;
613
614 // Allocation was successful
615 __fill( &sqe, 1, &idx, ctx );
616
617 sqe->user_data = (uintptr_t)&future;
618 sqe->flags = 0;
619 sqe->fd = fd;
620 sqe->off = 0;
621 sqe->ioprio = 0;
622 sqe->fsync_flags = 0;
623 sqe->__pad2[0] = 0;
624 sqe->__pad2[1] = 0;
625 sqe->__pad2[2] = 0;
626
627 #if defined(CFA_HAVE_IORING_OP_READ)
628 sqe->opcode = IORING_OP_READ;
629 sqe->addr = (uint64_t)iov.iov_base;
630 sqe->len = iov.iov_len;
631 #elif defined(CFA_HAVE_READV) && defined(CFA_HAVE_IORING_OP_READV)
632 sqe->opcode = IORING_OP_READV;
633 sqe->addr = (uintptr_t)&iov;
634 sqe->len = 1;
635 #else
636 #error CFA_WITH_IO_URING_IDLE but none of CFA_HAVE_READV, CFA_HAVE_IORING_OP_READV or CFA_HAVE_IORING_OP_READ defined
637 #endif
638
639 asm volatile("": : :"memory");
640
641 /* paranoid */ verify( sqe->user_data == (uintptr_t)&future );
642 __submit( ctx, &idx, 1, true );
643
644 /* paranoid */ verify( proc == __cfaabi_tls.this_processor );
645 /* paranoid */ verify( ! __preemption_enabled() );
646
647 return true;
648 }
649 #endif
650#endif
Note: See TracBrowser for help on using the repository browser.