mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: Non-candidate allocator designs, things to learn from them
Date: Wed, 06 Nov 2019 11:06:59 +0100	[thread overview]
Message-ID: <87ftj1pbcs.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <20191106034605.GB16318@brightrain.aerifal.cx> (Rich Felker's message of "Tue, 5 Nov 2019 22:46:05 -0500")

* Rich Felker:

> Aside from that, this kind of design also suffers from extreme
> over-allocation in small programs, and it's not compatible with nommu
> at all (since it relies on the mmu to cheat fragmentation). For
> example, if you allocate just one object of each of 50 sizes classes,
> you'll be using at least 50 pages (200k) already.

I've recently seen an announcement of a malloc which uses alias mappings
to encode the size class in the address.  This way, you would only need
to start out with one or two pages in userspace.  But the page table
overhead in the kernel (which is missing from your calculation) is still
there because I don't think the kernel can share the page tables for the
alias mappings.

Another concern with such allocators is the increased TLB pressure and
page walking overhead.

Thanks,
Florian



  reply	other threads:[~2019-11-06 10:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 17:40 New malloc - intro, motivation & design goals document Rich Felker
2019-11-06  3:46 ` Non-candidate allocator designs, things to learn from them Rich Felker
2019-11-06 10:06   ` Florian Weimer [this message]
2019-11-28 21:56 ` New malloc - first preview Rich Felker
2019-11-28 22:22   ` Rich Felker
2019-11-29  6:37     ` Vasya Boytsov
2019-11-29 13:55       ` Rich Felker
2019-11-30  5:54         ` Rich Felker
2019-11-29 16:41   ` Roman Yeryomin
2019-11-30  4:49     ` Rich Felker
2019-11-29 19:45   ` Markus Wichmann
2019-11-30  3:15     ` Rich Felker
2019-11-30 22:11   ` Rich Felker
2019-12-06  5:06     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftj1pbcs.fsf@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).