All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Prio ceiling mutex issues
@ 2016-05-09 19:03 Jan Kiszka
  2016-05-09 19:16 ` Jan Kiszka
  2016-05-09 19:30 ` Philippe Gerum
  0 siblings, 2 replies; 8+ messages in thread
From: Jan Kiszka @ 2016-05-09 19:03 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: Xenomai

Hi Philippe,

we ran into at least one bug of the current prio ceiling support for
synch objects: on xnsynch_release, we only reschedule if we woken up a
new owner. But we also have to reschedule after dropping the ceiling
prio as some higher prio thread may be waiting.

For that, I would propose to alter the return type and semantic of
xnsynch_release from "pointer to new owner" into "bool, true if
reschedule is needed". It seems, no caller of xnsynch_release makes a
non-boolean use of the return value anyway. And then we can simply
return true on "synch->status & XNSYNCH_PP".

That leads to the question what would happen in the fast case. Consider

pthread_mutex_lock(ceiling_mutex);
wake_up_thread(some_thread); // caller_prio < target_prio < ceiling_prio
pthread_mutex_unlock(ceiling_mutex);

To my current understanding, there is nothing enforcing a syscall for
the unlock caller if some thread woke up after the lock, thus may have a
high prio after the unlock. Or am I missing something?

Thanks,
Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2016-05-10 13:57 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-09 19:03 [Xenomai] Prio ceiling mutex issues Jan Kiszka
2016-05-09 19:16 ` Jan Kiszka
2016-05-09 19:22   ` Philippe Gerum
2016-05-09 19:27     ` Jan Kiszka
2016-05-09 19:30 ` Philippe Gerum
2016-05-09 19:32   ` Jan Kiszka
2016-05-10 13:32     ` Jan Kiszka
2016-05-10 13:57     ` Philippe Gerum

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.