Received: by 10.192.165.148 with SMTP id m20csp74903imm; Fri, 4 May 2018 06:58:06 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp+SYvddVMxfmdjJnzI+KQmz9N6LsuQBIv8ZJChIYSxD7Ilsdl8ronbEE31h3mEphgyvWib X-Received: by 2002:a65:5b4d:: with SMTP id y13-v6mr22493805pgr.152.1525442286345; Fri, 04 May 2018 06:58:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525442286; cv=none; d=google.com; s=arc-20160816; b=d3RImS2L4L8F8CRY+YI5vcxFEy7Pa44GKhhPvc4+H9SN6q5hoxsqIfZwRtXBN/COvh pPAGORJJmzMF4wTmt8OFJ3B19HztfF8RjlvU2CZM8gh1mgOEaBRflZUaaO8DKPtoHV5H KolhQc+syr4v9LvPtxBgxMfUOd8hJ0d2V/9R9qaZV+XOFF1wh9pVUq1tHKiWMVZgbwYK DIV0kmx3rLcqW21RCsnXtSO0PrtQ7cElFsrAtJmshEgQIyu93qIWA//D7/IzIVdeB4xB fGp1EkdDs33JUXv6YaP1r4grhrGZoej9BahVSTSHQSrPxftB8CTw0yNP5gj30wg3NNuV 7PPQ== 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:message-id:date :subject:cc:to:from:arc-authentication-results; bh=gY8EA3Pg8E/IIJsKZKqGeiPahEo3pmb8pZNt4mwl+s4=; b=WscJ0EeiZBZ8FMEdl9i/4hAF1a5vECUiqY1b876N8WDpAqfmX6CMl+S3sBT2qonLGM tpyINAk8ue+05qdu2crVGdsj6HUAwfOzCe4DGrpnjTJHBVuhjr38sC7j71mzkLg9ZhmN d6b+mPHVC8jXKfszWrfuNbmc5L0FCnNFodaBCIqoRPnLopMa7ZcIg52V6qha5xCZ4L8b A/NT1CvHdmNpbpyJ7zCUyC8dZB55K5mL9bTrYZ6lem3S+NFbayHGLL0Bj5+wBKQDd//s RRRo0dKiFX1td6FQxRbLYJrPHqrRlCwdVwKui83/jJU2B22KnZAmNk4b1/+l/hTtbH+2 BZ1Q== 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=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a185-v6si6175589pgc.586.2018.05.04.06.57.51; Fri, 04 May 2018 06:58:06 -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=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbeEDN5B (ORCPT + 99 others); Fri, 4 May 2018 09:57:01 -0400 Received: from mail.monom.org ([188.138.9.77]:44006 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751948AbeEDNzZ (ORCPT ); Fri, 4 May 2018 09:55:25 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 3A1EA500E4A; Fri, 4 May 2018 15:55:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (ppp-93-104-183-185.dynamic.mnet-online.de [93.104.183.185]) by mail.monom.org (Postfix) with ESMTPSA id F1C195009F8; Fri, 4 May 2018 15:55:22 +0200 (CEST) From: Daniel Wagner To: linux-rt-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Sebastian Andrzej Siewior , Daniel Wagner , Tom Zanussi , Julia Cartwright , stable-rt@vger.kernel.org Subject: [PATCH RT 1/3] alarmtimer: Prevent live lock in alarm_cancel() Date: Fri, 4 May 2018 15:55:14 +0200 Message-Id: <20180504135516.32601-2-wagi@monom.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180504135516.32601-1-wagi@monom.org> References: <20180504135516.32601-1-wagi@monom.org> 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 --- 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 6fcc367ad531..9d5eac2c9275 100644 --- a/kernel/time/alarmtimer.c +++ b/kernel/time/alarmtimer.c @@ -392,7 +392,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.3