Re: [PATCH 2/2] mm, slab: Extend vm/drop_caches to shrink kmem slabs
From: Michal Hocko <mhocko@kernel.org>
Date: 2019-06-28 07:31:37
Also in:
cgroups, linux-fsdevel, linux-mm, lkml
From: Michal Hocko <mhocko@kernel.org>
Date: 2019-06-28 07:31:37
Also in:
cgroups, linux-fsdevel, linux-mm, lkml
On Thu 27-06-19 17:16:04, Waiman Long wrote:
On 6/27/19 11:15 AM, Michal Hocko wrote:quoted
On Mon 24-06-19 13:42:19, Waiman Long wrote:quoted
With the slub memory allocator, the numbers of active slab objects reported in /proc/slabinfo are not real because they include objects that are held by the per-cpu slab structures whether they are actually used or not. The problem gets worse the more CPUs a system have. For instance, looking at the reported number of active task_struct objects, one will wonder where all the missing tasks gone. I know it is hard and costly to get a real count of active objects.What exactly is expensive? Why cannot slabinfo reduce the number of active objects by per-cpu cached objects?The number of cachelines that needs to be accessed in order to get an accurate count will be much higher if we need to iterate through all the per-cpu structures. In addition, accessing the per-cpu partial list will be racy.
Why is all that a problem for a root only interface that should be used quite rarely (it is not something that you should be reading hundreds time per second, right)? -- Michal Hocko SUSE Labs