RE: How to disable the CPU cache?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Good man,, this seems to be good choice then rather than modifying CACHE
constant,, anyways with the value 4 it seems working.

Thank You.

-Vamsi

-----Original Message-----
From: Yang Huang [mailto:justin8086@xxxxxxxxx] 
Sent: Thursday, March 09, 2006 4:13 PM
To: Vamsi Krishna (WT01 - Wireless Networks and Devices)
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: How to disable the CPU cache?


Hi list,

finally I "steal" a piece of code from memtest86 3.2, named cache_off(),
invoke it in a module and insmod. I feel immediately the system is
slowed down!

I believe this will definitely disable the cache, though not yet sure
whether both L1 and L2 cache are disabled. Any suggestions?

here is the code below:

static inline void cache_off(void)
{
        asm(
		"push %eax\n\t"
		"movl %cr0,%eax\n\t"
                "orl $0x40000000,%eax\n\t"  /* Set CD */
                "movl %eax,%cr0\n\t"
		"wbinvd\n\t"
		"pop  %eax\n\t");
}

have fun with it...

Yang

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux