This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug malloc/19048] Avoid corruption of free_list


https://sourceware.org/bugzilla/show_bug.cgi?id=19048

--- Comment #9 from Paulo Andrade <paulo.cesar.pereira.de.andrade at gmail dot com> ---
Created attachment 8700
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8700&action=edit
glibc-arena.patch

Alternate simpler patch (from a test rpm build) that that makes
the exiting thread arena the free_list, like in current glibc,
with the following checks:

o if the thread arena it is already free_list do nothing
o if the thread arena is in free_list remove it

After the above checks, do as current glibc, making the arena
the first one to be reused.

The previous patch did put the exiting thread arena at the tail
of the free_list, the new one puts it in the head, and, in the
common case of it already being in free_list, exits early the
traversal, as it should be at most once in the list.

The speed improvement, with either patch makes some tests run
more than 100 times faster, making glibc malloc speed comparable
to jemallc (that was the user complaint, jemalloc running 100
times faster than glibc).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]