linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [v2] debugobjects: fix debug_objects_freed accounting
@ 2018-02-22 15:52 Arnd Bergmann
  2018-02-22 16:02 ` Yang Shi
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2018-02-22 15:52 UTC (permalink / raw)
  To: Thomas Gleixner, Yang Shi, Waiman Long
  Cc: Arnd Bergmann, Ingo Molnar, linux-kernel

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>
--
v2: simplify the counting as pointed out by Longman
---
 lib/debugobjects.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index faab2c4ea024..105ecfc47d8c 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);
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] debugobjects: fix debug_objects_freed accounting
  2018-02-22 15:52 [PATCH] [v2] debugobjects: fix debug_objects_freed accounting Arnd Bergmann
@ 2018-02-22 16:02 ` Yang Shi
  2018-02-22 16:09 ` Waiman Long
  2018-02-22 21:04 ` [tip:core/debugobjects] debugobjects: Fix " tip-bot for Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Yang Shi @ 2018-02-22 16:02 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Waiman Long; +Cc: Ingo Molnar, linux-kernel



On 2/22/18 7:52 AM, Arnd Bergmann wrote:
> 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>
> --
> v2: simplify the counting as pointed out by Longman

Thanks for catching this.

Acked-by: Yang Shi <yang.shi@linux.alibaba.com>

> ---
>   lib/debugobjects.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/lib/debugobjects.c b/lib/debugobjects.c
> index faab2c4ea024..105ecfc47d8c 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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [v2] debugobjects: fix debug_objects_freed accounting
  2018-02-22 15:52 [PATCH] [v2] debugobjects: fix debug_objects_freed accounting Arnd Bergmann
  2018-02-22 16:02 ` Yang Shi
@ 2018-02-22 16:09 ` Waiman Long
  2018-02-22 21:04 ` [tip:core/debugobjects] debugobjects: Fix " tip-bot for Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: Waiman Long @ 2018-02-22 16:09 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner, Yang Shi; +Cc: Ingo Molnar, linux-kernel

On 02/22/2018 10:52 AM, Arnd Bergmann wrote:
> 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>
> --
> v2: simplify the counting as pointed out by Longman
> ---
>  lib/debugobjects.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/lib/debugobjects.c b/lib/debugobjects.c
> index faab2c4ea024..105ecfc47d8c 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);

Acked-by:  Waiman Long <longman@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:core/debugobjects] debugobjects: Fix debug_objects_freed accounting
  2018-02-22 15:52 [PATCH] [v2] debugobjects: fix debug_objects_freed accounting Arnd Bergmann
  2018-02-22 16:02 ` Yang Shi
  2018-02-22 16:09 ` Waiman Long
@ 2018-02-22 21:04 ` tip-bot for Arnd Bergmann
  2 siblings, 0 replies; 4+ messages in thread
From: tip-bot for Arnd Bergmann @ 2018-02-22 21:04 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: yang.shi, longman, linux-kernel, mingo, hpa, arnd, tglx

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);

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-02-22 21:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 15:52 [PATCH] [v2] debugobjects: fix debug_objects_freed accounting Arnd Bergmann
2018-02-22 16:02 ` Yang Shi
2018-02-22 16:09 ` Waiman Long
2018-02-22 21:04 ` [tip:core/debugobjects] debugobjects: Fix " tip-bot for Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).