From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14329 invoked by alias); 20 Jun 2006 13:12:58 -0000 Received: (qmail 14321 invoked by uid 22791); 20 Jun 2006 13:12:57 -0000 X-Spam-Check-By: sourceware.org Received: from londo.lunn.ch (HELO londo.lunn.ch) (80.238.139.98) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 20 Jun 2006 13:12:55 +0000 Received: from lunn by londo.lunn.ch with local (Exim 3.36 #1 (Debian)) id 1Fsg2B-0005bt-00; Tue, 20 Jun 2006 15:12:47 +0200 Date: Tue, 20 Jun 2006 13:12:00 -0000 To: Goldschmidt Simon Cc: ecos-discuss@ecos.sourceware.org Message-ID: <20060620131247.GJ21228@lunn.ch> Mail-Followup-To: Goldschmidt Simon , ecos-discuss@ecos.sourceware.org References: <651FDF993328694286BDDA6A0A3606B912E14E@pfde-mx5.EU.P-F.BIZ> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <651FDF993328694286BDDA6A0A3606B912E14E@pfde-mx5.EU.P-F.BIZ> User-Agent: Mutt/1.5.11+cvs20060403 From: Andrew Lunn X-IsSubscribed: yes 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 Subject: Re: [ECOS] why is it wrong to call cyg_semaphore_post() in ISR??? X-SW-Source: 2006-06/txt/msg00178.txt.bz2 > Any idea what the performance loss is by using ISR+DSR instead of > ISR only? We are using NIOS-II processor and any context switch > avoided makes our system a lot faster! It is impossible to measure since you cannot run a system with just ISRs and no DSRs. Also, you would expect 99% of your DSR's to run straight after the ISR in the ISR context. So normally a DSR does not cause an additional context switch, it is just piggybacked onto the ISR context switch. Even if the DSR is deferred becasue the schedular is locked, when the DSR is run it will run in the context of the thread unlocking the schedular so again there is no context switch. The only time there could be an "additional" context switch is when this deferred DSR causes a higher priority thread to become runnable so forcing a context switch. In this case the current context has to be saved and the new threads context loaded. If the DSR was run in ISR context, the interrupted threads context has already been saved and the context will be restored when the interrupt exists. Hence a change in the running thread during an ISR+DSR does not cause an additional context switch. 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