This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542]
On 06/09/2017 02:32 PM, H.J. Lu wrote:
> On Fri, Jun 9, 2017 at 5:28 AM, Florian Weimer <firstname.lastname@example.org> wrote:
>> 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
> The information is there. We just need to store the result in
> cpu_features and return it in __default_nprocs ().
It still needs another sysdeps override for __default_nprocs (). This
is what I meant.
>> distinction is what patterns, I don't think it's possible to get this
>> data reliably from CPUID.
> No. Reliable data needs ACPI table.
Exactly. A single-core, single-thread processor might still be running
in a multi-socket configuration. And with virtualization, it's not safe
to list CPU names, either.