From patchwork Thu Mar 20 13:48:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 26707 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f69.google.com (mail-pa0-f69.google.com [209.85.220.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C5510202E0 for ; Thu, 20 Mar 2014 13:49:39 +0000 (UTC) Received: by mail-pa0-f69.google.com with SMTP id fb1sf2229032pad.4 for ; Thu, 20 Mar 2014 06:49:39 -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=FWDAF/IOcGiejkeWEuuJme4w7C+BR3GqLDN4FhlzSFo=; b=iYYyZX2GcSDI3fV/5zhFAHACfXqIU1OT7a+xqKECC2DR0uvy05TdIsIL8UzjKMDbqA M57qeqsdfShXhpDwH6pM3bDDR06tm4SWS51WblWu0/tA45QUI7C6ubye7THBG4i9II7T IAzvjnn69vCGs8WNrJNMaP3AZrTrDXsFN5J1DXGvuEfdVEaJIsbT0KBLq/VvohuW8cFS Z5PPQSYQAAVjLVkteMBeyiPy4gc9T5+/ucpYcNKf00g8FxW4O3Pa8uX5HzOiiDCXo/A9 pZbkPOlGTmjLHOUTq0MyKN77voCPoPedY4r1au/IAvqhWJw0aMbmn47BP2HBQJPxcSE1 g/zw== X-Gm-Message-State: ALoCoQmm7Sdz9iEpqJ9BayPhcXkKiGyKg5RiUlyi3O7tlszJrQFPI91bqrYLjFUxfk5nkFq8TpI/ X-Received: by 10.66.190.202 with SMTP id gs10mr17341883pac.0.1395323378994; Thu, 20 Mar 2014 06:49:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.107.7 with SMTP id g7ls257895qgf.53.gmail; Thu, 20 Mar 2014 06:49:38 -0700 (PDT) X-Received: by 10.58.38.166 with SMTP id h6mr13305491vek.22.1395323378857; Thu, 20 Mar 2014 06:49:38 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id ys8si438364veb.106.2014.03.20.06.49.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Mar 2014 06:49:38 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so961450vcb.34 for ; Thu, 20 Mar 2014 06:49:38 -0700 (PDT) X-Received: by 10.58.94.195 with SMTP id de3mr2693678veb.39.1395323378777; Thu, 20 Mar 2014 06:49:38 -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.78.9 with SMTP id i9csp389576vck; Thu, 20 Mar 2014 06:49:38 -0700 (PDT) X-Received: by 10.68.171.4 with SMTP id aq4mr24510179pbc.150.1395323377845; Thu, 20 Mar 2014 06:49:37 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e2si1539930pba.44.2014.03.20.06.49.37; Thu, 20 Mar 2014 06:49:37 -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 S1758942AbaCTNtd (ORCPT + 26 others); Thu, 20 Mar 2014 09:49:33 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:63294 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758878AbaCTNt3 (ORCPT ); Thu, 20 Mar 2014 09:49:29 -0400 Received: by mail-pd0-f170.google.com with SMTP id v10so948990pde.15 for ; Thu, 20 Mar 2014 06:49:28 -0700 (PDT) X-Received: by 10.68.66.1 with SMTP id b1mr47160568pbt.43.1395323368407; Thu, 20 Mar 2014 06:49:28 -0700 (PDT) Received: from localhost ([122.172.246.56]) by mx.google.com with ESMTPSA id qw8sm4054976pbb.27.2014.03.20.06.49.24 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 20 Mar 2014 06:49:27 -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, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Viresh Kumar Subject: [RFC 2/4] timer: don't migrate pinned timers Date: Thu, 20 Mar 2014 19:18:59 +0530 Message-Id: <3fa0ea3a19a51ae2797a25e281763451ad8d2844.1395322529.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.175 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/timer.c b/kernel/timer.c index fec4ab4..a7f8b99 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -1606,11 +1606,22 @@ 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 (is_pinned) { + pr_warn("%s: can't migrate pinned timer: %p, removing it\n", + __func__, timer); + continue; + } + timer_set_base(timer, new_base); internal_add_timer(new_base, timer); }