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 27 of 29 Topic 4575 of 4729
Post > Topic >>

Re: Interrupt latency

by James Harris <spamtrap@[EMAIL PROTECTED] > Mar 19, 2008 at 08:42 AM

On 17 Mar, 13:16, Stargazer  <spamt...@[EMAIL PROTECTED]
> wrote:

....

> > > A little more testing showed that almost all cycles (2300+) were
spent
> > > at access to a global variable (via ds:[] addressing).

....

> It appears
> that the "inc dword [_running_irq]" accounts for all the mess.
>
> BTW, now I notice that there is not only read through ds:[] (bt), but
> also two writes to ds:[] following the rtdsc that I use to store time
> stamp for further comparison and neither causes any anomaly. So it
> just strengthens my suspect that RMW instruction has some strange
> effect on more distant caches. Does anybody have an idea?

--- <code snipped> ---

I'm a bit confused as to how the measurements are taken. Why not try
to measure by using the following which is based on

http://cs.smu.ca/~jamuir/rdtscpm1.pdf

cpuid
rdtsc
mov subtime, eax
cpuid
rdtsc
sub eax, subtime
mov subtime, eax

cpuid
rdtsc
mov subtime, eax
cpuid
rdtsc
sub eax, subtime
mov subtime, eax

cpuid
rdtsc
mov subtime, eax
cpuid
rdtsc
sub eax, subtime
mov subtime, eax // Only the last value of subtime is kept
// subtime should now represent the overhead cost of the
// MOV and CPUID instructions


....other instructions...


;Test 1: the single inc instruction

cpuid // Serialize execution
rdtsc // Read time stamp to EAX
mov time_1, eax ;Time for this instruction

inc     dword [_running_irq]    #Taken from your code

cpuid // Serialize again for time-stamp read
rdtsc
sub eax, time_1 // Find the difference
mov time_1, eax


....other instructions...


#Now time_1 minus subtime should give length of test 1

(As you know the above clobbers eax, ebx, ecx, edx each time cpuid is
run so you need to push/pop to protect them if needed.)

If the time is still of the order of 2000 cycles maybe try splitting
your inc instruction to

mov esi, _running_irq
inc esi
mov _running_irq, esi

where esi is used as eax will be trashed. If still as long (unlikely,
for the reasons you mentioned) then you could split the measurement
points.

--
James
 




 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 Thu Jul 24 14:58:27 CDT 2008.