From patchwork Fri Apr 4 08:35:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 27788 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E358820490 for ; Fri, 4 Apr 2014 08:36:37 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf7851288qac.0 for ; Fri, 04 Apr 2014 01:36:37 -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=dy39ZvZBxCHXStTjrUKpkQ5V73WT8AsO+2jJKvgQGvQ=; b=hOtBFpSpxX12QRIvZkw6nl4PNb2pTzfMnBZV4Ddy0pKXkc9fYfNqohhQeodRh+bFHJ sh6jGB4IFOdiiTU3/ZPg3jEaFcpfZmn6+HRypbU+/6JNwQgMGf6yaTsk+QvFAE7FS5c0 xyTnfy4JjROOvZjIZGWN+MURvE6S2f8e7Dwn7VPE8hMQE7h2pa3+wM21fPx9eltyA1SB SFBqL7jMyHnVUEvYpJ5o3qB+vQEBhjYl+IH4qL0m+hEFxOMebidG1JsyRsS28CDFbBLY V8i0nXUBFbWkOmNxirQ0b+YZ8j2yAsLSbeN5ceVthb13nTLTD/LZdr7slJ0i8Aaoef5F OlQg== X-Gm-Message-State: ALoCoQm1xekG7d8oteYtE/LSgQYClkO4RPd2MYc8T4wJaVwE7idoySWVaPND514K6EPEthztGrwN X-Received: by 10.224.113.202 with SMTP id b10mr7104145qaq.3.1396600597628; Fri, 04 Apr 2014 01:36:37 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.101.245 with SMTP id u108ls958309qge.79.gmail; Fri, 04 Apr 2014 01:36:37 -0700 (PDT) X-Received: by 10.52.142.10 with SMTP id rs10mr10125015vdb.3.1396600597559; Fri, 04 Apr 2014 01:36:37 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id ys8si669915veb.106.2014.04.04.01.36.37 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:36:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jz11so1205767veb.11 for ; Fri, 04 Apr 2014 01:36:37 -0700 (PDT) X-Received: by 10.58.207.74 with SMTP id lu10mr4020825vec.15.1396600597471; Fri, 04 Apr 2014 01:36:37 -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 v8csp95561vcv; Fri, 4 Apr 2014 01:36:36 -0700 (PDT) X-Received: by 10.66.119.136 with SMTP id ku8mr13370333pab.121.1396600595003; Fri, 04 Apr 2014 01:36:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id tj6si4299309pbc.253.2014.04.04.01.36.34; Fri, 04 Apr 2014 01:36:34 -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 S1752382AbaDDIgS (ORCPT + 27 others); Fri, 4 Apr 2014 04:36:18 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:56371 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751799AbaDDIgI (ORCPT ); Fri, 4 Apr 2014 04:36:08 -0400 Received: by mail-wi0-f176.google.com with SMTP id r20so764701wiv.9 for ; Fri, 04 Apr 2014 01:36:07 -0700 (PDT) X-Received: by 10.194.71.164 with SMTP id w4mr18124423wju.0.1396600567379; Fri, 04 Apr 2014 01:36:07 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id dr4sm3237185wid.14.2014.04.04.01.36.02 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 04 Apr 2014 01:36:06 -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 2/8] timer: don't migrate pinned timers Date: Fri, 4 Apr 2014 14:05:29 +0530 Message-Id: <7444411917cec76349dc369714ff9ea74347902e.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.128.180 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_timer() 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 timer to remove it before control reaches to migrate_timers(). As these were the pinned timers, 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/timer.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kernel/timer.c b/kernel/timer.c index e8bcaff..6c3a371 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1606,11 +1606,21 @@ static int init_timers_cpu(int cpu) static void migrate_timer_list(struct tvec_base *new_base, struct list_head *head) { struct timer_list *timer; + int is_pinned; while (!list_empty(head)) { timer = list_first_entry(head, struct timer_list, entry); /* We ignore the accounting on the dying cpu */ detach_timer(timer, false); + + is_pinned = tbase_get_pinned(timer->base); + + /* 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_set_base(timer, new_base); internal_add_timer(new_base, timer); }