New issue
Advanced search Search tips

Issue 897064 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

libmalloc has poor performance for cross-thread frees.

Project Member Reported by erikc...@chromium.org, Oct 19

Issue description

There are several magazines for allocations [segmented by allocation size]. 

The large magazine has a global lock. 

For the small magazine, there is a lock per logical cpu. Allocations grab the lock of the current CPU, but frees grab the lock of the CPU at time of allocation. There will be heavy lock contention if one thread allocates and another frees. 

I didn't check the code for tiny/nano magazines.

lizeb@ mentioned that tcmalloc has better performance for this use case.
 
I don't know how often this happens in Chrome. But this is probably another point in favor of moving away from libmalloc.
Cc: erikc...@chromium.org
#1: Is that something we have contemplated? Do you know if there's a bug/doc/thread?
> Is that something we have contemplated?

I think this comes up every once in a while, but we've never put serious thought into it [that I'm aware of].

> Do you know if there's a bug/doc/thread?

I don't know of any. Filed https://bugs.chromium.org/p/chromium/issues/detail?id=897152

Sign in to add a comment