public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Hugo Tyson <hmt@redhat.com>
To: ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] follow up on UITRON wierdness..
Date: Tue, 24 Oct 2000 05:30:00 -0000	[thread overview]
Message-ID: <wwt3dhme8gj.fsf@masala.cygnus> (raw)
In-Reply-To: <Pine.LNX.4.21.0010241046090.32540-100000@platinum.limerick.sslinc.com>


"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

  reply	other threads:[~2000-10-24  5:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-24  2:43 Dave Airlie
2000-10-24  5:30 ` Hugo Tyson [this message]
2000-10-24  6:22 ` profesor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wwt3dhme8gj.fsf@masala.cygnus \
    --to=hmt@redhat.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).