Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Assembly x86 > Re: Interrupt l...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 29 Topic 4575 of 4729
Post > Topic >>

Re: Interrupt latency

by Stargazer <spamtrap@[EMAIL PROTECTED] > Mar 17, 2008 at 05:41 AM

On Mar 17, 2:38 am, "Alexei A. Frounze"  <spamt...@[EMAIL PROTECTED]
> wrote:
> On Mar 16, 4:02 pm, Stargazer  <spamt...@[EMAIL PROTECTED]
> wrote:
>
>
>
>
>
> > Hi,
>
> > I am writing my own real-time kernel for x86. Now I face something
> > really strange (or may be rather it's not; it has been some time since
> > I was in the details of x86 microarchitecture).
>
> > I measured CPU clocks elapsed between the first assembly instruction
> > executed at interrupt's entry point in IDT and beginning of the C code
> > of user-defined interrupt handler and the result was a big
> > surprise :-) It took about 2500 cycles despite that I have only a
> > handful of assembly instructions before a call to user-supplied IRQ
> > handler.
>
> > A little more testing showed that almost all cycles (2300+) were spent
> > at access to a global variable (via ds:[] addressing). Nothing that
> > accesses stack memory (push, pop, call, mov) makes a noticeable
> > difference. Does anybody have an idea why this happens? I test on
> > Celeron 2.8G in protected mode set up for flat model with paging
> > disabled.
>
> > I can post the code of the interrupt's entry point (until the C entry
> > point is called), but it's rather trivial and not long.
>
> > Thanks,
> > D
>
> What are the min, max and average cycle counts (you need to repeat the
> measurement many times)?
> What are the numbers on other PCs?

A weird thing is that the difference between min and max is about 10
cycles. That is, results are fairly accurate and consistent.
I didn't test on other PCs yet.

> I wonder if it's SMIs. On my Dell Latitude D610 notebook an SMI (or a
> short burst of thereof) may take up to ~240K cycles, which is ~150
> microseconds at 1.6 GHz; on the old Compaq Armada 7800 notebook it's
> only 12K cycles or ~40 microseconds at 300 MHz. Hardware bugfixes and
> control are moving into the CPU. :(

I don't know. It's a single instruction that accounts for over 2000
cycles, I can point the instruction but don't understand the reason.
It's a read-modify-write (INC ds:[xxx]) and it has to do something
with the nature of instruction being RMW. Actually I have a BT ds:
[xxx] (read) several instructions before it, which doesn't cause
anything abnormal.

It sounds weird if SMI would somehow be triggered on each and any
hardware interrupt.


D
 




 29 Posts in Topic:
Interrupt latency
Stargazer <spamtrap@[  2008-03-16 16:02:18 
Re: Interrupt latency
Didi <spamtrap@[EMAIL  2008-03-16 18:27:36 
Re: Interrupt latency
"Alexei A. Frounze&q  2008-03-16 17:38:55 
Re: Interrupt latency
Tim Wescott <spamtrap  2008-03-16 19:33:53 
Re: Interrupt latency
larwe <spamtrap@[EMAI  2008-03-16 19:01:26 
Re: Interrupt latency
Vladimir Vassilevsky <  2008-03-17 00:54:34 
Re: Interrupt latency
Cyril Novikov <spamtr  2008-03-16 21:00:13 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-17 05:50:48 
Re: Interrupt latency
"Wolfgang Kern"  2008-03-17 11:12:24 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-17 05:41:15 
Re: Interrupt latency
"Wolfgang Kern"  2008-03-17 11:12:24 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-17 06:16:07 
Re: Interrupt latency
Cyril Novikov <spamtr  2008-03-17 18:44:18 
Re: Interrupt latency
"Wolfgang Kern"  2008-03-18 13:25:34 
Re: Interrupt latency
(Patrick Klos) <spamtr  2008-03-17 13:08:46 
Re: Interrupt latency
"tbroberg_nospam@[EM  2008-03-17 11:11:13 
Re: Interrupt latency
"Marven Lee" &  2008-03-17 20:06:44 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-18 02:08:36 
Re: Interrupt latency
Timothy Baldwin <spam  2008-03-19 00:38:20 
Re: Interrupt latency
Tim Roberts <spamtrap  2008-03-19 05:05:43 
Re: Interrupt latency
Cyril Novikov <spamtr  2008-03-19 06:58:44 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-18 02:03:22 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-18 01:58:38 
Re: Interrupt latency
"Wolfgang Kern"  2008-03-19 00:12:52 
Re: Interrupt latency
Stargazer <spamtrap@[  2008-03-18 02:12:51 
Re: Interrupt latency
Matt <spamtrap@[EMAIL  2008-03-18 17:26:13 
Re: Interrupt latency
James Harris <spamtra  2008-03-19 08:42:21 
Re: Interrupt latency
Cranky <spamtrap@[EMA  2008-03-20 10:37:11 
Re: Interrupt latency
"Ignacio G.T."   2008-03-24 16:13:11 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:04:40 CDT 2008.