From patchwork Wed Jul 9 06:55:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 33259 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3A0C3203F4 for ; Wed, 9 Jul 2014 06:56:03 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id fp1sf45040122pdb.4 for ; Tue, 08 Jul 2014 23:56:02 -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=eMeTGNM8CGoG/triTRwX1RMu0VYkcZHTShU7xOD/DRI=; b=jYPota7DBsi1PWD0ueuaXnCeBcpIv4bsFFJbiZ7QqppwdGn2OcSIXgylfYsqB2EyjB Z5aB/dImej30FIQpCibzYOcRsBnTKI6MfJ5b8mb/gETeMFDhJmRf8SvW19pLzRP5I79q nIpeGhPxaXPUXd8a8qfREXh0/E+6bty0Ag3/Y7wsrvvCcGI/AXPWIhIn6SxqwCDz7pdj 0qj5YQfQbY3VJJMGsKQAQCDXD1/QWYBlteXWoEw0jIY1lu0AwUqhYd6K6upXypB9dqr4 323kwfV2qTXdJp9IdSH4FC0pY/lqUrR6k2DRfSBJBcdX1qME25Yqwo1PowOzof6VxCcF DSiA== X-Gm-Message-State: ALoCoQlrI1gXBKBOMGiEzAzh9Cuo82Go5N7WjTn5k9MfftVUgvuZRMSmT01aOkrgIuZbefo0iwVh X-Received: by 10.68.230.193 with SMTP id ta1mr19474683pbc.6.1404888962256; Tue, 08 Jul 2014 23:56:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.38.114 with SMTP id s105ls2425305qgs.64.gmail; Tue, 08 Jul 2014 23:56:02 -0700 (PDT) X-Received: by 10.220.59.65 with SMTP id k1mr37897831vch.22.1404888962132; Tue, 08 Jul 2014 23:56:02 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id t6si20029579vcr.86.2014.07.08.23.56.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:56:02 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id i13so6816198veh.29 for ; Tue, 08 Jul 2014 23:56:02 -0700 (PDT) X-Received: by 10.58.236.170 with SMTP id uv10mr577338vec.31.1404888962047; Tue, 08 Jul 2014 23:56:02 -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 tc5csp20632vcb; Tue, 8 Jul 2014 23:56:01 -0700 (PDT) X-Received: by 10.70.21.201 with SMTP id x9mr9496905pde.7.1404888961214; Tue, 08 Jul 2014 23:56:01 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ez5si45291874pbc.174.2014.07.08.23.56.00; Tue, 08 Jul 2014 23:56:00 -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 S932088AbaGIGz6 (ORCPT + 28 others); Wed, 9 Jul 2014 02:55:58 -0400 Received: from mail-qa0-f53.google.com ([209.85.216.53]:62272 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751542AbaGIGzz (ORCPT ); Wed, 9 Jul 2014 02:55:55 -0400 Received: by mail-qa0-f53.google.com with SMTP id v10so441939qac.40 for ; Tue, 08 Jul 2014 23:55:55 -0700 (PDT) X-Received: by 10.140.87.99 with SMTP id q90mr5522460qgd.43.1404888955044; Tue, 08 Jul 2014 23:55:55 -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 b9sm84947493qae.4.2014.07.08.23.55.51 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 08 Jul 2014 23:55:54 -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 1/7] hrtimer: Warn if hrtimer_start*() failed to enqueue hrtimer Date: Wed, 9 Jul 2014 12:25:33 +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.128.170 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 kernel we check if hrtimer is enqueued properly with hrtimer_active(). This isn't required and can be dropped. Before fixing that, lets make sure hrtimer is always enqueued properly by adding WARN_ON_ONCE(!hrtimer_active(timer)); towards the end of __hrtimer_start_range_ns(). Suggested-by: Frederic Weisbecker Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index 3ab2899..cf40209 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1037,6 +1037,8 @@ int __hrtimer_start_range_ns(struct hrtimer *timer, ktime_t tim, unlock_hrtimer_base(timer, &flags); + /* Make sure timer is enqueued */ + WARN_ON_ONCE(!hrtimer_active(timer)); return ret; } EXPORT_SYMBOL_GPL(__hrtimer_start_range_ns);