Commit 04148187 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Thomas Gleixner

debugobjects: Fix debug_objects_freed accounting

The removal of the batched object freeing has caused the debug_objects_freed
to become read-only, and the reading is inside an ifdef, so gcc warns that it
is completely unused without CONFIG_DEBUG_FS:

lib/debugobjects.c:71:14: error: 'debug_objects_freed' defined but not used [-Werror=unused-variable]

Assuming we are still interested in this number, this adds back code to
keep track of the freed objects.

Fixes: 636e1970 ("debugobjects: Use global free list in free_object()")
Suggested-by: default avatarWaiman Long <longman@redhat.com>
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Acked-by: default avatarYang Shi <yang.shi@linux.alibaba.com>
Acked-by: default avatarWaiman Long <longman@redhat.com>
Link: https://lkml.kernel.org/r/20180222155335.1647466-1-arnd@arndb.de
parent 1ea9b98b
......@@ -233,6 +233,7 @@ static void free_obj_work(struct work_struct *work)
*/
if (obj_nr_tofree) {
hlist_move_list(&obj_to_free, &tofree);
debug_objects_freed += obj_nr_tofree;
obj_nr_tofree = 0;
}
raw_spin_unlock_irqrestore(&pool_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment