public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* adding _SC_LEVEL_*CACHE* support
@ 2005-04-20  5:03 David Mosberger
  0 siblings, 0 replies; only message in thread
From: David Mosberger @ 2005-04-20  5:03 UTC (permalink / raw)
  To: libc-hacker

Today it was brought to my attention that the following sysconf
constants

   _SC_LEVEL1_ICACHE_SIZE
   _SC_LEVEL1_ICACHE_ASSOC
   _SC_LEVEL1_ICACHE_LINESIZE
   _SC_LEVEL1_DCACHE_SIZE
   _SC_LEVEL1_DCACHE_ASSOC
   _SC_LEVEL1_DCACHE_LINESIZE
   _SC_LEVEL2_CACHE_SIZE
   _SC_LEVEL2_CACHE_ASSOC
   _SC_LEVEL2_CACHE_LINESIZE
   _SC_LEVEL3_CACHE_SIZE
   _SC_LEVEL3_CACHE_ASSOC
   _SC_LEVEL3_CACHE_LINESIZE
   _SC_LEVEL4_CACHE_SIZE
   _SC_LEVEL4_CACHE_ASSOC
   _SC_LEVEL4_CACHE_LINESIZE

do not return useful values on ia64.  That's reasonably easy to fix by
peeking into /proc/pal/cpu0/cache_info and arbitrarily assuming that
all CPUs have the same cache structure.  What's no so easy to fix is
that these constants assume that only the L1 cache may be split.  Is
it possible to introduce additional constants of this sort to support
CPUs which have split caches at higher levels?  Perhaps it would make
sense to add _ICACHE_ variants L2-L4 with the understanding that the
normal _CACHE_ variants would refer to the D-cache in case that level
is split?

	--david

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-04-20  5:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-20  5:03 adding _SC_LEVEL_*CACHE* support David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).