From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21022 invoked by alias); 13 Oct 2005 13:14:38 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 21004 invoked by uid 22791); 13 Oct 2005 13:14:35 -0000 Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 13 Oct 2005 13:14:35 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1EQ2uc-0001qp-00; Thu, 13 Oct 2005 15:14:22 +0200 Date: Thu, 13 Oct 2005 13:14:00 -0000 To: Stefan Sommerfeld Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20051013131422.GC6114@lunn.ch> Mail-Followup-To: Stefan Sommerfeld , ecos-discuss@ecos.sourceware.org References: <001e01c5cff3$a4129150$8262fea9@nullnullsix> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001e01c5cff3$a4129150$8262fea9@nullnullsix> User-Agent: Mutt/1.5.11 From: Andrew Lunn Subject: Re: [ECOS] ISR to DSR delay? X-SW-Source: 2005-10/txt/msg00081.txt.bz2 On Thu, Oct 13, 2005 at 02:42:58PM +0200, Stefan Sommerfeld wrote: > Hi, > > I working with latest eCos on a XScale system and i noticed a very high > delay between the ISR and the corresponding after some time. The system is > not idle and does a lot of things (including multiple threads and irq's). I > see a delay between ISR and DSR over 30 ms. > > I checked the system's DSR, to make sure there's no DSR which runs very > long and i looked for possible cyg_scheduler_lock() calls. What i wonder > about is, i see that sometimes a quick cyg_scheduler_lock() happen which > between the long ISR/DSR delay. So it looks like scheduling is active and > running but the DSR is not called. > > What could influence the ISR to DSR delay besides scheduler_lock and still > active DSR? I thought a DSR will be called as soon as possible. Could this > be a wrong eCos kernel setup? DSRs are only allowed to run with it is safe to run a DSR. This in fact means that when the schedular is locked DSRs cannot run. Once the schedular is unlocked the DSR will get to run. So the schedular is probably locked when the ISR happens and you see a delay. When the ISR exits the DSR does not get to run. When you see a cyg_scheduler_lock() this will actually be a nested lock inside another lock. So the DSR will only get to run when both locks are unlocked. This might actually be telling you something. A double lock suggests something more complex is going on. It might be worth seeing if a single lock gives you an acceptable delay but a double lock is unacceptable. If so you can then just find the double lock case and simply the code. Otherwise you need to investigate all locks and find onces which are taking too long. Andrew -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss