Re: [PATCH v2 2/2] mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)
From: Christopher Lameter
Date: Wed Sep 25 2019 - 20:16:12 EST
On Wed, 25 Sep 2019, Vlastimil Babka wrote:
> Most of the new code is for SLOB, which has no debugging and yet
> misaligns. For SLUB and SLAB, it's just passing alignment argument to
> kmem_cache_create() for kmalloc caches, which means just extra few
> instructions during boot, and no extra code during kmalloc/kfree itself.
SLOB follows the standards for alignments in slab allocators and will
correctly align if you ask the allocator for a properly aligned object.