mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 0/7] tlsf: use 8-byte alignment for normal malloc allocations
Date: Tue, 26 Sep 2023 12:57:20 +0200	[thread overview]
Message-ID: <20230926105720.GA637806@pengutronix.de> (raw)
In-Reply-To: <20230911152433.3640781-1-a.fatoum@pengutronix.de>

On Mon, Sep 11, 2023 at 05:24:26PM +0200, Ahmad Fatoum wrote:
> TLSF currently uses only 4-byte alignment on 32-bit platforms, which isn't
> enough for ldrd/strd on ARMv7. This series reworks TLSF a bit, so we always
> have at least 8 byte alignment.  dlmalloc already has 8 byte alignment
> minimum, so nothing to do there.
> 
> This has the added benefit of giving TLSF the same alignment as KASAN,
> which can make debugging easier.
> 
> v1 didn't actually manage to boot on an i.MX6, which v2 fixes. This
> also boots normally on i.MX8M. I suggest this going into next after
> v2023.09.0.
> 
> v1 -> v2:
>   - drop switch of test_ffs_fls to bselftest. This function should just
>     be replaced with barebox' own implementation in future
>   - keep block size a size_t and just ensure the block metadata is
>     correctly aligned.

Applied, thanks

Sascha

> 
> Ahmad Fatoum (7):
>   tlsf: turn static const variables into compiletime constant
>     expressions
>   tlsf: ensure malloc pool is aligned
>   tlsf: fix sizeof(size_t) == sizeof(void *) assumption
>   tlsf: give malloc 8-byte alignment on 32-bit as well
>   common: malloc: ensure alignment is always at least 8 byte
>   test: self: refactor to allow alignment check
>   test: self: malloc: fix memory leaks
> 
>  common/Kconfig         |  5 +++
>  common/dlmalloc.c      |  3 ++
>  common/dummy_malloc.c  |  2 +-
>  common/tlsf.c          | 43 ++++++++++---------
>  include/linux/bitops.h |  1 +
>  test/self/malloc.c     | 96 ++++++++++++++++++++++++++++++------------
>  6 files changed, 102 insertions(+), 48 deletions(-)
> 
> -- 
> 2.39.2
> 
> 
> 

-- 
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 |



      parent reply	other threads:[~2023-09-26 10:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-11 15:24 Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 1/7] tlsf: turn static const variables into compiletime constant expressions Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 2/7] tlsf: ensure malloc pool is aligned Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 3/7] tlsf: fix sizeof(size_t) == sizeof(void *) assumption Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 4/7] tlsf: give malloc 8-byte alignment on 32-bit as well Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 5/7] common: malloc: ensure alignment is always at least 8 byte Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 6/7] test: self: refactor to allow alignment check Ahmad Fatoum
2023-09-11 15:24 ` [PATCH v2 7/7] test: self: malloc: fix memory leaks Ahmad Fatoum
2023-09-26 10:57 ` 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=20230926105720.GA637806@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /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