All of lore.kernel.org
 help / color / mirror / Atom feed
* Pentium SSE prefetcht0 instruction... How do you make it work
@ 2001-09-27 18:40 Bulent Abali
  2001-09-27 18:43 ` Tony Hagale
  2001-09-27 19:54 ` Robert Love
  0 siblings, 2 replies; 5+ messages in thread
From: Bulent Abali @ 2001-09-27 18:40 UTC (permalink / raw)
  To: linux-kernel; +Cc: abali

I have a system with a large external L3 cache.   Uses Pentium III
Coppermine (stepping 3) processor.   L3 block size is relatively long.  I
am trying to increase the L3 performance by prefetching L3 lines.  I
thought prefetcht0, t1, t2, nta instructions may help.  These instructions
prefetch L1/L2 lines in to the processor therefore they should prefetch L3
as well.   However I see no benefit.  It is as if prefetch never make it to
the front side bus.  I took the example of arch/i386/lib/mmx.c to implement
the asm level routines.    Perhaps I am overlooking something.  I'd
appreciate any suggestions.   /Bulent

//This should prefetch an L2 line at addr (hence L3 line prefetch)
inline void L3_prefetch (char * addr)
{
     asm volatile("prefetcht1 %0" :: "m" (addr));
}



^ permalink raw reply	[flat|nested] 5+ messages in thread
* Re: Pentium SSE prefetcht0 instruction... How do you make it work
@ 2001-09-27 20:09 Bulent Abali
  0 siblings, 0 replies; 5+ messages in thread
From: Bulent Abali @ 2001-09-27 20:09 UTC (permalink / raw)
  To: Tony Hagale; +Cc: linux-kernel




>Intel's p3/4 prefetch instructions are hints only. They are only executed
>asynchronously, and depend heavily on the other load on the processor at
>the time. They are not required to prefetch, *and* they are not required
>to be executed when you think they should in the flow of the program. You
>can serialize them by using an MFENCE instruction, but they still aren't
>guaranteed to run.
>
>Check the p4 manuals. In fact, I'm not sure prefetch was implemented in
>p3. I could be wrong, check the manual.
>
>--Tony
PREFETCHx are in P3. I am aware that processor executes them optionally.
MFENCE may be a good idea.  If load/store queues are full the processor
may just drop the prefetch instruction.  I should try this.
Thanks for the suggestion.  /bulent




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

end of thread, other threads:[~2001-09-27 20:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-27 18:40 Pentium SSE prefetcht0 instruction... How do you make it work Bulent Abali
2001-09-27 18:43 ` Tony Hagale
2001-09-27 19:55   ` Robert Love
2001-09-27 19:54 ` Robert Love
  -- strict thread matches above, loose matches on Subject: below --
2001-09-27 20:09 Bulent Abali

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.