lkml.org 
[lkml]   [2019]   [Mar]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC 0/2] guarantee natural alignment for kmalloc()
Date
The recent thread [1] inspired me to look into guaranteeing alignment for
kmalloc() for power-of-two sizes. Turns out it's not difficult and in most
configuration nothing really changes as it happens implicitly. More details in
the first patch. If we agree we want to do this, I will see where to update
documentation and perhaps if there are any workarounds in the tree that can be
converted to plain kmalloc() afterwards.

The second patch is quick and dirty selftest for the alignment. Suggestions
welcome whether and how to include this kind of selftest that has to be
in-kernel.

[1] https://lore.kernel.org/linux-fsdevel/20190225040904.5557-1-ming.lei@redhat.com/T/#u

Vlastimil Babka (2):
mm, sl[aou]b: guarantee natural alignment for kmalloc(power-of-two)
mm, sl[aou]b: test whether kmalloc() alignment works as expected

mm/slab_common.c | 30 +++++++++++++++++++++++++++++-
mm/slob.c | 42 +++++++++++++++++++++++++++++++-----------
2 files changed, 60 insertions(+), 12 deletions(-)

--
2.21.0

\
 
 \ /
  Last update: 2019-03-19 22:12    [W:0.574 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site