From patchwork Wed Jul 9 06:55:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33265 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 09781208CF for ; Wed, 9 Jul 2014 06:56:55 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf39450460iec.8 for ; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=/WyL07wMtUj0wMTpxgsmtTZnHhOJInaniPiUOFuyIUs=; b=migbpQkTZp2Ef6hBahvCLyMOXszm9PxnxgKX/YhIwmNoBPKKXQemd/sElggIeohMXX WdTAMDfly5G6dSr2EqRwUrBPYEmaBK84l/k91jrbO2cTqiWAlqnrcGZclH/b5jDvHahM 3ETfU+csqoxMtd7/51khLPalQoVdXYnqzGhUN0u83zpdgf3TbdxwMyOgusDUVOdtr/l+ 1nb3LTQ/StnWWT5+rfroCkCnBybm7THsMBzZhM8fmtWAUWbEpvYY4/oqidftzOySw/Rl lgPFiDSbj8tgVg2iI4fbYLApRTlt2m0EQ1pY/sQe62Be5/UyBcHyuWUYCtq6nT2mq4ku BZoA== X-Gm-Message-State: ALoCoQnmCU9xlFaEzA1r4+FyORplbe+wNQM8eSYR+7WwBjYnxIMyLSxbOTGx5IHQSY9bGyEVArro X-Received: by 10.42.235.8 with SMTP id ke8mr20424953icb.22.1404889015418; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.54 with SMTP id b51ls2460491qgf.48.gmail; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) X-Received: by 10.52.17.129 with SMTP id o1mr31864694vdd.0.1404889015317; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id pw10si21146305vec.96.2014.07.08.23.56.55 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:55 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id ik5so6438860vcb.35 for ; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) X-Received: by 10.220.161.8 with SMTP id p8mr37570068vcx.4.1404889015236; Tue, 08 Jul 2014 23:56:55 -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 tc5csp20670vcb; Tue, 8 Jul 2014 23:56:54 -0700 (PDT) X-Received: by 10.67.23.227 with SMTP id id3mr38845472pad.45.1404889014413; Tue, 08 Jul 2014 23:56:54 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ot3si1198493pdb.480.2014.07.08.23.56.53; Tue, 08 Jul 2014 23:56:53 -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 S1754968AbaGIG4m (ORCPT + 28 others); Wed, 9 Jul 2014 02:56:42 -0400 Received: from mail-qc0-f177.google.com ([209.85.216.177]:60482 "EHLO mail-qc0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754242AbaGIG4j (ORCPT ); Wed, 9 Jul 2014 02:56:39 -0400 Received: by mail-qc0-f177.google.com with SMTP id r5so6128345qcx.22 for ; Tue, 08 Jul 2014 23:56:38 -0700 (PDT) X-Received: by 10.224.151.72 with SMTP id b8mr1939627qaw.95.1404888998846; Tue, 08 Jul 2014 23:56:38 -0700 (PDT) Received: from localhost (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id z78sm3496936qgz.36.2014.07.08.23.56.34 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:38 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de Cc: linaro-kernel@lists.linaro.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, arvind.chauhan@arm.com, preeti@linux.vnet.ibm.com, khilman@linaro.org, Viresh Kumar , "David S. Miller" , netdev@vger.kernel.org Subject: [RFC 7/7] net: don't check for active hrtimer after adding it Date: Wed, 9 Jul 2014 12:25:39 +0530 Message-Id: X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: References: In-Reply-To: References: 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.176 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: , hrtimer_start*() family never fails to enqueue a hrtimer to a clock-base. The only special case is when the hrtimer was in past. If it is getting enqueued to local CPUs's clock-base, we raise a softirq and exit, else we handle that on next interrupt on remote CPU. At several places in the kernel, we try to make sure if hrtimer was added properly or not by calling hrtimer_active(), like: hrtimer_start(timer, expires, mode); if (hrtimer_active(timer)) { /* Added successfully */ } else { /* Was added in the past */ } As hrtimer_start*() never fails, hrtimer_active() is guaranteed to return '1'. So, there is no point calling hrtimer_active(). This patch updates net core to get this fixed. Cc: "David S. Miller" Cc: netdev@vger.kernel.org Signed-off-by: Viresh Kumar --- net/core/pktgen.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/net/core/pktgen.c b/net/core/pktgen.c index fc17a9d..f911acd 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c @@ -2186,8 +2186,6 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until) do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t.timer, HRTIMER_MODE_ABS); - if (!hrtimer_active(&t.timer)) - t.task = NULL; if (likely(t.task)) schedule();