From patchwork Wed Jul 9 15:23:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33328 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95E55208CF for ; Wed, 9 Jul 2014 15:24:06 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id id10sf24853247vcb.7 for ; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:in-reply-to:references :date:message-id:subject:from:to:cc:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=SgfpYVptVBPnnHPl21p9QqtApBqhQ+dM+O115817/QM=; b=UEnPdjA75hbDZ2JFdSVZYAhQWGIqUG3QyYo5u//4qCTGz0ob6MUDSz+quUAVgXtml9 G277PTfKa/D+GzFJCSFNiu5aBfscRi0Vz4nENWlsyE1bL1zJgYummyldEFmO8OpLj0Vh GP2ZPiaBwWm7qlTjC0rRJHOOhshJqlAi4E2kiz3KD8F9sdBk9WeT+ILlEgjtiX9AY6KV y5fKpNxT3RE42qebE9EwgJMWZZkO5mBj01uk08X1pK/lUzxwpoId/rlCxZTONMMq250h dvXJQsOtnvo5u5fSi8gOzx2CgJBVzTDuea3bbTpcTEg0qHgiJVceK56Ft3EK2Uww57Nm AWRQ== X-Gm-Message-State: ALoCoQmj7Ckhczab25RwIq3mJlOiQiiDMjqmKQ6/KHsM1AjU8qDDOrjCjjgds49e35DcSbdwPFey X-Received: by 10.58.154.198 with SMTP id vq6mr259713veb.42.1404919446342; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.99 with SMTP id j90ls2630209qga.49.gmail; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) X-Received: by 10.53.13.200 with SMTP id fa8mr824342vdd.57.1404919446274; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id lr10si3436687veb.106.2014.07.09.08.24.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jul 2014 08:24:06 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so7108808vcb.2 for ; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) X-Received: by 10.220.203.134 with SMTP id fi6mr40309086vcb.18.1404919446201; Wed, 09 Jul 2014 08:24:06 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp56404vcb; Wed, 9 Jul 2014 08:24:05 -0700 (PDT) X-Received: by 10.70.0.76 with SMTP id 12mr11866770pdc.44.1404919445219; Wed, 09 Jul 2014 08:24:05 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az6si7467949pdb.232.2014.07.09.08.24.04; Wed, 09 Jul 2014 08:24:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932514AbaGIPXy (ORCPT + 28 others); 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 Received: by mail-oa0-f52.google.com with SMTP id j17so8330689oag.11 for ; Wed, 09 Jul 2014 08:23:51 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.63.233 with SMTP id j9mr47321672oes.23.1404919431636; Wed, 09 Jul 2014 08:23:51 -0700 (PDT) Received: by 10.182.233.166 with HTTP; Wed, 9 Jul 2014 08:23:51 -0700 (PDT) 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" Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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: } 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 --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);