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

Mauricio Faria de Oliveira 2089789 at bugs.launchpad.net
Wed Nov 27 20:48:24 UTC 2024


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
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/2089789

Title:
  malloc performance degradation with CPU affinity masks

Status in glibc package in Ubuntu:
  Fix Released
Status in glibc source package in Jammy:
  Confirmed

Bug description:
  https://sourceware.org/bugzilla/show_bug.cgi?id=30945

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/glibc/+bug/2089789/+subscriptions




More information about the foundations-bugs mailing list