From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= Newsgroups: gmane.comp.lib.glibc.alpha Subject: Re: [PATCH v2] Add malloc micro benchmark Date: Wed, 28 Feb 2018 21:17:16 +0100 Message-ID: <20180228201716.GA24825@domone> References: <6ad98d83-d49b-25a3-ef01-e93e18f4740b@redhat.com> <96b76d58-d2f0-2176-51e5-f6338ed079e1@redhat.com> <165192eb-d815-867f-e1ba-0f9972eb19cd@redhat.com> <20180228141126.GA13073@domone> <808ed1e2-5945-0712-87a5-a0408de55fb0@redhat.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1519848926 14628 195.159.176.226 (28 Feb 2018 20:15:26 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2018 20:15:26 +0000 (UTC) User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Florian Weimer , Joseph Myers , Wilco Dijkstra , "libc-alpha@sourceware.org" , nd To: Carlos O'Donell Original-X-From: libc-alpha-return-90688-glibc-alpha=m.gmane.org@sourceware.org Wed Feb 28 21:15:21 2018 Return-path: Envelope-to: glibc-alpha@blaine.gmane.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; q=dns; s=default; b=gN1gmrL6g6oAH5TkRZ3CHmA0mOJtbb EJ7s7KSHzkwZ0gPb6j1vjWc8njlooEmJr1VCyCHFO/KzqEhZAfqOPbnLX6JDRZL1 g0XpL5m1SW+U5WIYXQQXzqMPo1FaEGxEbTJtqCuUbObkP9xJ16zYdzNYbAncbj8h znUQ/JZdQbK/M= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=default; bh=WuqZynN1E7oXNFy+69cuJVz6l6Y=; b=Kl5V SnosFBM4Pq+aKTX82Yjnn1UB7d2Rge79goPS8EQ+/o21Di3ukHIYfEfuvO4p7G7z +aJdPBKMaJJpt2NvxmVALF+g1VQBsK8ImvF+XjUeb7QUivdxCRJ5hJv2Jk+FDrNR y2+LAIUms6nokWTTpjUpS7DuaviWb4WcrrH5D4c= Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Original-Sender: libc-alpha-owner@sourceware.org Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_NEUTRAL autolearn=no version=3.3.2 spammy=H*F:D*seznam.cz, HContent-Transfer-Encoding:8bit X-HELO: popelka.ms.mff.cuni.cz Content-Disposition: inline In-Reply-To: Xref: news.gmane.org gmane.comp.lib.glibc.alpha:83019 Archived-At: Received: from server1.sourceware.org ([209.132.180.131] helo=sourceware.org) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1er88H-00039z-0P for glibc-alpha@blaine.gmane.org; Wed, 28 Feb 2018 21:15:21 +0100 Received: (qmail 48564 invoked by alias); 28 Feb 2018 20:17:23 -0000 Received: (qmail 48555 invoked by uid 89); 28 Feb 2018 20:17:23 -0000 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 structure. 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 individually. Alternative would be to add something like malloca with separate arenas for which existing logic works.