Changes in libcfa/src/concurrency/io.cfa [5751a56:20ab637]
- File:
-
- 1 edited
-
libcfa/src/concurrency/io.cfa (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r5751a56 r20ab637 16 16 #if defined(__CFA_DEBUG__) 17 17 // #define __CFA_DEBUG_PRINT_IO__ 18 //#define __CFA_DEBUG_PRINT_IO_CORE__18 #define __CFA_DEBUG_PRINT_IO_CORE__ 19 19 #endif 20 20 … … 22 22 #include "bitmanip.hfa" 23 23 24 #if !defined( CFA_HAVE_LINUX_IO_URING_H)24 #if !defined(HAVE_LINUX_IO_URING_H) 25 25 void __kernel_io_startup( cluster &, unsigned, bool ) { 26 26 // Nothing to do without io_uring … … 218 218 // adjust the size according to the parameters 219 219 if ((params.features & IORING_FEAT_SINGLE_MMAP) != 0) { 220 cq .ring_sz = sq.ring_sz = max(cq.ring_sz, sq.ring_sz);220 cq->ring_sz = sq->ring_sz = max(cq->ring_sz, sq->ring_sz); 221 221 } 222 222 #endif … … 232 232 // mmap the Completion Queue into existence (may or may not be needed) 233 233 if ((params.features & IORING_FEAT_SINGLE_MMAP) != 0) { 234 cq .ring_ptr = sq.ring_ptr;234 cq->ring_ptr = sq->ring_ptr; 235 235 } 236 236 else … … 490 490 static uint32_t __release_consumed_submission( struct __io_data & ring ); 491 491 492 static inline void process(struct io_uring_cqe & cqe, struct __processor_id_t * id ) {493 struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data;494 __cfadbg_print_safe( io, "Kernel I/O : Syscall completed : cqe %p, result %d for %p\n", data, cqe.res, data->thrd );495 496 data->result = cqe.res;497 if(!id) { unpark( data->thrd __cfaabi_dbg_ctx2 ); }498 else { __unpark( id, data->thrd __cfaabi_dbg_ctx2 ); }499 }500 501 492 // Process a single completion message from the io_uring 502 493 // This is NOT thread-safe 503 494 static [int, bool] __drain_io( & struct __io_data ring, * sigset_t mask ) { 504 495 /* paranoid */ verify( !kernelTLS.preemption_state.enabled ); 496 const uint32_t smask = *ring.submit_q.mask; 505 497 506 498 unsigned to_submit = 0; … … 547 539 /* paranoid */ verify(&cqe); 548 540 549 process( cqe, !mask ? (struct __processor_id_t *)0p : &ring.poller.slow.id ); 541 struct __io_user_data_t * data = (struct __io_user_data_t *)(uintptr_t)cqe.user_data; 542 __cfadbg_print_safe( io, "Kernel I/O : Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd ); 543 544 data->result = cqe.res; 545 if(!mask) { unpark( data->thrd __cfaabi_dbg_ctx2 ); } 546 else { __unpark( &ring.poller.slow.id, data->thrd __cfaabi_dbg_ctx2 ); } 550 547 } 551 548
Note:
See TracChangeset
for help on using the changeset viewer.