Re: Fw: potential /dev/urandom scalability improvement

From: Arjan van de Ven
Date: Sat Mar 27 2004 - 02:50:44 EST


On Fri, Mar 26, 2004 at 01:17:36PM -0800, Andrew Morton wrote:
> If someone does
>
> prefetch_range(4090, 20);
>
> on 4k pagesize, what should we do?

well if the datastructure you prefetch crosses pageboundary you know both
pages are safe to prefetch.

> Issuing a single
>
> prefetch 4090
>
> sounds reasonable.
>
> In that case I'm arranging for it to perform
>
> prefetch (4096 - 32)
>
> in that case, which seems neater.

well prefetch is defined as "get the cacheline the address is located in";
eg the cpu does the rounding to cacheline size for you.

(btw prefetch stride isn't the cacheline size! it's how far you're supposed
to prefetch ahead to get any useful gain, si for aligning and stuff it's
useless)

Attachment: pgp00000.pgp
Description: PGP signature