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: Zack Weinberg <zackw at panix dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Fri, 9 Jun 2017 14:22:40 +0200
- Subject: Re: [PATCH] sysconf: Use conservative default for _SC_NPROCESSORS_ONLN [BZ #21542]
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx08.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 9BF4CC057FA4
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9BF4CC057FA4
- References: <20170602142100.DA8D0404970C8@oldenburg.str.redhat.com> <53df940b-5669-7684-65b3-317d85ac7828@redhat.com> <CAKCAbMh-YEdoqa2Gtk2d3S=jg3VACDGsHjgHi2v12uaj1+GFzA@mail.gmail.com>
On 06/09/2017 02:17 PM, Zack Weinberg wrote:
> On Fri, Jun 9, 2017 at 8:11 AM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 06/02/2017 04:21 PM, Florian Weimer wrote:
>>> 2017-06-02 Florian Weimer <fweimer@redhat.com>
>>>
>>> [BZ #21542]
>>> * sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Default to
>>> two if no accurate information is available.
>>> * posix/tst-sysconf-empty-chroot.c: New file.
>>> * posix/Makefile (tests): Add it.
>>
>> Ping?
>>
>> <https://sourceware.org/ml/libc-alpha/2017-06/msg00101.html>
>
> It seems reasonable to me but I'm not sure I understand all of the implications.
The implication is that the Hotspot JVM no longer crashes in a chroot on
an SMP host because it assumes a UP host and elides atomics.
The downside is that some other application could choose to use
spinlocks on a UP system because glibc suggests it's SMP, which could
result in terrible performance.
All this is just for the corner case of an improperly setup
chroot/contain (lacking key parts of /sys and /proc).
Thanks,
Florian