* [PATCH 1/2] timer: Export destroy_hrtimer_on_stack()
@ 2016-05-27 0:21 Guenter Roeck
2016-05-27 0:21 ` [PATCH 2/2] net: pktgen: Call destroy_hrtimer_on_stack() Guenter Roeck
2016-05-31 18:44 ` [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() David Miller
0 siblings, 2 replies; 4+ messages in thread
From: Guenter Roeck @ 2016-05-27 0:21 UTC (permalink / raw)
To: Thomas Gleixner, David S. Miller; +Cc: linux-kernel, netdev, Guenter Roeck
hrtimer_init_on_stack() needs a matching call to
destroy_hrtimer_on_stack(), so both need to be exported.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
kernel/time/hrtimer.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
index 8c7392c4fdbd..e99df0ff1d42 100644
--- a/kernel/time/hrtimer.c
+++ b/kernel/time/hrtimer.c
@@ -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) { }
--
2.5.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] net: pktgen: Call destroy_hrtimer_on_stack()
2016-05-27 0:21 [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() Guenter Roeck
@ 2016-05-27 0:21 ` Guenter Roeck
2016-05-31 18:44 ` David Miller
2016-05-31 18:44 ` [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Guenter Roeck @ 2016-05-27 0:21 UTC (permalink / raw)
To: Thomas Gleixner, David S. Miller; +Cc: linux-kernel, netdev, Guenter Roeck
If CONFIG_DEBUG_OBJECTS_TIMERS=y, hrtimer_init_on_stack() requires
a matching call to destroy_hrtimer_on_stack() to clean up timer
debug objects.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
net/core/pktgen.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 8604ae245960..8b02df0d354d 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -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)
--
2.5.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] timer: Export destroy_hrtimer_on_stack()
2016-05-27 0:21 [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() Guenter Roeck
2016-05-27 0:21 ` [PATCH 2/2] net: pktgen: Call destroy_hrtimer_on_stack() Guenter Roeck
@ 2016-05-31 18:44 ` David Miller
1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2016-05-31 18:44 UTC (permalink / raw)
To: linux; +Cc: tglx, linux-kernel, netdev
From: Guenter Roeck <linux@roeck-us.net>
Date: Thu, 26 May 2016 17:21:05 -0700
> hrtimer_init_on_stack() needs a matching call to
> destroy_hrtimer_on_stack(), so both need to be exported.
>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-05-31 18:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 0:21 [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() Guenter Roeck
2016-05-27 0:21 ` [PATCH 2/2] net: pktgen: Call destroy_hrtimer_on_stack() Guenter Roeck
2016-05-31 18:44 ` David Miller
2016-05-31 18:44 ` [PATCH 1/2] timer: Export destroy_hrtimer_on_stack() David Miller
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).