This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542]
- From: Florian Weimer <fweimer at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Zack Weinberg <zackw at panix dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 9 Jun 2017 14:28:35 +0200
- Subject: Re: [PATCH] sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=fweimer at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 18869C04B31E
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 18869C04B31E
- References: <20170602142100.DA8D0404970C8@oldenburg.str.redhat.com> <53df940b-5669-7684-65b3-317d85ac7828@redhat.com> <CAKCAbMh-YEdoqa2Gtk2d3S=jg3VACDGsHjgHi2v12uaj1+GFzA@mail.gmail.com> <86c52e77-d535-a8e7-444c-988a3c34e279@redhat.com> <CAMe9rOrCrQyUcEx5iy-e_r0Ru2MLC40cSObtM9qg=evpfS94wQ@mail.gmail.com>
On 06/09/2017 02:26 PM, H.J. Lu wrote:
> On x86, we compute the number of threads which share L3
> cache in a package via CPUID. We should use this info as
> default on x86.
That would only allow us to return a larger value than 2 in this case,
wouldn't it?
I don't know if the additional complexity is worth it. The 1/2
distinction is what patterns, I don't think it's possible to get this
data reliably from CPUID.
Thanks,
Florian