timer: Export destroy_hrtimer_on_stack()
PATCH 2/2 net: pktgen: Call destroy_hrtimer_on_stack()
In reply to Guenter RoeckIf CONFIG_DEBUG_OBJECTS_TIMERS=y, hrtimer_init_on_stack() requires a matching call to destroy_hrtimer_on_stack() to clean up timer debug objects.
--- net/core/pktgen.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/core/pktgen.c +4 -4
@@ -2245,10 +2245,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)hrtimer_set_expires (&t.timer, spin_until); remaining =ktime_to_ns (hrtimer_expires_remaining (&t.timer)); -if (remaining <=0 ) { - pkt_dev->next_tx =ktime_add_ns (spin_until, pkt_dev->delay); -return ; - } +if (remaining <=0 ) + goto out; start_time =ktime_get ();if (remaining <100000 ) {
@@ -2273,7 +2271,9 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) } pkt_dev->idle_acc +=ktime_to_ns (ktime_sub (end_time, start_time)); +out: pkt_dev->next_tx =ktime_add_ns (spin_until, pkt_dev->delay); +destroy_hrtimer_on_stack (&t.timer); }static inline void set_pkt_overhead (struct pktgen_dev *pkt_dev)
Signature · 1 line
2.5.0
PATCH 1/2 timer: Export destroy_hrtimer_on_stack()
hrtimer_init_on_stack() needs a matching call to destroy_hrtimer_on_stack(), so both need to be exported.
--- kernel/time/hrtimer.c | 1 + 1 file changed, 1 insertion(+)
kernel/time/hrtimer.c +1 -0
@@ -425,6 +425,7 @@ void destroy_hrtimer_on_stack(struct hrtimer *timer) {debug_object_free (timer, &hrtimer_debug_descr); } +EXPORT_SYMBOL_GPL (destroy_hrtimer_on_stack);#else static inline void debug_hrtimer_init (struct hrtimer *timer) { }
Signature · 1 line
2.5.0
From: Guenter Roeck <[email protected]>
Date: Thu, 26 May 2016 17:21:05 -0700
Quoted 4 lines
hrtimer_init_on_stack()needs a matching call todestroy_hrtimer_on_stack(), so both need to be exported.Signed-off-by Guenter Roeck <[email protected]>
Applied.
Re: [PATCH 2/2] net: pktgen: Call destroy_hrtimer_on_stack()
In reply to Guenter RoeckFrom: Guenter Roeck <[email protected]>
Date: Thu, 26 May 2016 17:21:06 -0700
Quoted 5 lines
If
CONFIG_DEBUG_OBJECTS_TIMERS=y,hrtimer_init_on_stack()requires a matching call todestroy_hrtimer_on_stack()to clean up timer debug objects.Signed-off-by Guenter Roeck <[email protected]>
Applied.