From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id CAFBC1FAF7 for ; Thu, 15 Dec 2022 20:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1671137577; bh=eYf9osFN25ZZv91ruSiH4Z4lhtXarNEhSLs0DbclXIs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HgwFO3iysRd0pdtPmQ2BMbO0HRd5CU6XgNLOdmcaIpwjek48SiwpjAjiCyiqKxy09 1hojzyCmdx+mO7Bat1zaMRJyiv8XOIokfrc3Op9nTYbFLB8AOToSPuMIkYfzDo3Ehn drerX7wnnbqIEZQnc6Of+UJZ/d5d9e0rEt/rIKF0= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 09/19] mymalloc: add notes on the malloc implementation Date: Thu, 15 Dec 2022 20:52:45 +0000 Message-Id: <20221215205255.27840-10-e@80x24.org> In-Reply-To: <20221215205255.27840-1-e@80x24.org> References: <20221215205255.27840-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- mymalloc.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/mymalloc.h b/mymalloc.h index 7d94246..2e0517b 100644 --- a/mymalloc.h +++ b/mymalloc.h @@ -6,6 +6,19 @@ * adds wait-free free(3) multi-threading support to avoid contention * with call_rcu. + * The wait-free free(3) implementation was proposed for inclusion into + glibc in 2018 and may eventually become part of glibc: + https://inbox.sourceware.org/libc-alpha/20180731084936.g4yw6wnvt677miti@dcvr/ + + * Arenas are thread-local and returned to a global pool upon thread + destruction. This works well for processes with stable thread counts, + but wastes memory in processes with unstable thread counts. + + * On Linux with O_TMPFILE support, all allocations are backed by + a temporary file (in TMPDIR). This avoids OOM errors on + memory-constrained systems due to the higher-than-normal memory + usage of mwrap itself. + * memalign-family support is ignored (and reimplemented in mwrap_core.h). dlmalloc's attempts to improve memory-efficiency is prone to fragmentation if memaligned-allocations are repeatedly freed and relalocated while