Re: [RFC PATCH v5 13/16] slub: Enable balancing slabs across nodes

From: Roman Gushchin
Date: Mon May 20 2019 - 21:07:24 EST

On Mon, May 20, 2019 at 03:40:14PM +1000, Tobin C. Harding wrote:
> We have just implemented Slab Movable Objects (SMO). On NUMA systems
> slabs can become unbalanced i.e. many slabs on one node while other
> nodes have few slabs. Using SMO we can balance the slabs across all
> the nodes.
> The algorithm used is as follows:
> 1. Move all objects to node 0 (this has the effect of defragmenting the
> cache).

This already sounds dangerous (or costly). Can't it be done without
cross-node data moves?

> 2. Calculate the desired number of slabs for each node (this is done
> using the approximation nr_slabs / nr_nodes).

So that on this step only (actual data size - desired data size) has
to be moved?