All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-core] Fragile lock usage tracking for auto-relax
@ 2011-05-31 11:37 Jan Kiszka
  2011-05-31 16:29 ` Philippe Gerum
  0 siblings, 1 reply; 11+ messages in thread
From: Jan Kiszka @ 2011-05-31 11:37 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: Xenomai core

Hi Philippe,

enabling XENO_OPT_DEBUG_NUCLEUS reveals some shortcomings of the
in-kernel lock usage tracking via xnthread_t::hrescnt. This BUGON in
xnsynch_release triggers for RT threads:

	XENO_BUGON(NUCLEUS, xnthread_get_rescnt(lastowner) < 0);

RT threads do not balance their lock and unlock syscalls, so their
counter goes wild quite quickly.

But just limiting the bug check to XNOTHER threads is neither a
solution. How to deal with the counter on scheduling policy changes?

So my suggestion is to convert the auto-relax feature into a service,
user space can request based on a counter that user space maintains
independently. I.e. we should create another shared word that user space
increments and decrements on lock acquisitions/releases on its own. The
nucleus just tests it when deciding about the relax on return to user space.

But before hacking into that direction, I'd like to hear if it makes
sense to you.

Jan

-- 
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux


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

end of thread, other threads:[~2011-05-31 18:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-31 11:37 [Xenomai-core] Fragile lock usage tracking for auto-relax Jan Kiszka
2011-05-31 16:29 ` Philippe Gerum
2011-05-31 16:38   ` Gilles Chanteperdrix
2011-05-31 16:48     ` Philippe Gerum
2011-05-31 16:38   ` Jan Kiszka
2011-05-31 16:50     ` Gilles Chanteperdrix
2011-05-31 16:54       ` Jan Kiszka
2011-05-31 16:58     ` Philippe Gerum
2011-05-31 17:06       ` Jan Kiszka
2011-05-31 17:58         ` Gilles Chanteperdrix
2011-05-31 18:01           ` 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.