Thread (22 messages) 22 messages, 4 authors, 2024-06-28

Re: [PATCH v5 4/6] mm/slab: Introduce kmem_buckets_create() and family

From: Vlastimil Babka <hidden>
Date: 2024-06-28 16:53:27
Also in: linux-hardening, linux-mm, lkml, rust-for-linux

On 6/28/24 5:47 PM, Kees Cook wrote:
On Thu, Jun 27, 2024 at 10:35:36PM -0700, Boqun Feng wrote:
quoted
On Thu, Jun 20, 2024 at 10:43:39PM +0200, Vlastimil Babka wrote:
quoted
Rust people were asking about kmalloc alignment (but I forgot the details)
It was me! The ask is whether we can specify the alignment for the
allocation API, for example, requesting a size=96 and align=32 memory,
or the allocation API could do a "best alignment", for example,
allocating a size=96 will give a align=32 memory. As far as I
understand, kmalloc() doesn't support this.
I can drop the "align" argument. Do we want to hard-code a
per-cache-size alignment for the caches in a kmem_buckets collection?
I think you can drop it as a single value is really ill suited for a
collection of different sizes.

As for Rust's requirements we could consider whether to add a special flag
if they use own bucket, or just implement the rules for non-power-of-two
size globally. It should be feasible as I think in the non-debug caches it
shouldn't in fact change the existing layout, which is the same situation as
when we codified the power-of-two caches alignment as guaranteed.

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help