Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbaGIPXy (ORCPT ); Wed, 9 Jul 2014 11:23:54 -0400 Received: from mail-oa0-f52.google.com ([209.85.219.52]:64774 "EHLO mail-oa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932461AbaGIPXw (ORCPT ); Wed, 9 Jul 2014 11:23:52 -0400 MIME-Version: 1.0 In-Reply-To: References: <53BD1A56.7000902@arm.com> Date: Wed, 9 Jul 2014 20:53:51 +0530 Message-ID: Subject: Re: [RFC 7/7] net: don't check for active hrtimer after adding it From: Viresh Kumar To: Chris Redpath Cc: "tglx@linutronix.de" , "linaro-kernel@lists.linaro.org" , "fweisbec@gmail.com" , "linux-kernel@vger.kernel.org" , "preeti@linux.vnet.ibm.com" , "netdev@vger.kernel.org" , Arvind Chauhan , "David S. Miller" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9 July 2014 16:14, Viresh Kumar 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)); -- 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/