From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A7BC4385BF83; Tue, 14 Apr 2020 09:13:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7BC4385BF83 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug malloc/25817] Tune the number of malloc arenas based on the CPU affinity mask Date: Tue, 14 Apr 2020 09:13:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: malloc X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: flagtypes.name component cc short_desc 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 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Apr 2020 09:13:00 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D25817 Florian Weimer changed: What |Removed |Added ---------------------------------------------------------------------------- Flags| |security- Component|libc |malloc CC| |fweimer at redhat dot com Summary|__get_nprocs reads a file |Tune the number of malloc |rather than calling |arenas based on the CPU |sched_getaffinity |affinity mask --- Comment #1 from Florian Weimer --- Given that more and more kernel information is available only via /sys and /proc, the test expectations are not really valid. We have to open file descriptors behind the scenes occasionally, and it is impossible to predict what the future will bring in this regard. For malloc tuning, it may indeed be more reasonable to look at the current affinity mask. But we cannot do so by changing __get_nprocs because some software depends on that returning 1 if the system is a true uniprocessor system because it uses this information to elide barriers, depending on the return value of sysconf (_SC_NPROCESSORS_ONLN). See bug 21542. For the malloc tuning, this does not matter because the locks are there no matter whether the system is SMP or not. (Internally, we have a different w= ay to elide atomics on some architectures, by parsing uname -v output. I'm sure you didn't want to know that.) --=20 You are receiving this mail because: You are on the CC list for the bug.=