mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* TLB IPI FLushTLB vs Invl Page
@ 2008-09-02 20:01 jmerkey
  0 siblings, 0 replies; only message in thread
From: jmerkey @ 2008-09-02 20:01 UTC (permalink / raw)
  To: linux-kernel


Analysis on this one has been done by others on other OS's.   Results are:


NMI IPI which results in TLB flush

mov eax, cr3
mov cr3,eax

vs.

invlpg [page]


TLB flushing always blows out the TLB and it usually takes 150 clocks
(cumulative over time) for the processor to recover.  invlpage is more
lightweight but takes around 100 clocks for the system to recover.

Easiest way to measure the two is to write a short program loop that does
something like (holding the processor into this loop):


while (1)
{
   FlushTLB();
   counter++;
}


vs.

while (1)
{
   Invlpg(page);
   counter++;
}


and compare which one counts higher on all processors -- this one is less
overhead on the bus overall.

I did the same tests many years ago and compared these two instructions.

results were invlpg saves you on performance but overall was no better
than flushing the entire TLB since you end up ending more IPI's on average.

Jeff





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-02 20:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-02 20:01 TLB IPI FLushTLB vs Invl Page jmerkey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®