lkml.org 
[lkml]   [2019]   [Mar]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 04/15] slub: Enable Slab Movable Objects (SMO)
On Mon, 11 Mar 2019, Roman Gushchin wrote:

> > +static inline void *alloc_scratch(struct kmem_cache *s)
> > +{
> > + unsigned int size = oo_objects(s->max);
> > +
> > + return kmalloc(size * sizeof(void *) +
> > + BITS_TO_LONGS(size) * sizeof(unsigned long),
> > + GFP_KERNEL);
>
> I wonder how big this allocation can be?
> Given that the reason for migration is probably highly fragmented memory,
> we probably don't want to have a high-order allocation here. So maybe
> kvmalloc()?

The smallest object size is 8 bytes which is one word which would be
places in an order 0 page. So it comes out to about a page again.

Larger allocation orders are possible if the slab pages itself can have
larger orders of course. If you set the min_order to the huge page order
then we can have similar sized orders for the allocation of the scratch
space. However, that is not a problem since the allocations for the slab
pages itself are also already of that same order.

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