This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] powerpc: fix sysconf support for cache geometries
- From: Paul Clarke <pc at us dot ibm dot com>
- To: Richard Henderson <rth at twiddle dot net>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, Benjamin Herrenschmidt <benh at kernel dot crashing dot org>
- Date: Thu, 15 Jun 2017 18:53:09 -0500
- Subject: Re: [PATCH] powerpc: fix sysconf support for cache geometries
- Authentication-results: sourceware.org; auth=none
- References: <email@example.com> <firstname.lastname@example.org>
- Reply-to: pc at us dot ibm dot com
On 06/15/2017 04:03 PM, Richard Henderson wrote:
> On 06/15/2017 01:45 PM, Paul Clarke wrote:
> Any thoughts on falling back to AT_*CACHEBSIZE for _SC_LEVEL1_*CACHE_LINESIZE
> for older kernels where AT_L1*_CACHEGEOMETRY is not present?
Ben'll tell you (as he told me ;-) that those aren't the same thing. The former, "CACHEBSIZE", is the cache block size, which is the unit size for cache operations (e.g. "Cache Block Touch", "Cache Block Clear", etc.). The latter, "CACHE_LINESIZE", is, well, the cache line size (with respect to associativity, etc.).
That being said, it's probably fine to conflate the two for older kernels and L1 only.
Did you want to respin your sysconf patch? I notice you also included L4, which always returns 0, a value, unlike my patch, which will fail (return -1, EINVAL). Yours may be preferred in that regard, since the "names" for the L4 queries are not completely unknown.