Message ID | b5952471057e6998e9c8aa16c28101a6ff62e289.1404888801.git.viresh.kumar@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBCRIZROPVQPBBN6P6OOQKGQE6OA3VNI@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f72.google.com (mail-pa0-f72.google.com [209.85.220.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BE935203F4 for <linaro@patches.linaro.org>; Wed, 9 Jul 2014 06:56:55 +0000 (UTC) Received: by mail-pa0-f72.google.com with SMTP id rd3sf48474508pab.3 for <linaro@patches.linaro.org>; 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=6gXPDj93wDoBqxdu1WuxuhXvX33bd6HvgjnVLOiFZFE=; b=ewCaCZF1Rv+tez7v10bn55jGHDgqz2fD2pgrAAgBDolCbY1IPSztSwnQGE3nLgm56t u/kJBfOuo86tIndFYDHRMWd/EVupMknBKGbNSF88v0pXWDoQyoSUZGAswhGHT7LYYq2i NxKjdxtnEAycmbBPlAdB+KWbDNG7+OTPFatn7Upkc3AsoDT75bTXf6pNyQ+JZmjF/2QB k1R3RcfjyVuF1ABKp7H66sqbUxVBqXdHZw1OETzV5tty6MuAg7sSNuKx7YkfXz+8C3a5 h117CX+xUtzly8sCtHIJFYEabnhrUqThArcvsw8/4xvK8L9SaPdZiRQWK+MrVZ51B9yt CJAw== X-Gm-Message-State: ALoCoQnSirmqjp47pzYjY+TKuSvL3AYjSfR+/fXCBaUXCBWlsiUe84nL78uiFD0g9S9shzKSQsTn X-Received: by 10.70.135.129 with SMTP id ps1mr4994041pdb.8.1404889015089; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.213 with SMTP id n79ls999223qgd.29.gmail; Tue, 08 Jul 2014 23:56:55 -0700 (PDT) X-Received: by 10.52.118.99 with SMTP id kl3mr31845838vdb.18.1404889014600; Tue, 08 Jul 2014 23:56:54 -0700 (PDT) Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174]) by mx.google.com with ESMTPS id k8si16020430vdv.58.2014.07.08.23.56.54 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.174 as permitted sender) client-ip=209.85.128.174; Received: by mail-ve0-f174.google.com with SMTP id sa20so453220veb.33 for <patchwork-forward@linaro.org>; Tue, 08 Jul 2014 23:56:54 -0700 (PDT) X-Received: by 10.220.190.197 with SMTP id dj5mr37731765vcb.19.1404889014478; Tue, 08 Jul 2014 23:56:54 -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 tc5csp20669vcb; Tue, 8 Jul 2014 23:56:54 -0700 (PDT) X-Received: by 10.68.102.34 with SMTP id fl2mr3683576pbb.2.1404889013694; Tue, 08 Jul 2014 23:56:53 -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 S1754882AbaGIG4f (ORCPT <rfc822;yazen.ghannam@linaro.org> + 28 others); Wed, 9 Jul 2014 02:56:35 -0400 Received: from mail-qa0-f42.google.com ([209.85.216.42]:46623 "EHLO mail-qa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbaGIG4c (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 9 Jul 2014 02:56:32 -0400 Received: by mail-qa0-f42.google.com with SMTP id dc16so5769026qab.15 for <linux-kernel@vger.kernel.org>; Tue, 08 Jul 2014 23:56:31 -0700 (PDT) X-Received: by 10.140.18.243 with SMTP id 106mr63029541qgf.105.1404888991634; Tue, 08 Jul 2014 23:56:31 -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 z14sm84944441qaw.7.2014.07.08.23.56.27 for <multiple recipients> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:31 -0700 (PDT) From: Viresh Kumar <viresh.kumar@linaro.org> 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 <viresh.kumar@linaro.org>, Ingo Molnar <mingo@redhat.com>, Peter Zijlstra <peterz@infradead.org> Subject: [RFC 6/7] rtmutex: don't check for active hrtimer after adding it Date: Wed, 9 Jul 2014 12:25:38 +0530 Message-Id: <b5952471057e6998e9c8aa16c28101a6ff62e289.1404888801.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <cover.1404888801.git.viresh.kumar@linaro.org> References: <cover.1404888801.git.viresh.kumar@linaro.org> In-Reply-To: <cover.1404888801.git.viresh.kumar@linaro.org> References: <cover.1404888801.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: <patchwork-forward.linaro.org> 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.174 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: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe>, <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com> |
diff --git a/kernel/locking/rtmutex.c b/kernel/locking/rtmutex.c index fc60594..9ea8830 100644 --- a/kernel/locking/rtmutex.c +++ b/kernel/locking/rtmutex.c @@ -922,11 +922,8 @@ rt_mutex_slowlock(struct rt_mutex *lock, int state, set_current_state(state); /* Setup the timer, when timeout != NULL */ - if (unlikely(timeout)) { + if (unlikely(timeout)) hrtimer_start_expires(&timeout->timer, HRTIMER_MODE_ABS); - if (!hrtimer_active(&timeout->timer)) - timeout->task = NULL; - } ret = task_blocks_on_rt_mutex(lock, &waiter, current, detect_deadlock);
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 rtmutex core to get this fixed. Cc: Ingo Molnar <mingo@redhat.com> Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> --- kernel/locking/rtmutex.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)