From patchwork Wed Jul 9 06:55:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33260 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f69.google.com (mail-oa0-f69.google.com [209.85.219.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CD92F203F4 for ; Wed, 9 Jul 2014 06:56:19 +0000 (UTC) Received: by mail-oa0-f69.google.com with SMTP id j17sf40742176oag.0 for ; Tue, 08 Jul 2014 23:56:19 -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=G60QmZIjOh1afygBMQrrZ9qWFBTGXw6FJTeoGWi4fBc=; b=lec/6v9BMM8XuoMibRgveQcYsi7hEk+/ZK0OqIRydPfYQirN9aqqLm2RztUnNaT2Lz OKMYpgaN5Gaf7hcVrx1TdScI9dyoUSIAv2Xr8s8uxWETbWVYHLNAIXazXz69ZKETxrXC BQwO+TVucA896PVZt3MKA6lLAF+9jT1FZaZkHQ1l6Et/eA/flXG9OGaEUwUQPu0nbo71 AcirVhAN3QvREkmM8gdalSb1SIARxA8HBH/bDDFLqjySpCQwo02nXLktgYG+Q9ji9miC PTY1W/S1L0Zx8lJa8VrD+nBj6q9io7+ILApFPYmzgPopZ5nHGuejP1mTeyWiW42gYpTJ kfZA== X-Gm-Message-State: ALoCoQn1lizjKyuuHieJCbm8KeSKnleIpSXtFMxb75UYiwrVK7TSKZT73Zbb7J35X38SVUNVnaUl X-Received: by 10.50.85.6 with SMTP id d6mr3816478igz.0.1404888979420; Tue, 08 Jul 2014 23:56:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.110 with SMTP id a101ls2644489qge.99.gmail; Tue, 08 Jul 2014 23:56:19 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr37899029vch.22.1404888979292; Tue, 08 Jul 2014 23:56:19 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id d3si21147226vck.42.2014.07.08.23.56.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so6707920veb.41 for ; Tue, 08 Jul 2014 23:56:19 -0700 (PDT) X-Received: by 10.58.245.194 with SMTP id xq2mr38344973vec.26.1404888979129; Tue, 08 Jul 2014 23:56:19 -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 tc5csp20642vcb; Tue, 8 Jul 2014 23:56:18 -0700 (PDT) X-Received: by 10.70.14.227 with SMTP id s3mr9685624pdc.88.1404888978364; Tue, 08 Jul 2014 23:56:18 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb10si3405406pdb.422.2014.07.08.23.56.17; Tue, 08 Jul 2014 23:56:17 -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 S932125AbaGIG4H (ORCPT + 28 others); Wed, 9 Jul 2014 02:56:07 -0400 Received: from mail-qa0-f43.google.com ([209.85.216.43]:34733 "EHLO mail-qa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbaGIG4C (ORCPT ); Wed, 9 Jul 2014 02:56:02 -0400 Received: by mail-qa0-f43.google.com with SMTP id k15so5695997qaq.16 for ; Tue, 08 Jul 2014 23:56:01 -0700 (PDT) X-Received: by 10.224.20.10 with SMTP id d10mr66940473qab.16.1404888961563; Tue, 08 Jul 2014 23:56:01 -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 t3sm84929993qai.28.2014.07.08.23.55.57 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:01 -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 Subject: [RFC 2/7] hrtimer: don't check for active hrtimer after adding it Date: Wed, 9 Jul 2014 12:25:34 +0530 Message-Id: <13861232628603285a2734e32b309abd73c8741c.1404888801.git.viresh.kumar@linaro.org> 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.128.182 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 hrtimer core to get this fixed. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index cf40209..a76f962 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1555,8 +1555,6 @@ static int __sched do_nanosleep(struct hrtimer_sleeper *t, enum hrtimer_mode mod do { set_current_state(TASK_INTERRUPTIBLE); hrtimer_start_expires(&t->timer, mode); - if (!hrtimer_active(&t->timer)) - t->task = NULL; if (likely(t->task)) freezable_schedule(); @@ -1837,8 +1835,6 @@ schedule_hrtimeout_range_clock(ktime_t *expires, unsigned long delta, hrtimer_init_sleeper(&t, current); hrtimer_start_expires(&t.timer, mode); - if (!hrtimer_active(&t.timer)) - t.task = NULL; if (likely(t.task)) schedule();