Re: Cache line size



On Sun, Sep 10, 2006 at 08:34:46PM -0400, John Richard Moser wrote:

Is there a way for the Linux Kernel to know the cache line size of the
CPU it's on, besides #define X86_CACHE_LINE_SZ 32 or whatnot? I am
looking in /proc/cpuinfo trying to determine how to run caching
optimizations and interested in this information and its implications.
It may also be useful if I can get this information at run time in
application code.

You can use /dev/cpu/x/cpuid to read it directly from the CPU.
See the source of x86info for examples.

Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [BUG] x86 kenel wont boot under Virtual PC
    ... Instead of just including optimizations for the selected ... The kernel will not necessarily run on earlier architectures ... I thought you agreed that CPU virtualization can be a problem? ... exactly how does the kernel fail to boot with latest -git? ...
    (Linux-Kernel)
  • Re: [BUG] x86 kenel wont boot under Virtual PC
    ... optimizations have historically really been about _optimizing_, ... those exceptions have been way more imporant than NOPL). ... actually enables EMBEDDED and does all his choices by hand should no ... The difference between a kernel compiled for generic and once compiled for a specific CPU can be very significant. ...
    (Linux-Kernel)
  • Re: When is "volatile" used instead of "lock" ?
    ... Maybe a poor choice of an overload term, but I did say "compiler from having ... processor caching, not compiler optimizations. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: -Os versus -O2
    ... On what CPU? ... different tricks to avoid poor optimizations, and at the end, the CPU ... Well you better report those! ... a kernel which is about 300 kB, or 700 kB with the initramfs. ...
    (Linux-Kernel)
  • Re: Raffys Karma
    ... get away with saying, "Oh, let the CPU worry about it". ... -- programmers are all walking around saying f*ck it, ... And the sad thing is that due to this attitude, ... heavily optimized -- optimizations still happen when they make sense. ...
    (comp.lang.lisp)