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

        $ sudo apt update
        $ sudo apt install --yes gcc
        $ gcc -o test-glibc-malloc test-glibc-malloc.c

        $ nproc
        56

        $ dpkg -s libc6 | grep Version:
        Version: 2.35-0ubuntu3.8

Without per-CPU affinity (average: 70ms)

        $ ./test-glibc-malloc 56 false false
        nr_cpu: 56 pin: no fix: no
        thread average (ms): 82.383206

        $ ./test-glibc-malloc 56 false false
        nr_cpu: 56 pin: no fix: no
        thread average (ms): 64.518794

        $ ./test-glibc-malloc 56 false false
        nr_cpu: 56 pin: no fix: no
        thread average (ms): 75.425471

        $ ./test-glibc-malloc 56 false false
        nr_cpu: 56 pin: no fix: no
        thread average (ms): 64.692622

        $ ./test-glibc-malloc 56 false false
        nr_cpu: 56 pin: no fix: no
        thread average (ms): 63.640988

With per-CPU affinity (average: 15700ms)

        $ ./test-glibc-malloc 56 true false
        nr_cpu: 56 pin: yes fix: no
        thread average (ms): 15942.782619

        $ ./test-glibc-malloc 56 true false
        nr_cpu: 56 pin: yes fix: no
        thread average (ms): 15555.405825

        $ ./test-glibc-malloc 56 true false
        nr_cpu: 56 pin: yes fix: no
        thread average (ms): 16291.390243

        $ ./test-glibc-malloc 56 true false
        nr_cpu: 56 pin: yes fix: no
        thread average (ms): 16559.855197

        $ ./test-glibc-malloc 56 true false
        nr_cpu: 56 pin: yes fix: no
        thread average (ms): 14171.939208

-- 
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/+source/glibc/+bug/2089789/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to