From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6BAAC3858C00; Mon, 20 Feb 2023 20:50:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6BAAC3858C00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676926214; bh=9yE/eTe9lTn/luTC2QdfJxWyLC3FVaCeZJDQwMZ16qE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=L4dPIGe4WQKlE1ga9RgQahequaaaky2tBh0zlTtVb2gui22rn7krm3fWjHTSBFsdn gL/nYBkfp2WO0isWd5EIA+PwnPTTkIpDMsxqGP8ycuJGxwIn6dAZzHr45B6lsZFojI iXu8T2c478ya6ov9WD+rXLM1k7VkZEIuSHk7/Kpc= From: "steffen at sdaoden dot eu" To: glibc-bugs@sourceware.org Subject: [Bug libc/30135] sysconf: _SC_NPROCESSORS*: tweak? Date: Mon, 20 Feb 2023 20:50:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: steffen at sdaoden dot eu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30135 --- Comment #2 from Steffen Nurpmeso --- . sysconf and _SC_NPROCESSORS_ONLN is the only standardized variant, sched_getaffinity() is not a portable interface. . I feel "currently available to run threads" pretty much matches that CPU_COUNT() thing that nproc(1) uses. . For example, look at zstd(1), they use sysconf(_SC_NPROCESSORS_ONLN) to realize -T0. Same for xz(1). This is _all_ wrong in my cgroup restricted environment, they potentially "over-thread". . Quite the opposite, top(1) is to be changed (a bit strange as my version = is from https://gitlab.com/procps-ng aka /proc based) If i run it in a cgroup-mutilated environment with three CPUs, it lists a fourth one that is out of scope! . I have not checked virtual machines. It astounds me they use synthesized= CPU counts instead of the CPU count that truly is available. --=20 You are receiving this mail because: You are on the CC list for the bug.=