Re: adjust prefetch in free_one_pgd()

From: David Mosberger (
Date: Fri Aug 02 2002 - 10:39:24 EST

>>>>> On 02 Aug 2002 14:04:21 +0100, Alan Cox <> said:

  Alan> It isnt a case of PREFETCH_STRIDE - thats the optimal
  Alan> fetchahead. You must never prefetch an address beyond the end
  Alan> of an object. So you actually need two loops one prefetching,
  Alan> then one to finish the job off which does not prefetch.

  Alan> Otherwise one day your page ends up against the ISA or PCI
  Alan> address space or something else undesirable and on some cpus
  Alan> the prefetch then variously confuses the PCI device or
  Alan> corrupts the cache.

I thought the prefetches API intended this to be a safe operation?
It's definitely not an issue on ia64: there, prefetches against
uncached memory translations are automatically canceled.

Note that there are many other prefetches in the kernel which may end
up prefetch "invalid" addresses (though it may often be address 0
that's being prefetched; perhaps that OK even on arches where you may
not prefetch against ISA or PCI addresses).

  Alan> Prefetching stuff you don't need is bad manners anyway 8)

That would work for me (though it would increase code size). My patch
was intended as a minimal fix for a rather obvious typo (or perhaps it
was a thinko... ;-).

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed Aug 07 2002 - 22:00:19 EST