[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-12-02 Thread Simon Chopin
** Tags removed: rls-jj-incoming ** Tags added: foundations-todo ** Changed in: glibc (Ubuntu Jammy) Assignee: Mauricio Faria de Oliveira (mfo) => Simon Chopin (schopin) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bug

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-12-02 Thread Mauricio Faria de Oliveira
** Attachment added: "test-glibc-malloc.c" https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2089789/+attachment/5841534/+files/test-glibc-malloc.c -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-28 Thread Mauricio Faria de Oliveira
** Description changed: [Impact]  * Jammy has a malloc() performance degradation    if CPU affinity masks are used (not default).  * The maximum number of arenas for malloc() is    calculated based on the number of processors.    However, glibc 2.34 changed that to be based

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-28 Thread Mauricio Faria de Oliveira
Coordinated this SRU with Simon Chopin in Foundations, who handles most glibc uploads; this will be discussed and planned for the next round of bug-fixes/glibc SRU. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-28 Thread Mauricio Faria de Oliveira
Debdiff used for the PPA builds (successful in all architectures). ** Patch added: "lp2089789-glibc-jammy.debdiff" https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2089789/+attachment/5840918/+files/lp2089789-glibc-jammy.debdiff -- You received this bug notification because you are a mem

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-28 Thread Simon Chopin
** Tags added: rls-jj-incoming -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089789 Title: malloc performance degradation with CPU affinity masks To manage notifications about this bug go to: http

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Build-testing in all supported architectures in a PPA with only the -security pocket enabled. https://launchpad.net/~mfo/+archive/ubuntu/lp2089789 ** Description changed: [Impact] - * Jammy has a malloc() performance degradation -if CPU affinity masks are used (not default). +  * Jammy

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
** Description changed: - https://sourceware.org/bugzilla/show_bug.cgi?id=30945 + [Impact] + + * Jammy has a malloc() performance degradation +if CPU affinity masks are used (not default). + + * The maximum number of arenas for malloc() is +calculated based on the number of processors.

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Now with the patch [1] applied, it is back to normal. $ dpkg -s libc6 | grep Version: Version: 2.35-0ubuntu3.8+gd47c5e4db792 Without per-CPU affinity (average: 63ms) -- no regression $ ./test-glibc-malloc 56 false false nr_cpu: 56 pin: no fix: no thread average (ms): 69.9

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Some snippets (more line breaks for clarity) from https://sourceware.org/bugzilla/show_bug.cgi?id=30945 """ <...> The deserialization library we used works 10x slower than expected. Investigations show that this is due to the arena_get2 function uses __get_nprocs_

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089789 Title: malloc performance degradation with CPU affinity masks To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+s

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Reproducer with a Jammy LXD container. System with 56 processors ("threads"). LXD and gcc setup: $ lxc launch ubuntu:jammy glibc-jammy $ lxc exec glibc-jammy -- su - ubuntu $ wget -O test-glibc-malloc.c https://sourceware.org/bugzilla/attachment.cgi?id=15156 $ su

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Checking for required dependencies of the last commit above: --- Commits in-between the first offender and final fix, in the development branch: $ git log --oneline origin/master -- sysdeps/unix/sysv/linux/getsysstats.c | grep -v 'Update copyright dates' 472894d2cfee malloc: Use

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
Related git commits, starting with the first related change, and finishing with the fix required. The intermediary commits provide some context used later to understand the required dependencies. --- The initial commit changed __get_nprocs() to use sched_getaffinity() instead of sysfs and procfs

[Bug 2089789] Re: malloc performance degradation with CPU affinity masks

2024-11-27 Thread Mauricio Faria de Oliveira
** Description changed: - WIP. + https://sourceware.org/bugzilla/show_bug.cgi?id=30945 -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/2089789 Title: malloc performance degradation with CPU affinity