[PATCH] maple_tree: use KMEM_CACHE to create maple_node caches

Matthew Wilcox willy at infradead.org
Mon Nov 4 20:17:42 PST 2024


On Tue, Nov 05, 2024 at 10:21:00AM +0800, Ke Sun wrote:
> > its size (eg 256 bytes) as the bottom bits of pointers to nodes are used
> > for other purposes.  KMEM_CACHE() does not give us this guarantee.
> 
> The code comments of kmem_cache say: 'The alignment of the struct
> determines object alignment.'
>  #define KMEM_CACHE(__struct, __flags)                                   \
> __kmem_cache_create_args(#__struct, sizeof(struct __struct),    \
> &(struct kmem_cache_args) { \
> .align = __alignof__(struct __struct), \
> }, (__flags))

You're looking right at your bug, and you don't see it.



More information about the maple-tree mailing list