Ignore:
Timestamp:
Sep 21, 2022, 11:02:15 AM (20 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
95dab9e
Parents:
428adbc (diff), 0bd46fd (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into pthread-emulation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/io/setup.cfa

    r428adbc r7f6a7c9  
    2828        void ?{}(io_context_params & this) libcfa_public {}
    2929
    30         void  ?{}($io_context & this, struct cluster & cl) {}
    31         void ^?{}($io_context & this) {}
     30        void  ?{}(io_context$ & this, struct cluster & cl) {}
     31        void ^?{}(io_context$ & this) {}
    3232
    3333        void __cfa_io_start( processor * proc ) {}
     
    3737        void __cfa_io_stop ( processor * proc ) {}
    3838
    39         $io_arbiter * create(void) { return 0p; }
    40         void destroy($io_arbiter *) {}
     39        io_arbiter$ * create(void) { return 0p; }
     40        void destroy(io_arbiter$ *) {}
    4141
    4242#else
     
    105105
    106106
    107         static void __io_uring_setup ( $io_context & this, const io_context_params & params_in, int procfd );
    108         static void __io_uring_teardown( $io_context & this );
    109         static void __epoll_register($io_context & ctx);
    110         static void __epoll_unregister($io_context & ctx);
    111         void __ioarbiter_register( $io_arbiter & mutex, $io_context & ctx );
    112         void __ioarbiter_unregister( $io_arbiter & mutex, $io_context & ctx );
    113 
    114         void ?{}($io_context & this, processor * proc, struct cluster & cl) {
     107        static void __io_uring_setup ( io_context$ & this, const io_context_params & params_in, int procfd );
     108        static void __io_uring_teardown( io_context$ & this );
     109        static void __epoll_register(io_context$ & ctx);
     110        static void __epoll_unregister(io_context$ & ctx);
     111        void __ioarbiter_register( io_arbiter$ & mutex, io_context$ & ctx );
     112        void __ioarbiter_unregister( io_arbiter$ & mutex, io_context$ & ctx );
     113
     114        void ?{}(io_context$ & this, processor * proc, struct cluster & cl) {
    115115                /* paranoid */ verify( cl.io.arbiter );
    116116                this.proc = proc;
     
    122122        }
    123123
    124         void ^?{}($io_context & this) {
     124        void ^?{}(io_context$ & this) {
    125125                __cfadbg_print_safe(io_core, "Kernel I/O : tearing down io_context %u\n", this.fd);
    126126
     
    129129        }
    130130
    131         static void __io_uring_setup( $io_context & this, const io_context_params & params_in, int procfd ) {
     131        static void __io_uring_setup( io_context$ & this, const io_context_params & params_in, int procfd ) {
    132132                // Step 1 : call to setup
    133133                struct io_uring_params params;
     
    228228
    229229                #if !defined(CFA_WITH_IO_URING_IDLE)
     230                {
    230231                        // Step 4 : eventfd
    231232                        __cfadbg_print_safe(io_core, "Kernel I/O : registering %d for completion with ring %d\n", procfd, fd);
     
    237238
    238239                        __cfadbg_print_safe(io_core, "Kernel I/O : registered %d for completion with ring %d\n", procfd, fd);
    239                 #endif
    240 
     240                }
     241                #endif
     242
     243                // TODO: implement a proper version of this.
     244                // I have not found a better maximum that works in general but users should be able to configure it
     245                // the same way they configure other I/O options
    241246                // #if defined(CFA_HAVE_IORING_REGISTER_IOWQ_MAX_WORKERS)
     247                // {
    242248                //      // Step 5 : max worker count
    243249                //      __cfadbg_print_safe(io_core, "Kernel I/O : lmiting max workers for ring %d\n", fd);
     
    252258
    253259                //      __cfadbg_print_safe(io_core, "Kernel I/O : lmited max workers for ring %d\n", fd);
     260                // }
    254261                // #endif
    255262
     
    270277        }
    271278
    272         static void __io_uring_teardown( $io_context & this ) {
     279        static void __io_uring_teardown( io_context$ & this ) {
    273280                // Shutdown the io rings
    274281                struct __sub_ring_t & sq = this.sq;
     
    313320// I/O Context Sleep
    314321//=============================================================================================
    315         // static inline void __epoll_ctl($io_context & ctx, int op, const char * error) {
     322        // static inline void __epoll_ctl(io_context$ & ctx, int op, const char * error) {
    316323        //      struct epoll_event ev;
    317324        //      ev.events = EPOLLIN | EPOLLONESHOT;
     
    323330        // }
    324331
    325         // static void __epoll_register($io_context & ctx) {
     332        // static void __epoll_register(io_context$ & ctx) {
    326333        //      __epoll_ctl(ctx, EPOLL_CTL_ADD, "ADD");
    327334        // }
    328335
    329         // static void __epoll_unregister($io_context & ctx) {
     336        // static void __epoll_unregister(io_context$ & ctx) {
    330337        //      // Read the current epoch so we know when to stop
    331338        //      size_t curr = __atomic_load_n(&iopoll.epoch, __ATOMIC_SEQ_CST);
     
    346353        // }
    347354
    348         // void __ioctx_prepare_block($io_context & ctx) {
     355        // void __ioctx_prepare_block(io_context$ & ctx) {
    349356        //      __cfadbg_print_safe(io_core, "Kernel I/O - epoll : Re-arming io poller %d (%p)\n", ctx.fd, &ctx);
    350357        //      __epoll_ctl(ctx, EPOLL_CTL_MOD, "REARM");
     
    355362// I/O Context Misc Setup
    356363//=============================================================================================
    357         void ?{}( $io_arbiter & this ) {
     364        void ?{}( io_arbiter$ & this ) {
    358365                this.pending.empty = true;
    359366        }
    360367
    361         void ^?{}( $io_arbiter & mutex this ) {}
    362 
    363         $io_arbiter * create(void) {
     368        void ^?{}( io_arbiter$ & mutex this ) {}
     369
     370        io_arbiter$ * create(void) {
    364371                return new();
    365372        }
    366         void destroy($io_arbiter * arbiter) {
     373        void destroy(io_arbiter$ * arbiter) {
    367374                delete(arbiter);
    368375        }
Note: See TracChangeset for help on using the changeset viewer.