From: Jan Kiszka <jan.kiszka@domain.hid>
To: Philippe Gerum <rpm@xenomai.org>
Cc: adeos-main <adeos-main@gna.org>
Subject: [Adeos-main] [BUG] evsync is not SMP-safe
Date: Sat, 12 Jan 2008 14:36:57 +0100 [thread overview]
Message-ID: <4788C279.1020607@domain.hid> (raw)
[-- 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 --]
next reply other threads:[~2008-01-12 13:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-12 13:36 Jan Kiszka [this message]
2008-01-25 22:06 ` [Adeos-main] [BUG] evsync is not SMP-safe Jan Kiszka
2008-01-27 15:24 ` Jan Kiszka
2008-01-28 6:59 ` Philippe Gerum
2008-01-28 8:35 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4788C279.1020607@domain.hid \
--to=jan.kiszka@domain.hid \
--cc=adeos-main@gna.org \
--cc=rpm@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.