Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp131777imm; Thu, 2 Aug 2018 15:28:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfPPfymo67N/J7NQ7WiubugXwZYN73lNoG3O0ITyMcRTlxfvFj2JDxW9B/CK5mMN2zgNPcl X-Received: by 2002:a63:8f03:: with SMTP id n3-v6mr1203583pgd.166.1533248901107; Thu, 02 Aug 2018 15:28:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533248901; cv=none; d=google.com; s=arc-20160816; b=ky/OYfPa7sLoj1L1F1mhgDT56j+NEdKk3qCaXxaIeXFgoki2aNFnr1dPQfkYvyNgN0 0930S+GbxfV0WSu5Uxo47ieQhM9bFUHep9N0UvwYxFhb50DiRp/JQLJlkTVQ53l0cA+q yWJznzkVcFHX0t+PDLh1u5RK0sVEzyQWVpXqYQ/4gp0WNcXugnL8plW4QtnQ9ER+wJi7 2g01avBDDwGgXl/FFsxsd5SWnMGDjPuJn2vSu9IKOtf4VOnSO3UOJsFQAoCBbFb75vZH 45aY4hfKP69lVk/elXqRv2tYQ/cuZWKpe+iYu2EhHCfhaHsGDYX5fne67jOFAlXQCf3I m2OA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=d+0TR33i5YfCYOXxbjxhwOX1zeVEcLwsAYC3GG+WvwE=; b=eDtoZoigAx7rRO4eaguu4W2rP0ob6fk+kmV5i1W4Jx3kN7X58/aFwXtNKBrO69g6H8 E3bCaoF4WGfsODi7UW/Qpza7d3dwY/z/UrMdemWWZlo2ZguzgJiEZWjc2VQiWiA5Nkef PnJaFN+ytWtZFu5aBv6OHrF215a0OE2W3GBYYd6k8CeKzF7hK6RUiZMEtY8+Z3VNOroi HH1KLtE5hBygV1qywudzPSap59GyRYgfeSWHrqDE5EHuMYEi8ydDKPeEbslhTLQwYfs2 jd8GM9Kp9YgnDuDc5BslJRdeXwWTDVdnh7D2De/6wh/xjHkn32UhXE9Z3aEKvkhmEHdz g9Sw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si2566402pgo.325.2018.08.02.15.28.06; Thu, 02 Aug 2018 15:28:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732194AbeHCATm (ORCPT + 99 others); Thu, 2 Aug 2018 20:19:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbeHCATl (ORCPT ); Thu, 2 Aug 2018 20:19:41 -0400 Received: from localhost.localdomain (c-98-220-238-81.hsd1.il.comcast.net [98.220.238.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F03A7215E6; Thu, 2 Aug 2018 22:26:29 +0000 (UTC) From: Tom Zanussi To: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org Cc: rostedt@goodmis.org, tglx@linutronix.de, C.Emde@osadl.org, jkacur@redhat.com, bigeasy@linutronix.de, daniel.wagner@siemens.com, julia@ni.com, stable-rt@vger.kernel.org, Tom Zanussi Subject: [PATCH 05/15] alarmtimer: Prevent live lock in alarm_cancel() Date: Thu, 2 Aug 2018 17:25:20 -0500 Message-Id: X-Mailer: git-send-email 2.14.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior If alarm_try_to_cancel() requires a retry, then depending on the priority setting the retry loop might prevent timer callback completion on RT. Prevent that by waiting for completion on RT, no change for a non RT kernel. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior (cherry picked from commit 51e376c469bf05f32cb1ceb9e39d31bb92f1f6c8) Signed-off-by: Tom Zanussi --- kernel/time/alarmtimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/time/alarmtimer.c b/kernel/time/alarmtimer.c index 119847b93ba6..5a5e05fc92a3 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -395,7 +395,7 @@ int alarm_cancel(struct alarm *alarm) int ret = alarm_try_to_cancel(alarm); if (ret >= 0) return ret; - cpu_relax(); + hrtimer_wait_for_timer(&alarm->timer); } } EXPORT_SYMBOL_GPL(alarm_cancel); -- 2.14.1