Re: [PATCH] x86: create array based interface to change page attribute

Arjan van de Ven
2008-03-31T09:57:36Z

Andi Kleen wrote:

> Also it is doubtful clflush really makes sense on a large array. Just
> doing wbinvd might be faster then.

wbinvd is rarely a good idea; think about it... it'll flush 12Mb of cache *per socket* in one instruction.
(on a modern Intel consumer grade CPU, more on the enterprise ones)
This doesn't only impact the current logical thread, but ALL of the threads in the system, since the cache
coherency needs to be preserved, all have to go empty at the same time.
Forget real time... this can take really long even for non-realtime users ;)

At least clflush breaks this up into smaller pieces so total latency won't suck entirely.