public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Wayne Visser <wvisser@lszpaper.com>
To: Robin Randhawa <robin.randhawa@gmail.com>
Cc: ecos-discuss@sourceware.org
Subject: Re: [ECOS] High priority thread versus network
Date: Wed, 09 May 2007 19:13:00 -0000	[thread overview]
Message-ID: <463F6175.5060105@lszpaper.com> (raw)
In-Reply-To: <1178552347.17677.8.camel@blackpearl>


Thanks for the tips, Robin.  You may be shooting in the dark, but I *am* 
in the dark! ;-)

You're right, it does look like a stack overflow, but I have assertions 
enabled (CYGDBG_USE_ASSERTS) and CYGFUN_KERNEL_THREADS_STACK_CHECKING is 
also enabled.  I've seen no asserts or panics being raised to date.  Are 
there other assertions I've missed?

I'm using a separate interrupt stack (size = 4096).

I've gone ahead and increased the size of the NET_THREAD and 
NET_FAST_THREAD and am currently re-running the tests.

   -- Wayne

Robin Randhawa wrote:
> Hi.
> 
> Just some shots in the dark :
> 
> 1. Have you enabled all assertions ? Checks for stack manipulation ?
> 
> 2. Are you using a separate interrupt stack ?
> 
> 3. Does changing the default stack size of the Network Thread make a
> difference in either the exhibited phenomena and/or the time before the
> system hangs up ?
> 
> The problem you face seems to be a stack overflow but there really isn't
> sufficient data to state that as a fact.
> 
> I would try the above just to reduce some of the possibilities.
> 
> Cheers,
> Robin
> 
> On Mon, 2007-05-07 at 08:53 -0400, Wayne Visser wrote:
>> Hello all,
>>
>> We're having a problem with an eCos app that has a relatively 
>> long-running, high priority thread (runs at priority 2 every 10 ms and 
>> takes about 4ms to complete).  Under high network loads, the app will 
>> crash with no asserts or panics.  If the high priority thread is 
>> disabled, the app will run fine for days without problem under high net 
>> loads.  Conversely, without any networking activity, the app runs fine 
>> for days.
>>
>> We've stripped this down to a simple test app with two parts (a) the 
>> high priority thread basically does nothing but consume CPU time:
>>
>> static void
>> high_thread( cyg_addrword_t arg )
>> {
>>    int i, j;
>>    cyg_uint16 buf[1024];
>>
>>    while (1)
>>    {
>>      for ( j=0; j<90; ++j )
>>      {
>>        for ( i=0; i<1024; ++i)
>>          buf[i] = rand();
>>      }
>>
>>      cyg_thread_delay(1);
>>    }
>> }
>>
>> and (b) several identical networking threads that do nothing but accept 
>> client connections and echo data sent to them.
>>
>> If several clients connect to the eCos app, a crash will occur in as 
>> little as a few minutes (but sometimes hours).
>>
>> So my question is this: Are there any known issues in running a high 
>> priority thread with a relatively long running time?  i.e. this thread 
>> is effectively blocking the network threads from running for up to 4ms. 
>>   Will that create any known problems?
>>
>> Thanks for any feedback.
>>
>>    -- Wayne
>>
>>
>> ps: Out target is i386 and the problem is evident with both 8139 and 
>> 82559 ethernet drivers.  Curiously, the problem does NOT appear with the 
>> 83816 ethernet driver.
>>
>>
> 
> .
> 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-05-07 17:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-07 15:39 Wayne Visser
2007-05-07 17:28 ` Robin Randhawa
2007-05-09 19:13   ` Wayne Visser [this message]
2007-08-14 13:18 ` [ECOS] High priority thread versus network - FOLLOW-UP Wayne Visser

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=463F6175.5060105@lszpaper.com \
    --to=wvisser@lszpaper.com \
    --cc=ecos-discuss@sourceware.org \
    --cc=robin.randhawa@gmail.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).