2006-01-30 17:25:36

by Liang Yang

[permalink] [raw]
Subject: Can I do a regular read to simulate prefetch instruction?

Hi,

I find out some network card drivers (e.g. e1000 driver) use prefetch
instruction
to reduce memory access latency and speed up data operation. My question is:
Support we want to pre-read a skb buffer into the cache, what is the
difference
between the following two methods, i.e. what is the different when using
prefetch
and using a regular read opertation?
1. use prefetch instruction to stimulate a pre-fetch of the skb address,
e.g. prefetch(skb);
2. use an assignment statement to stimulate a pre-fetch of the skb address,
e.g. skb1 = skb;

I was told the data will be prefetched into a so-called prefetching queue
only by
using prefetching instruction? Is this true?

Thanks,

John