'Use of function kmem_cache_shrink() in slab allocation

While going through the slab allocation mechanism, I came across the following function.

int kmem_cache_shrink (struct kmem_cache *)

The description of this function can be found here.

The description only tells that this function is used to release as many slabs from the cache created. I think that the slabs which will have "empty" status will be only released.

Under what scenarios do we need this function?

Any inputs on this will be helpful.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source