From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EF79C384FB44; Tue, 21 Feb 2023 17:31:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EF79C384FB44 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677000676; bh=8IglUe7QL/O7OLtzkq08xQaInUz4Plg6DffpG7+ruXc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=s3SCYPnky4xr2SvKfe/zyj9BUscEq4e7s3puK6D5LvBOcb3QCnKg3IYApDYPmdYgV mXm3+WdwMHIYKQYvVfVmRTdnErse7rqqDu7/wWxO4NI/19jEbbEZmjuMmMJP2oSQLo 3BQ5psxBlrKAqgfYyvvXQqLjAmYU/Z2f3NVJb59U= From: "steffen at sdaoden dot eu" To: glibc-bugs@sourceware.org Subject: [Bug libc/30135] sysconf: _SC_NPROCESSORS*: tweak? Date: Tue, 21 Feb 2023 17:31:16 +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: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- 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 #6 from Steffen Nurpmeso --- Quite honestly. That is too high for me. All i know is nproc(1) (of busybox, coreutils, now also FreeBSD (devel)) ge= ts it right, but (portable) compiled applications using sysconf(3) do not. (I was only looking at two known-threaded, xz and zstd, they both will be trapped in doing the wrong thing.) And "not stable" sounds a bit peculiar given that cgroups are decades old, = no? Linux documentation in-file dates are 2004 for v1 and 2015 for v2. And cpuset.cpus is actually in both, i think mkdir /sys/fs/cgroup/NAME || return echo 1-3 > /sys/fs/cgroup/NAME/cpuset.cpus To me this looks as if Linux userspace is forcing (somewhat, now standardiz= ed) portable applications to do the wrong thing for many, many years. I do not know about "cgroup protocol" or why that is slow -- sched_getaffinity(2) is what is used by nproc(1)s. Broken synchronization patterns. Heh. --=20 You are receiving this mail because: You are on the CC list for the bug.=