All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] [BUG] evsync is not SMP-safe
@ 2008-01-12 13:36 Jan Kiszka
  2008-01-25 22:06 ` Jan Kiszka
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2008-01-12 13:36 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: adeos-main

[-- Attachment #1: Type: text/plain, Size: 1054 bytes --]

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-01-28  8:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-12 13:36 [Adeos-main] [BUG] evsync is not SMP-safe Jan Kiszka
2008-01-25 22:06 ` Jan Kiszka
2008-01-27 15:24   ` Jan Kiszka
2008-01-28  6:59     ` Philippe Gerum
2008-01-28  8:35       ` Jan Kiszka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.