public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] follow up on UITRON wierdness..
@ 2000-10-24  2:43 Dave Airlie
  2000-10-24  5:30 ` Hugo Tyson
  2000-10-24  6:22 ` profesor
  0 siblings, 2 replies; 3+ messages in thread
From: Dave Airlie @ 2000-10-24  2:43 UTC (permalink / raw)
  To: ecos-discuss

Hi,
	well I've tracked down my problem from yesterday.. (after 6 hrs)..

For my uitron tasks I had

 user_value \
"CYG_UIT_TASK( \"t1\", 1, dtask1, &stack1, CYGNUM_UITRON_STACK_SIZE ), \\
      CYG_UIT_TASK( \"t2\", 1, dtask2, &stack2, CYGNUM_UITRON_STACK_SIZE
), \\
      CYG_UIT_TASK( \"t3\", 1, dtask3, &stack3, CYGNUM_UITRON_STACK_SIZE
), \\
      CYG_UIT_TASK( \"t4\", 1, dtask4, &stack4, CYGNUM_UITRON_STACK_SIZE
), \\
      CYG_UIT_TASK( \"t5\", 1, dtask5, &stack5, CYGNUM_UITRON_STACK_SIZE
),"


All priority level 1... all tasks are equal ... with this is messes up ..

chaning the pri levels to 1,2,3,4,5 works fine ..

someone from RH want to tell me why? it doesn't seem to be mentioned
anywhere ...

what wierder is with asserts turned off the code still runs fine ...

I'm running ecos snapshotted from 20 Oct, on a PID7t.

Dave.
(waiting for someone to point out a really obvious comment)

-- 
      David Airlie, Software Engineer, Parthus Technologies plc.,
       Mary Rosse Centre, National Tech Park, Limerick, Ireland.
   t: +353-61-508116 / f: +353-61-508101 / David.Airlie@parthus.com

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

* Re: [ECOS] follow up on UITRON wierdness..
  2000-10-24  2:43 [ECOS] follow up on UITRON wierdness Dave Airlie
@ 2000-10-24  5:30 ` Hugo Tyson
  2000-10-24  6:22 ` profesor
  1 sibling, 0 replies; 3+ messages in thread
From: Hugo Tyson @ 2000-10-24  5:30 UTC (permalink / raw)
  To: ecos-discuss


"Dave Airlie" <airlied@parthus.com> writes:
> For my uitron tasks I had
> 
>  user_value \
> "CYG_UIT_TASK( \"t1\", 1, dtask1, &stack1, CYGNUM_UITRON_STACK_SIZE ), \\
>       CYG_UIT_TASK( \"t2\", 1, dtask2, &stack2, CYGNUM_UITRON_STACK_SIZE
> ), \\
>       CYG_UIT_TASK( \"t3\", 1, dtask3, &stack3, CYGNUM_UITRON_STACK_SIZE
> ), \\
>       CYG_UIT_TASK( \"t4\", 1, dtask4, &stack4, CYGNUM_UITRON_STACK_SIZE
> ), \\
>       CYG_UIT_TASK( \"t5\", 1, dtask5, &stack5, CYGNUM_UITRON_STACK_SIZE
> ),"
> 
> 
> All priority level 1... all tasks are equal ... with this is messes up ..
> 
> chaning the pri levels to 1,2,3,4,5 works fine ..
> 
> someone from RH want to tell me why? it doesn't seem to be mentioned
> anywhere ...

Sorry, I don't know.  I (with my Mister uITRON hat on) did take a look at
this, and I did note the article for later attention, so don't feel
ignored/unloved, please ;-)
 
> what wierder is with asserts turned off the code still runs fine ...

> (waiting for someone to point out a really obvious comment)

I don't have one, sorry. ;-(

I have a coupla thoughts:

The difference between running all the same prio and with prios 1-5 is:
 o Same: tasks will be swapped by interrupts, by timeslicing
 o Diff: tasks will only swap cooperatively, by function calls that wait

these would likely be at different depths of stack call; that would explain
different behaviour if the stacks were overlapping (or plain too small - I
trust you checked for *that*)

What's your declaration of the stacks?  Are they accidentally overlapping?
Are they actually CYGNUM_UITRON_STACK_SIZE bytes in size?

You can write CYG_UIT_TASK( \"t5\", 1, dtask5, &stack5, sizeof(stack5) ) in
there instead if you want, you understand this ugly macro is just an array
initializer with macros in?

Beware, we once for quite a long time had an hilarious bug where the stack
base and size args of thread initialization were swapped.  This didn't
matter at all, and wasn't detected, because the kernel starts using store
at (base + size) ie. the top of the stack; which is the same as (size +
base).  But it meant that stack limit asserts were all bogus.

My point is, it's easy for things like that to be badly wrong and have the
system mostly work!

Have you added any trick interrupt handler and device of your own?  Are you
perhaps getting a recursive interrupt chewing up the stack?  (or should
that be <verb>ing down the stack ;-) )

HTH, sorry I can't see anything obvious,

	- Huge

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

* Re: [ECOS] follow up on UITRON wierdness..
  2000-10-24  2:43 [ECOS] follow up on UITRON wierdness Dave Airlie
  2000-10-24  5:30 ` Hugo Tyson
@ 2000-10-24  6:22 ` profesor
  1 sibling, 0 replies; 3+ messages in thread
From: profesor @ 2000-10-24  6:22 UTC (permalink / raw)
  To: Dave Airlie; +Cc: ecos-discuss

> 	well I've tracked down my problem from yesterday.. (after 6 hrs)..
> 
> [ stuff deleted ]
> 
> All priority level 1... all tasks are equal ... with this is messes up ..
> 
> chaning the pri levels to 1,2,3,4,5 works fine ..
> 
> someone from RH want to tell me why? it doesn't seem to be mentioned
> anywhere ...

Are you using the bitmap scheduler or the multi-level queue scheduler?
If you're using the bitmap scheduler, each task must have a different
priority.  I saw this reading the eCos reference manual, in the Kernel
source files section under 'sched/bitmap.cxx'.

	-Matt

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

end of thread, other threads:[~2000-10-24  6:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-24  2:43 [ECOS] follow up on UITRON wierdness Dave Airlie
2000-10-24  5:30 ` Hugo Tyson
2000-10-24  6:22 ` profesor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).