public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Interrupts
@ 2008-10-17 11:42 Rick Davis
  2008-10-18  8:33 ` Chris Zimman
  0 siblings, 1 reply; 13+ messages in thread
From: Rick Davis @ 2008-10-17 11:42 UTC (permalink / raw)
  To: ecos-discuss

I am working on a platform with a compact flash. The Compact Flash is
operating in true ide pio mode. I am using the fatfs file system. When I
write a 1.2M file, it takes about 16 seconds to write the file. However, the
eCos clock only advances by 6 seconds. Why is this?
The hardware is a power PC processor using the decrementer as the eCos
clock. I have been trying to find out where, if at all, interrupts are being
disabled while writing the file. Is there anything else that can prevent the
decrementer from operating.
My problem is that I have a watchdog thread strobing a hardware watchdog and
it never runs because the decrementer tics aren't occurring to allow
timeslicing and the unit reboots. The thread priorities are equal and time
slicing is enabled.

Thanks,
Rick Davis



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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: [ECOS] interrupts
@ 2002-05-23  7:37 Daniel.Lidsten
  2002-05-23  7:48 ` Gary Thomas
  2002-05-23 15:44 ` Geoff Patch
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel.Lidsten @ 2002-05-23  7:37 UTC (permalink / raw)
  To: gthomas; +Cc: ecos-discuss

>-----Original Message-----
>From: Gary Thomas [mailto:gthomas@redhat.com]
>Sent: den 22 maj 2002 16:00
>To: Andersson Daniel
>Cc: rrv@tid.es; ecos-discuss@sourceware.cygnus.com
>Subject: RE: [ECOS] interrupts
>
>
>On Wed, 2002-05-22 at 04:15, Daniel.Andersson@combitechsystems.com
>wrote:
>> Hi,
>> 
>> I read our below posting and was wondering if you maybe have 
>come to a
>> solution with our long ISR startup time?
>> 
>> Currently i have almost the same problem on my MPC850. 
>Everytime i receive
>> an interrupt then i get the following timeschedule: 
>> 
>> 0 -10us	I can see a lot of RAM access - dont know what 
>it is but i assume
>> that the SW investigate what 			caused 
>the interrupt
>> 
>> 10-32		I enter my isr which is 250 asm 
>instruction (it takes 22us)
>> 
>> 32-70		The code exits the ISR and starts doing 
>some other SW
>> processing that i dont know what it is. 			
>However, i
>> can see a lot of RAM access after that i have left the ISR but
>> 
>> 
>> My question is: What can cause my CPU to execute this slow? 
>The ISR, which
>> is 250 instruction, takes 22us and that can be reasonable. I 
>have looked at
>> the caches but find them to be working - as far as i can 
>tell at leased.
>> 
>
>Have you looked at the relevant code?  (You have the sources!)
>Most of this execution path is in 
>hal/powerpc/arch/current/src/vectors.S
>
>Don't forget that eCos is designed to be general.  While it 
>may be true 
>that your particular interrupt can be handled in 22us, it can 
>only do so
>if a proper environment has been set up.  The vectors.S (the VSR code
>actually) is responsible for saving the interrupted environment 
>(registers, etc), figuring out to call your ISR (there are many 
>interrupt choices, each with it's own ISR), calling your ISR and then,
>depending on the return value, possibly setting up to run a DSR later
>before returning to the interrupted context.
>
>You've not said much about your platform - MPC850 isn't sufficient
>detail.  What about the clock speed? RAM wait states?  I can infer
>from your note that the processor can execute approximately 10 
>instructions per us.  If you look at the VSR, it's quite plausible
>that 100 instructions need to be executed before calling your ISR.
>There will be nearly as many required on the way out.  This can be
>[somewhat] reduced by enabling 
>CYGDBG_HAL_COMMON_INTERRUPTS_SAVE_MINIMUM_CONTEXT.
>Also, depending on the configuration, the VSR may call into the kernel
>after your ISR for scheduling of possible DSR routines.  This is C/C++
>code, and it's very easy to expect it to execute the remaining 200
>instructions.
>
>It all makes sense to me (your numbers).  What else is running in your
>system?  Are you making use of the kernel, threads, etc?  If so, you
>pretty much have to expect some overhead.
>
>Of course, you could always install your own VSR (there is complete
>support for this) which tried to be ultra smart in the case of your
>one particular interrupt, but that code would still need to be able
>to handle other generic interrupts.
>

You say that the taskswitch that ia have before i get to my ISR code is
reasonable in time and now that i have examined what's actually happening
than i have to agree. Currently i am experiencing a taskswitch time of ~10us
and since i have such a small cache (2kb instr. and 1kb data in mpc850) then
i dont have any of the relevante code in the caches which means that i have
to make external access to RAM. Such access takes 40ns (burst). This means
that a taskswitch that takes 10us actually executes 250 instruction and i
find that ok.

My problem has at this point elevated to the position where i am unsure of
if the MPC850 is the right CPU choise for this application.

In my application i will receive atleased 5000 interrupt/s which makes the
context switch time a very large part of the systems total capacity. AFAIK
then the VSR code handles _all_ interrupts, is that right? Is there any way
of decreasing the latency on just one interrupt?

I have tried to put the entire VSR handler in dpram to speed up execution
but i only got a 15 percent decrease which of course isnt enough.

Just hypotheoretical - what performance would i get if i used a MPC823 that
has four times that cache size that i have in the MPC850. Could i expect
twice the performance of the 850....?

Regards, Daniel

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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* RE: [ECOS] interrupts
@ 2002-05-22  3:15 Daniel.Andersson
  2002-05-22  3:32 ` Andrew Lunn
  2002-05-22  7:00 ` Gary Thomas
  0 siblings, 2 replies; 13+ messages in thread
From: Daniel.Andersson @ 2002-05-22  3:15 UTC (permalink / raw)
  To: rrv, ecos-discuss

Hi,

I read our below posting and was wondering if you maybe have come to a
solution with our long ISR startup time?

Currently i have almost the same problem on my MPC850. Everytime i receive
an interrupt then i get the following timeschedule: 

0 -10us	I can see a lot of RAM access - dont know what it is but i assume
that the SW investigate what 			caused the interrupt

10-32		I enter my isr which is 250 asm instruction (it takes 22us)

32-70		The code exits the ISR and starts doing some other SW
processing that i dont know what it is. 			However, i
can see a lot of RAM access after that i have left the ISR but


My question is: What can cause my CPU to execute this slow? The ISR, which
is 250 instruction, takes 22us and that can be reasonable. I have looked at
the caches but find them to be working - as far as i can tell at leased.

Regards, Daniel


>-----Original Message-----
>From: Rafael Rodríguez Velilla [mailto:rrv@tid.es]
>Sent: den 30 maj 2001 12:58
>To: ecos
>Subject: Re: [ECOS] interrupts
>
>
>rob.wj.jansen@philips.com wrote:
>
>> > I`ve a problem with interrupts.I am working on MPC860. I 
>measured time
>> > latecy of handling interrupts (ISR only) and it is very 
>long time.I`ve
>> > default configuration in eCos Configuration tool.
>> > Do is it possible to shorten this time, if yes then in 
>which way can I do it
>>
>> Same problem exists on my 65 MHz ARM 710T board with 70 nsec 
>SRAM, the delay between entering the
>> low-level assembly routine in vectors.S and the actual start 
>of my (C) interrupt routine is about 15 micro secs.
>> This means that it takes about 1000 cpu cycles to find out 
>which interrupt was fired.
>> There is a lot of overhead involved in retrieving the index 
>into the hal_vsr_table.
>> I am thinking of converting the C functions into assembly to 
>speed up interrupt handling (with the penalty
>> that I'm not compatible with the rest of the world anymore.
>
>  In my system it only takes 1000 cycles to start the ISR, but 
>my system is not well designed, it uses an ARM7TDMI,
>running at 0.8 MHz, but with an 8 bit memory with a WAIT 
>state, so every word takes 8 cycles to be read, so the
>number of cycles that I suppose that the system would take 
>with a good memory configuration would be just 125
>cycles.
>
>  The place where I loose most of the time is in the 
>handle_IRQ routine (or something like that, located at the
>platform HAL), that is the routine that checks which device 
>has raised the IRQ. I think that eCos has a good
>performance with the IRQs and maybe you should optimise that routine.
>
>
>
>

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

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [ECOS] interrupts
@ 2001-05-30  4:55 rob.wj.jansen
  0 siblings, 0 replies; 13+ messages in thread
From: rob.wj.jansen @ 2001-05-30  4:55 UTC (permalink / raw)
  To: rrv; +Cc: ecos-discuss

Hm,

>  In my system it only takes 1000 cycles to start the ISR, but my system is not well designed, it uses an ARM7TDMI,
> running at 0.8 MHz, but with an 8 bit memory with a WAIT state, so every word takes 8 cycles to be read, so the
> number of cycles that I suppose that the system would take with a good memory configuration would be just 125
> cycles.

Thanks for the info.
I guess I'll have to walk through the assembly code to count the cycles, I have to admit that I am a bit confused 
bout the amount of time taken to handle the interrupt. 
Looking at the code most of the time (IMHO) will be lost in the hal_IRQ_handler function which, in my case,
only reads a register from the interrupt controller which returns a byte index in the array. Maybe the time has come
to add an assembly define (#define HAL_PLATFORM_IRQ_HANDLER). In my case a "ldr r1,=ADRRESS; ldr r0,[r1]"
would replace the complete hal_IRQ_handler.

I guess that such a kind of optimization would also be usable for the powerpc platform.

Regards,

	Rob Jansen

Software Engineer
Competence Center Platforms
BU Mobile Communications
Meijhorst 60-10, 6537 KT Nijmegen, The Netherlands
Tel: +31-24-353-6329
Fax: +31-24-353-3613
mailto:Rob.WJ.Jansen@philips.com


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [ECOS] interrupts
@ 2001-05-30  2:04 rob.wj.jansen
  2001-05-30  4:22 ` Rafael Rodríguez Velilla
  0 siblings, 1 reply; 13+ messages in thread
From: rob.wj.jansen @ 2001-05-30  2:04 UTC (permalink / raw)
  To: ecos-discuss

> I`ve a problem with interrupts.I am working on MPC860. I measured time
> latecy of handling interrupts (ISR only) and it is very long time.I`ve
> default configuration in eCos Configuration tool.
> Do is it possible to shorten this time, if yes then in which way can I do it

Same problem exists on my 65 MHz ARM 710T board with 70 nsec SRAM, the delay between entering the
low-level assembly routine in vectors.S and the actual start of my (C) interrupt routine is about 15 micro secs.
This means that it takes about 1000 cpu cycles to find out which interrupt was fired.
There is a lot of overhead involved in retrieving the index into the hal_vsr_table.
I am thinking of converting the C functions into assembly to speed up interrupt handling (with the penalty
that I'm not compatible with the rest of the world anymore.

Regards,

Rob Jansen

Sr. Software Engineer
Competence Center Platforms
BU Mobile Communications
Meijhorst 60-10, 6537 KT Nijmegen, The Netherlands
Tel: +31-24-353-6329
Fax: +31-24-353-3613
mailto:Rob.WJ.Jansen@philips.com

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [ECOS] interrupts
@ 2001-05-29 23:46 Nicpo&nacute
  0 siblings, 0 replies; 13+ messages in thread
From: Nicpo&nacute @ 2001-05-29 23:46 UTC (permalink / raw)
  To: ecos-discuss

I`ve a problem with interrupts.I am working on MPC860. I measured time
latecy of handling interrupts (ISR only) and it is very long time.I`ve
default configuration in eCos Configuration tool.
Do is it possible to shorten this time, if yes then in which way can I do it
?

Best regards

Marcin Nicpoń
mailto: nicpon@rts.com.pl
tel. (+48) 602533132

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

end of thread, other threads:[~2008-10-17 11:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-17 11:42 [ECOS] Interrupts Rick Davis
2008-10-18  8:33 ` Chris Zimman
2008-10-19  3:57   ` Rick Davis
  -- strict thread matches above, loose matches on Subject: below --
2002-05-23  7:37 [ECOS] interrupts Daniel.Lidsten
2002-05-23  7:48 ` Gary Thomas
2002-05-23 15:44 ` Geoff Patch
2002-05-22  3:15 Daniel.Andersson
2002-05-22  3:32 ` Andrew Lunn
2002-05-22  7:00 ` Gary Thomas
2001-05-30  4:55 rob.wj.jansen
2001-05-30  2:04 rob.wj.jansen
2001-05-30  4:22 ` Rafael Rodríguez Velilla
2001-05-29 23:46 Nicpo&nacute

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).