Philippe, this
int fastcall __ipipe_dispatch_event (unsigned event, void *data)
...
ipipe_cpudom_var(next_domain, evsync) |= (1LL << event);
local_irq_restore_hw(flags);
propagate = !evhand(event, start_domain, data);
local_irq_save_hw(flags);
ipipe_cpudom_var(next_domain, evsync) &= ~(1LL << event);
doesn't fly on SMP. While the invoked event handler is running, it may
happen that the caller gets migrated to another CPU. The result is an
inconsistent evsync state that causes ipipe_catch_event to stall (test
case: invoke Jerome's system() test a few times, them try to unload
Xenomai skins and nucleus).
First idea (I've nothing implemented to far, would happily leave it to
someone else's hand): Track event handler entry/exit with an, say, 8 bit
per-cpu counter. On event deregistration, just summarize over the
per-cpu counters and wait for the sum to become 0. This has just the
drawback that it may cause livelocks on large SMP boxes when trying to
wait for a busy event. I've no perfect idea so far.
Jan
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Adeos-main mailing list [email protected] https://mail.gna.org/listinfo/adeos-main
