lkml.org 
[lkml]   [2014]   [Jul]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [RFC 7/7] net: don't check for active hrtimer after adding it
From
On 9 July 2014 16:14, Viresh Kumar <viresh.kumar@linaro.org> wrote:
> Yeah, it looks like we can get rid of this. Also,
>
> } while (t.task && pkt_dev->running && !signal_pending(current));
>
> is present in the closing "}" of do-while loop and probably we
> don't need to check t.task here as well.

Actually No. t.task is modified from hrtimer handler and so this check
would stay:

Diff I have added to this patch:

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index f911acd..cc2694e 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2187,8 +2187,7 @@ static void spin(struct pktgen_dev *pkt_dev,
ktime_t spin_until)
set_current_state(TASK_INTERRUPTIBLE);
hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS);

- if (likely(t.task))
- schedule();
+ schedule();

hrtimer_cancel(&t.timer);
} while (t.task && pkt_dev->running &&
!signal_pending(current));

\
 
 \ /
  Last update: 2014-07-10 01:21    [W:0.063 / U:2.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site