• Waiman Long's avatar
    debugobjects: Less aggressive freeing of excess debug objects · a7344a68
    Waiman Long authored
    
    
    After a system bootup and 3 parallel kernel builds, a partial output
    of the debug objects stats file was:
    
    pool_free     :5101
    pool_pcp_free :4181
    pool_min_free :220
    pool_used     :104172
    pool_max_used :171920
    on_free_list  :0
    objs_allocated:39268280
    objs_freed    :39160031
    
    More than 39 millions debug objects had since been allocated and then
    freed. The pool_max_used, however, was only about 172k. So this is a
    lot of extra overhead in freeing and allocating objects from slabs. It
    may also causes the slabs to be more fragmented and harder to reclaim.
    
    Make the freeing of excess debug objects less aggressive by freeing them at
    a maximum frequency of 10Hz and about 1k objects at each round of freeing.
    
    With that change applied, the partial output of the debug objects stats
    file after similar actions became:
    
    pool_free     :5901
    pool_pcp_free :3742
    pool_min_free :1022
    pool_used     :104805
    pool_max_used :168081
    on_free_list  :0
    objs_allocated:5796864
    objs_freed    :5687182
    Signed-off-by: default avatarWaiman Long <longman@redhat.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Yang Shi <yang.shi@linux.alibaba.com>
    Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>
    Cc: Qian Cai <cai@gmx.us>
    Cc: Zhong Jiang <zhongjiang@huawei.com>
    Link: https://lkml.kernel.org/r/20190520141450.7575-5-longman@redhat.com
    a7344a68
debugobjects.c 33.8 KB