From patchwork Fri Apr 4 08:35:32 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27792 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8480E20490 for ; Fri, 4 Apr 2014 08:38:55 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf11468673pab.9 for ; Fri, 04 Apr 2014 01:38:54 -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=hJeVRDy8FaNtCdO9DUbXomD+5ANUGf8Jy38VfEAymAQ=; b=P9C8owxR2icS4CkDNPljbhu4GsmhVk2++BBt4xcS5KmizwP2m89vfuLVwwplZ8U1y4 L+m9T3VotBM6mKQxHXtYtCJ6OuFO4mFhnE9IMEYBaW0PtsojulQNnV5xbo70BT0cZUqa KL4gUQlUaPlj27Q/DlfAEkHp93uow0YDdgdpVw60E0q7kUk34DVoyZxY0TZYK9fqeCvw sas6RJf8e0JY48iJRYJDyuk6WCU1e8/tigDWuQXzliSW2bX4sw8fE6/BbDiyX4KufKpx ne3Esv9bS+ejPWie95RuXYhZxQJf55WWL59CFPGrXCoNself5SEfEbmVF4R5R1f3WwQx wqPQ== X-Gm-Message-State: ALoCoQl78E1RPPbNE+S9wxzrBKN4Lrj4gIktDwmlYXljtiPpGtJ3dqldJCF4cphDKEnJanpO52p5 X-Received: by 10.68.201.7 with SMTP id jw7mr7031804pbc.8.1396600734623; Fri, 04 Apr 2014 01:38:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.98.68 with SMTP id n62ls977572qge.28.gmail; Fri, 04 Apr 2014 01:38:54 -0700 (PDT) X-Received: by 10.52.130.225 with SMTP id oh1mr10289206vdb.8.1396600734497; Fri, 04 Apr 2014 01:38:54 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id o6si1687566vcn.21.2014.04.04.01.38.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:38:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id hu19so2937776vcb.15 for ; Fri, 04 Apr 2014 01:38:54 -0700 (PDT) X-Received: by 10.58.187.9 with SMTP id fo9mr3948418vec.4.1396600734408; Fri, 04 Apr 2014 01:38: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.220.12.8 with SMTP id v8csp95693vcv; Fri, 4 Apr 2014 01:38:53 -0700 (PDT) X-Received: by 10.66.148.230 with SMTP id tv6mr13234389pab.155.1396600732728; Fri, 04 Apr 2014 01:38:52 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tm7si4308044pac.188.2014.04.04.01.38.51; Fri, 04 Apr 2014 01:38:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752556AbaDDIim (ORCPT + 27 others); Fri, 4 Apr 2014 04:38:42 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:52125 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752417AbaDDIga (ORCPT ); Fri, 4 Apr 2014 04:36:30 -0400 Received: by mail-wi0-f182.google.com with SMTP id d1so756720wiv.9 for ; Fri, 04 Apr 2014 01:36:29 -0700 (PDT) X-Received: by 10.194.188.41 with SMTP id fx9mr17877652wjc.56.1396600589535; Fri, 04 Apr 2014 01:36:29 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id lb4sm11414938wjb.14.2014.04.04.01.36.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:36:28 -0700 (PDT) From: Viresh Kumar To: tglx@linutronix.de, fweisbec@gmail.com, peterz@infradead.org, mingo@kernel.org, tj@kernel.org, lizefan@huawei.com Cc: linaro-kernel@lists.linaro.org, linaro-networking@linaro.org, Arvind.Chauhan@arm.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 5/8] hrtimer: don't migrate pinned timers Date: Fri, 4 Apr 2014 14:05:32 +0530 Message-Id: <62698fe1c1f632338b0441f63897372dc0f4cd13.1396599474.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e 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=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) 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: , migrate_hrtimer() is called when a CPU goes down and its timers are required to be migrated to some other CPU. Its the responsibility of the users of the hrtimer to remove it before control reaches to migrate_hrtimer(). As these were the pinned hrtimers, the best we can do is: don't migrate these and report to the user as well. That's all this patch does. Signed-off-by: Viresh Kumar --- kernel/hrtimer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index c5a4bf4..853dd8c 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c @@ -1640,6 +1640,7 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, { struct hrtimer *timer; struct timerqueue_node *node; + int is_pinned; while ((node = timerqueue_getnext(&old_base->active))) { timer = container_of(node, struct hrtimer, node); @@ -1652,6 +1653,15 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, * under us on another CPU */ __remove_hrtimer(timer, HRTIMER_STATE_MIGRATE, 0); + + is_pinned = timer->state & HRTIMER_STATE_PINNED; + + /* Check if CPU still has pinned timers */ + if (unlikely(WARN(is_pinned, + "%s: can't migrate pinned timer: %p, deactivating it\n", + __func__, timer))) + continue; + timer->base = new_base; /* * Enqueue the timers on the new cpu. This does not