From: Sascha Hauer <s.hauer@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org, Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH] dlmalloc: remove in favor of TLSF
Date: Tue, 17 Jun 2025 08:56:49 +0200 [thread overview]
Message-ID: <aFERsXe3651jDCeK@pengutronix.de> (raw)
In-Reply-To: <20250616130430.782214-1-a.fatoum@pengutronix.de>
On Mon, Jun 16, 2025 at 03:04:30PM +0200, Ahmad Fatoum wrote:
> We have had a TLSF implementation in barebox for >= 13 years now and it
> has more features than the dlmalloc, which we inherited from U-Boot,
> like multiple pools and KASAN integration.
>
> We didn't have pressure to retire dlmalloc in that time, but bugs like
> those fixed in commit 7cf25e0733f0 ("dlmalloc: Fix integer overflow in
> request2size()") show that there's a security cost associated with
> keeping bitrotted code, especially as we didn't document TLSF as being
> the recommended allocator anywhere.
>
> Since then, TLSF has been been made the default allocator in Kconfig[1]
> and dlmalloc deprecation was announced[2]. Follow through now and drop
> dlmalloc altogether.
>
> [1]: Commit c1552409af30 ("common: make TLSF the default allocator")
> [2]: https://lore.barebox.org/barebox/7a4edaef-a606-4b9d-bdf5-c7b5f896daae@pengutronix.de/
>
> Cc: Antony Pavlov <antonynpavlov@gmail.com>
> Cc: Richard Weinberger <richard@nod.at>
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
> .../migration-guides/migration-2025.07.0.rst | 5 +
> common/Kconfig | 3 -
> common/Makefile | 1 -
> common/dlmalloc.c | 1976 -----------------
> include/dlmalloc.h | 15 -
> 5 files changed, 5 insertions(+), 1995 deletions(-)
> delete mode 100644 common/dlmalloc.c
> delete mode 100644 include/dlmalloc.h
With this INTERNAL_SIZE_T becomes unused. Merged the following into
this commit
-------------------------8<-----------------------------
>From 5e436f98aba7dd371856acb41e34a2d4507016fe Mon Sep 17 00:00:00 2001
From: Sascha Hauer <s.hauer@pengutronix.de>
Date: Tue, 17 Jun 2025 08:54:08 +0200
Subject: [PATCH] fixup! dlmalloc: remove in favor of TLSF
---
arch/riscv/include/asm/types.h | 8 --------
arch/x86/include/asm/types.h | 13 -------------
2 files changed, 21 deletions(-)
diff --git a/arch/riscv/include/asm/types.h b/arch/riscv/include/asm/types.h
index add1c94fc7..f89733dcc4 100644
--- a/arch/riscv/include/asm/types.h
+++ b/arch/riscv/include/asm/types.h
@@ -5,12 +5,4 @@
#include <asm-generic/int-ll64.h>
-#if __riscv_xlen == 64
-/*
- * This is used in dlmalloc. On RISCV64 we need it to be 64 bit
- */
-#define INTERNAL_SIZE_T unsigned long
-
-#endif
-
#endif /* __ASM_RISCV_TYPES_H */
diff --git a/arch/x86/include/asm/types.h b/arch/x86/include/asm/types.h
index feb5843b9c..87813325f1 100644
--- a/arch/x86/include/asm/types.h
+++ b/arch/x86/include/asm/types.h
@@ -5,17 +5,4 @@
#include <asm-generic/int-ll64.h>
-#ifndef __ASSEMBLY__
-
-#ifdef __x86_64__
-/*
- * This is used in dlmalloc. On X86_64 we need it to be
- * 64 bit
- */
-#define INTERNAL_SIZE_T unsigned long
-
-#endif
-
-#endif
-
#endif
--
2.39.5
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
prev parent reply other threads:[~2025-06-17 6:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 13:04 Ahmad Fatoum
2025-06-17 6:54 ` Sascha Hauer
2025-06-17 6:56 ` Sascha Hauer [this message]
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=aFERsXe3651jDCeK@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=richard@nod.at \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox