From patchwork Wed May 9 16:02:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 135302 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp5814596lji; Wed, 9 May 2018 09:02:26 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq7oOahtpDbjpaw2mNUbfjC8Mszm3FSjnEeBZRHVgx99tPRfN0kq0iE9aYKgsndPNX4MRpH X-Received: by 10.98.87.142 with SMTP id i14mr43044854pfj.119.1525881746263; Wed, 09 May 2018 09:02:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525881746; cv=none; d=google.com; s=arc-20160816; b=Wv0g703NmwO7Coq5Fvo/+LLePGOA+C77j5Nm/tH1S0cOHDqcjZP+ZKLjrTIaegwVAC Akrc00eu00JY2QCYr4D7Zivr9Xk67UCmZ1OBb67xjJyyLG52yg5FIlmVkXEcAtSS4KUI qsdoTu6lp17KUPvyNXPh5wgvvCfAtx1D/oLDsBrmalQoWyJLA6OchWX8nw8D+8Fx1LLP ZJDgjOR37Iybn45o1U3wXsWXyCTAeXNfLmujT7IhirQ9m9xBsFMpo/SA4Lu6fy8F1hW0 RKXMfQgbzbNQy+Z+LTBsJSjIuhT1SKgSSZPUkzw9wd1oKv/M1IDVeSA3Yp3DKnjMlK+c bL6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=NAoy2ZatMyFbs/8g2LaswkMvFB9gKjOFC7qbj0ql4iE=; b=Q9WGiS4TTYgm8FK1GUkIg4s6HK1nc4tgvJnvnQrr6K9hFiu0EovrMV9A4gBiRYES3o Uc2r1gFXli/RzYd4qM5/VOkQA1Gk6Xo1n27BwhlJ0/1oIInB5tYE3nBbt2j61JC05kk8 U5Cso9LIMUEdc6tEko/hOZ5o/jznQTTt+KjusD5Vja3ERGkS92i3uscCK6yBVdIsHI0F 7fasqNvjBwR8W6YBvFUduU7f2dIRGQ+zrMMOzVdNwyLRxPLO/wXgIMQgLFCbD0iPitIA isAQbUDFapSaNjR6gGtic1S/WsNV7sybN536LbiACeqaDxjhniJvyfblpCnYb2BDQzYP nfVw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p66si27372560pfg.329.2018.05.09.09.02.25; Wed, 09 May 2018 09:02:26 -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; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935461AbeEIQCX (ORCPT + 29 others); Wed, 9 May 2018 12:02:23 -0400 Received: from foss.arm.com ([217.140.101.70]:45884 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935445AbeEIQCU (ORCPT ); Wed, 9 May 2018 12:02:20 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 420CE1529; Wed, 9 May 2018 09:02:20 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (unknown [10.1.210.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 573963F592; Wed, 9 May 2018 09:02:19 -0700 (PDT) From: Sudeep Holla To: linux-kernel@vger.kernel.org, Thomas Gleixner Cc: Sudeep Holla , Frederic Weisbecker Subject: [PATCH] tick: prefer a lower rating device only if it's CPU local device Date: Wed, 9 May 2018 17:02:08 +0100 Message-Id: <1525881728-4858-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Checking the equality of cpumask for both new and old tick device doesn't ensure that it's CPU local device. This will cause issue if a low rating clockevent tick device is registered first followed by the registration of higher rating clockevent tick device. In such case, clockevents_released list will never get emptied as both the devices get selected as preferred one and we will loop forever in clockevents_notify_released. Cc: Frederic Weisbecker Cc: Thomas Gleixner Signed-off-by: Sudeep Holla --- kernel/time/tick-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Hi Thomas, I am seeing this issue on my Juno devboard, where system wide timers with rating 300 and 400 are registered in same order and we get stuck in a loop in clockevents_notify_released. Let me know if this looks sane or you have any suggestions that I can try out. Regards, Sudeep -- 2.7.4 diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 49edc1c4f3e6..78e598334007 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -277,7 +277,8 @@ static bool tick_check_preferred(struct clock_event_device *curdev, */ return !curdev || newdev->rating > curdev->rating || - !cpumask_equal(curdev->cpumask, newdev->cpumask); + (!cpumask_equal(curdev->cpumask, newdev->cpumask) && + !tick_check_percpu(curdev, newdev, smp_processor_id())); } /*