Re: [Xenomai-core] [patch] fix ximulator xnarch_program_next_timer_shot.

2007-07-18 Thread Philippe Gerum
On Tue, 2007-07-17 at 21:30 +0200, Gilles Chanteperdrix wrote:
 Hi,
 
 when xnarch_program_next_timer_shot is passed a null delay and there is
 no other timed event pending, the mvm terminates with the message:
 nothing to schedule.
 

Actually, this is a purely event-driven engine, so if we manage to raise
this condition, this basically means that there is nothing to do next
for the engine, and no mean to get busy afterwise, since only handling
some event may schedule another event in the engine's queue.
Chicken-and-egg issue.

 The attached patch fixes this, though I am not sure it is the best way
 to fix it.

Looks good.  The only thing that still bothers me is that, at some
point, it seems that we are triggering an immediate shot. Even if this
situation is clearly possible in the real environment, I find it a bit
suspicious in the simulated one. Maybe this is related to the timer
adjustement code that may raise such situation (which would explain it
then)?

 
 plain text document attachment (xeno-sim-program-null-delay.diff)
 Index: include/asm-sim/bits/timer.h
 ===
 --- include/asm-sim/bits/timer.h  (revision 2765)
 +++ include/asm-sim/bits/timer.h  (working copy)
 @@ -22,7 +22,7 @@
  static inline void xnarch_program_timer_shot (unsigned long delay)
  {
  /* 1 tsc unit of the virtual CPU == 1 ns. */
 -mvm_program_timer(delay);
 +mvm_program_timer(delay ?: 1);
  }
  
  static inline int xnarch_send_timer_ipi (xnarch_cpumask_t mask)
 ___
 Xenomai-core mailing list
 Xenomai-core@gna.org
 https://mail.gna.org/listinfo/xenomai-core
-- 
Philippe.



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix ximulator xnarch_program_next_timer_shot.

2007-07-18 Thread Gilles Chanteperdrix
On 7/18/07, Philippe Gerum [EMAIL PROTECTED] wrote:
 On Tue, 2007-07-17 at 21:30 +0200, Gilles Chanteperdrix wrote:
  The attached patch fixes this, though I am not sure it is the best way
  to fix it.

 Looks good.  The only thing that still bothers me is that, at some
 point, it seems that we are triggering an immediate shot. Even if this
 situation is clearly possible in the real environment, I find it a bit
 suspicious in the simulated one. Maybe this is related to the timer
 adjustement code that may raise such situation (which would explain it
 then)?

Yes, this is because of the timer adjustment code. We enqueue timers
with an already passed expiry date, so the timer code ends up calling
xnarch_program_timer_shot with a null delay.

-- 
   Gilles Chanteperdrix

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] [patch] fix ximulator xnarch_program_next_timer_shot.

2007-07-18 Thread Philippe Gerum
On Wed, 2007-07-18 at 10:03 +0200, Gilles Chanteperdrix wrote:
 On 7/18/07, Philippe Gerum [EMAIL PROTECTED] wrote:
  On Tue, 2007-07-17 at 21:30 +0200, Gilles Chanteperdrix wrote:
   The attached patch fixes this, though I am not sure it is the best way
   to fix it.
 
  Looks good.  The only thing that still bothers me is that, at some
  point, it seems that we are triggering an immediate shot. Even if this
  situation is clearly possible in the real environment, I find it a bit
  suspicious in the simulated one. Maybe this is related to the timer
  adjustement code that may raise such situation (which would explain it
  then)?
 
 Yes, this is because of the timer adjustment code. We enqueue timers
 with an already passed expiry date, so the timer code ends up calling
 xnarch_program_timer_shot with a null delay.
 

Then your patch is definitely ok. Will merge for -rc2 along with the
timer adjustment code.

-- 
Philippe.



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] [patch] fix ximulator xnarch_program_next_timer_shot.

2007-07-17 Thread Gilles Chanteperdrix

Hi,

when xnarch_program_next_timer_shot is passed a null delay and there is
no other timed event pending, the mvm terminates with the message:
nothing to schedule.

The attached patch fixes this, though I am not sure it is the best way
to fix it.

-- 


Gilles Chanteperdrix.
Index: include/asm-sim/bits/timer.h
===
--- include/asm-sim/bits/timer.h(revision 2765)
+++ include/asm-sim/bits/timer.h(working copy)
@@ -22,7 +22,7 @@
 static inline void xnarch_program_timer_shot (unsigned long delay)
 {
 /* 1 tsc unit of the virtual CPU == 1 ns. */
-mvm_program_timer(delay);
+mvm_program_timer(delay ?: 1);
 }
 
 static inline int xnarch_send_timer_ipi (xnarch_cpumask_t mask)
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core