On Tue, Apr 23, 2013 at 12:17 PM, Ren Zhen <[email protected]> wrote:
> Hi everybody,
>        For  /sys/devices/system/cpu/cpu0/cache/index0/coherency_line_size,
> I execute the cmd '#cat  coherency_line_size',then it  return '64'.
>        My OS is Ubuntu 12.04, CPU is intel core i3.
>        Here is my problem, what is coherency_line_size ? what is its usage?
>        Any help will be appreciated!

Hello,

According to [1] and [2], that would be the size of a cache line.
So, in your case, a cache line can hold 64 bytes of data.
As for the usage, when you allocate memory, your CPU aligns it to  8
or 16 bytes, depending on whether you have a 32-bit machine or a
64-bit machine.
In you wish to take advantage of the cache, you should align your
memory allocations to the cache size (64 in your case). The functions
listed at [3] assist you in doing that.
Hope this helps.

[1] 
http://superuser.com/questions/405355/meaning-of-files-in-cpu-folder-of-linux
[2] 
http://jkukunas.blogspot.ro/2009/04/determining-cache-coherency-line-size.html
[3] http://linux.die.net/man/3/valloc

--
Silviu Popescu

_______________________________________________
Kernelnewbies mailing list
[email protected]
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Reply via email to