lkml.org 
[lkml]   [2018]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:core/debugobjects] debugobjects: Fix debug_objects_freed accounting
Commit-ID:  04148187aa9df3626168f7429d2287997787e387
Gitweb: https://git.kernel.org/tip/04148187aa9df3626168f7429d2287997787e387
Author: Arnd Bergmann <arnd@arndb.de>
AuthorDate: Thu, 22 Feb 2018 16:52:58 +0100
Committer: Thomas Gleixner <tglx@linutronix.de>
CommitDate: Thu, 22 Feb 2018 22:00:24 +0100

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: 636e1970fd7d ("debugobjects: Use global free list in free_object()")
Suggested-by: Waiman Long <longman@redhat.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Yang Shi <yang.shi@linux.alibaba.com>
Acked-by: Waiman Long <longman@redhat.com>
Link: https://lkml.kernel.org/r/20180222155335.1647466-1-arnd@arndb.de

---
lib/debugobjects.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index faab2c4..105ecfc 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -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);
\
 
 \ /
  Last update: 2018-02-22 22:05    [W:0.052 / U:0.644 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site