[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-ea2e64f280d2a34a8ed9ae3d783cd770d14b70ec@git.kernel.org>
Date: Tue, 25 Mar 2014 09:37:26 -0700
From: tip-bot for Thomas Gleixner <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...nel.org,
vincent.weaver@...ne.edu, tj@...nel.org, tglx@...utronix.de
Subject: [tip:timers/core] workqueue:
Provide destroy_delayed_work_on_stack()
Commit-ID: ea2e64f280d2a34a8ed9ae3d783cd770d14b70ec
Gitweb: http://git.kernel.org/tip/ea2e64f280d2a34a8ed9ae3d783cd770d14b70ec
Author: Thomas Gleixner <tglx@...utronix.de>
AuthorDate: Sun, 23 Mar 2014 14:20:44 +0000
Committer: Thomas Gleixner <tglx@...utronix.de>
CommitDate: Tue, 25 Mar 2014 17:33:42 +0100
workqueue: Provide destroy_delayed_work_on_stack()
If a delayed or deferrable work is on stack we need to tell debug
objects that we are destroying the timer and the work. Otherwise we
leak the tracking object.
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Cc: Vince Weaver <vincent.weaver@...ne.edu>
Acked-by: Tejun Heo <tj@...nel.org>
Link: http://lkml.kernel.org/r/20140323141939.911487677@linutronix.de
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
---
include/linux/workqueue.h | 2 ++
kernel/workqueue.c | 7 +++++++
2 files changed, 9 insertions(+)
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 594521b..abdbe5a 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -191,6 +191,7 @@ struct execute_work {
#ifdef CONFIG_DEBUG_OBJECTS_WORK
extern void __init_work(struct work_struct *work, int onstack);
extern void destroy_work_on_stack(struct work_struct *work);
+extern void destroy_delayed_work_on_stack(struct delayed_work *work);
static inline unsigned int work_static(struct work_struct *work)
{
return *work_data_bits(work) & WORK_STRUCT_STATIC;
@@ -198,6 +199,7 @@ static inline unsigned int work_static(struct work_struct *work)
#else
static inline void __init_work(struct work_struct *work, int onstack) { }
static inline void destroy_work_on_stack(struct work_struct *work) { }
+static inline void destroy_delayed_work_on_stack(struct delayed_work *work) { }
static inline unsigned int work_static(struct work_struct *work) { return 0; }
#endif
diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 82ef9f3..5b690b5 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -516,6 +516,13 @@ void destroy_work_on_stack(struct work_struct *work)
}
EXPORT_SYMBOL_GPL(destroy_work_on_stack);
+void destroy_delayed_work_on_stack(struct delayed_work *work)
+{
+ destroy_timer_on_stack(&work->timer);
+ debug_object_free(&work->work, &work_debug_descr);
+}
+EXPORT_SYMBOL_GPL(destroy_delayed_work_on_stack);
+
#else
static inline void debug_work_activate(struct work_struct *work) { }
static inline void debug_work_deactivate(struct work_struct *work) { }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists