[PATCH 0/9] tlsf: use 8-byte alignment for normal malloc allocations

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Tue Oct 4 09:23:25 PDT 2022

Ahmad Fatoum <a.fatoum at pengutronix.de> writes:

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

I am wondering whether alignment should be increased on 64 bit archs to
16 bytes as well.  ARMv8 spec [1] says

| exclusive pair access must be aligned to twice the data size, that is,
| 128 bits for a pair of 64-bit values.

A github issue [2] mentions this alignment too.

> While this fixes real issues like what Enrico ran into, I'd suggest we only
> this be taken into next only after v2022.10.0 is tagged,

This is ok for me; the issue disappeared with reverting the zstd patch.


[1]  https://developer.arm.com/documentation/den0024/a/An-Introduction-to-the-ARMv8-Instruction-Sets/The-ARMv8-instruction-sets/Addressing

[2]  https://github.com/mattconte/tlsf/issues/16

SIGMA Chemnitz GmbH       Registergericht:   Amtsgericht Chemnitz HRB 1750
Am Erlenwald 13           Geschaeftsfuehrer: Grit Freitag, Frank Pyritz
09128 Chemnitz

More information about the barebox mailing list