I am trying to use the WBINV instruction for Linux to clear the L1 processor cache.
The following program compiles, but when you try to start it, a segmentation error occurs.
int main() {asm ("wbinvd"); return 1;}
I am using gcc 4.4.3 and running the Linux kernel 2.6.32-33 in my x86 field.
Processor Information: Intel (R) Core (TM) 2 Duo CPU T5270 @ 1.40 GHz
I built the program as follows:
$ gcc
$. / a.out
Segmentation error
Can someone tell me what I'm doing wrong? How to do it?
PS: I am running several performance tests and want the previous contents of the processor cache to not affect the results.
roelf source share