Re: [Xenomai-core] [PATCH] rework xnintr_query

2008-08-19 Thread Philippe Gerum
Jan Kiszka wrote: Philippe Gerum wrote: ... This would be even better with a proper iterator construct. Something like this? I think I tested most cases successfully (e.g. 4 CPUs with a shared IRQ), but the code should also be better readable, thus better reviewable. Comments/feedback

Re: [Xenomai-core] [PATCH] rework xnintr_query

2008-08-19 Thread Gilles Chanteperdrix
Philippe Gerum wrote: -head = snprintf(name, XNOBJECT_NAME_LEN, IRQ%d: , irq); -name += head; -strncpy(name, intr-name, XNOBJECT_NAME_LEN-head); +head = snprintf(name_buf, XNOBJECT_NAME_LEN, IRQ%d: , irq); +strncpy(name_buf + head, intr-name, XNOBJECT_NAME_LEN-head); -

[Xenomai-core] [PATCH 1/2] Avoid add_proc_leaf duplicates

2008-08-19 Thread Jan Kiszka
For unknown (historical?) reasons, there are 3 identical implementations of add_proc_leaf services in Xenomai right now. This patch switches them all to the rthal provided version. Signed-off-by: Jan Kiszka [EMAIL PROTECTED] --- include/asm-generic/hal.h | 10 +++ ksrc/arch/generic/hal.c

[Xenomai-core] [PATCH 2/2] Report registry slot usage via /proc

2008-08-19 Thread Jan Kiszka
Some customer ran into the problem of lacking registry slots without prior warning. We are lacking some report mechanism, specifically for unexported entries (every user object requires one for its handle). This patch introduces /proc/xenomai/registry_usage in the form

[Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Jan Kiszka
Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the nucleus' implementation of the lock stealing algorithm. Consider this scenario: 1. Thread A acquires Mutex X successfully, ie. it

Re: [Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Philippe Gerum
Jan Kiszka wrote: Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the nucleus' implementation of the lock stealing algorithm. Consider this scenario: 1. Thread A acquires

Re: [Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Jan Kiszka
Philippe Gerum wrote: Jan Kiszka wrote: Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the nucleus' implementation of the lock stealing algorithm. Consider this scenario: 1.

Re: [Xenomai-core] [PATCH] rework xnintr_query

2008-08-19 Thread Jan Kiszka
Gilles Chanteperdrix wrote: Philippe Gerum wrote: - head = snprintf(name, XNOBJECT_NAME_LEN, IRQ%d: , irq); - name += head; - strncpy(name, intr-name, XNOBJECT_NAME_LEN-head); + head = snprintf(name_buf, XNOBJECT_NAME_LEN, IRQ%d: , irq); + strncpy(name_buf + head, intr-name,

Re: [Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Philippe Gerum
Jan Kiszka wrote: Philippe Gerum wrote: Jan Kiszka wrote: Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the nucleus' implementation of the lock stealing algorithm. Consider

Re: [Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Jan Kiszka
Philippe Gerum wrote: Jan Kiszka wrote: Philippe Gerum wrote: Jan Kiszka wrote: Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the nucleus' implementation of the lock

Re: [Xenomai-core] [BUG] Lock stealing is borken

2008-08-19 Thread Jan Kiszka
Philippe Gerum wrote: Jan Kiszka wrote: Philippe Gerum wrote: Jan Kiszka wrote: Philippe Gerum wrote: Jan Kiszka wrote: Hi, bad news, everyone :(. According to the result of some lengthy debug session with a customer and several ad-hoc lttng instrumentations, we have a fatal bug in the

[Xenomai-core] Xenomai v2.4.5

2008-08-19 Thread Philippe Gerum
Here is the fifth maintenance release for the v2.4.x branch. Short log follows: [nucleus] * xnpipe_poll: fix race (message pipe poll/select support). * Fix memory overwrite when reading /proc/xenomai/stat. * xnsleep_sleep_on: fix early timeouts (ownership

[Xenomai-core] [PATCH] Clean up XNWAKEN / wwake tracking

2008-08-19 Thread Jan Kiszka
Current lock stealing implementation encodes the new owner woken up, but not yet scheduled state redundantly. First, the XNWAKEN thread bit is set and, second, the wwake field in xnthread_t points to the xnsynch_t object that the thread is about to own. Apparently, no technical benefit can be