diff mbox

[RFC,7/7] net: don't check for active hrtimer after adding it

Message ID CAKohponPJO+RGaCG8HC9d3iNKhV35Ss33XAdcQ6qus5ybeDuTQ@mail.gmail.com
State New
Headers show

Commit Message

Viresh Kumar July 9, 2014, 3:23 p.m. UTC
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:

                } while (t.task && pkt_dev->running &&
!signal_pending(current));
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
diff mbox

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