[lkml]   [2002]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: adjust prefetch in free_one_pgd()
>>>>> 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

 \ /
  Last update: 2005-03-22 13:27    [W:0.048 / U:2.232 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site