This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v2] Add malloc micro benchmark
- From: Ondřej Bílka <neleai at seznam dot cz>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Florian Weimer <fweimer at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>, Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, nd <nd at arm dot com>
- Date: Wed, 28 Feb 2018 21:17:16 +0100
- Subject: Re: [PATCH v2] Add malloc micro benchmark
- Authentication-results: sourceware.org; auth=none
- References: <DB6PR0801MB20538A414F1659748E703918833C0@DB6PR0801MB2053.eurprd08.prod.outlook.com> <email@example.com> <DB6PR0801MB2053641333453CE91496266E83190@DB6PR0801MB2053.eurprd08.prod.outlook.com> <firstname.lastname@example.org> <alpine.DEB.email@example.com> <firstname.lastname@example.org> <email@example.com> <20180228141126.GA13073@domone> <firstname.lastname@example.org> <email@example.com>
On Wed, Feb 28, 2018 at 08:16:13AM -0800, Carlos O'Donell wrote:
> On 02/28/2018 06:16 AM, Florian Weimer wrote:
> > On 02/28/2018 03:11 PM, Ondřej Bílka wrote:
> >> Thats rather ineffective, it is easier to start fresh than try to
> >> maintain rather obsolete allocator. Most of other are faster and
> >> more space effective because of their layout.
> > That's not quite true. Despite its limitations, glibc malloc still
> > compares remarkably well to other allocators. Of course, there are
> > workloads where it loses big, but those exist for other allocators,
> > too. People simple don't write blog posts comparing *alloc with
> > glibc malloc if glibc malloc provides comparable or better
> > performance because it's quite boring.
> > I think a heap-style allocator which does not segregate allocations
> > of different sizes still has its place, and why not provide one in
> > glibc?
> I agree.
> I think an incremental improvement would be to start with some further
> code cleanups, all with the goal of simplifying the allocator maintenance.
You should like I did try to decruft implementation. I decided that
starting again is simpler after looking lot on existing how to do it. I
send some patches with decrufting but I found that with changing
algorithm, data structures mmap logic and basically everything else its
just unnecessary overhead.
You couldn't decrease data structure overhead without changing data
And for RSS size problem is in design that you couldn't return memory to
system. Large areas get pined by small allocations with return data and
you couldn't sbrk. It is needed to redesign it to unmap pages
Alternative would be to add something like malloca with separate arenas
for which existing logic works.