Received: by 10.223.164.202 with SMTP id h10csp431002wrb; Fri, 10 Nov 2017 08:35:23 -0800 (PST) X-Google-Smtp-Source: AGs4zMaXy0MClSYfXn1TJ/1v3yZozB2mtx9651PudBZsk6kpunVmnGYI1dhZ6jelGZqcDJst+/x6 X-Received: by 10.99.110.6 with SMTP id j6mr909180pgc.246.1510331723440; Fri, 10 Nov 2017 08:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510331723; cv=none; d=google.com; s=arc-20160816; b=LNXkS65mULMZkQAa6MLHZgtaIVUwMbPp60FxUn5HWZ9YAMGnDiMGt9HachBOqGagQk z0bdFA833nQScbkrs83Qy/uFEa37gr1Q1FtTBQlCeeCPc4HhO8fj1yHQ1jvAeBP9x0dw qjVHW85Dik+TlOpT9DdtYwvQMuxlk6K9pyZVFE1iJLWKtuNYIs4WL/CntStsbMa1fVQi cnYPdyWUTXav3TIOdwsYXa+zVV7LWC+sCrv7o/CCWio0uAjSo4hdP/5RDxo6JND9Nwba lAUcNvu8URa8cszjkysI7dUQnY7Ze+28Mr7AEt329zEw2sYCT8oQxI8cCLL9Zk2I4xKt zp7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=HwUPRogXg8JPKzpJPcpqjgUx9wS0E9U7ZcYicVQsSG0=; b=AGRxAkvVov5jTyPD84u3sRlWbJbfUlyxP4VAoj+pn4aBNfMJzGMZ+NL2cdWuHBSGC2 ZPaeMgsf7uo3GGtghAzOz5Ckk0nIOcPtyOFbdtTb2Ds8l1ygIPtogWNWuV2KvjLGrWy2 pvUONQSL8FADbOVJ5SlihkkjCmy8gQgtZlmjWutWI4sT13J4vejBuosPmVo5HMSYv1V0 9uYXaXbX30mP6EOhRq3D73jfqeW5g65iQ8QBkkfq8o/QLnnwSVMrIRFct6D2m4RLZ8X/ xBTZQpvuc1ZL6+32uGmIgPqX2te+TO5DO52//sjVy+zpRwx4djm3yXG6YdSUv2nG0IMz 4C/w== 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 i7si32305pgq.588.2017.11.10.08.35.12; Fri, 10 Nov 2017 08:35:23 -0800 (PST) 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 S1753405AbdKJQd4 (ORCPT + 82 others); Fri, 10 Nov 2017 11:33:56 -0500 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:48632 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752559AbdKJQdw (ORCPT ); Fri, 10 Nov 2017 11:33:52 -0500 Received: from pps.filterd (m0098781.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vAAGVadH006950; Fri, 10 Nov 2017 10:33:28 -0600 Received: from ni.com (skprod3.natinst.com [130.164.80.24]) by mx0a-00010702.pphosted.com with ESMTP id 2e5faw05j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2017 10:33:27 -0600 Received: from us-aus-exhub1.ni.corp.natinst.com (us-aus-exhub1.ni.corp.natinst.com [130.164.68.41]) by us-aus-skprod3.natinst.com (8.16.0.21/8.16.0.21) with ESMTPS id vAAGXQOZ018418 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 10 Nov 2017 10:33:26 -0600 Received: from us-aus-exch3.ni.corp.natinst.com (130.164.68.13) by us-aus-exhub1.ni.corp.natinst.com (130.164.68.41) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Fri, 10 Nov 2017 10:33:26 -0600 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch3.ni.corp.natinst.com (130.164.68.13) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Fri, 10 Nov 2017 10:33:26 -0600 Received: from jcartwri.amer.corp.natinst.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Fri, 10 Nov 2017 10:33:26 -0600 Received: by jcartwri.amer.corp.natinst.com (Postfix, from userid 1000) id A65E130199E; Fri, 10 Nov 2017 10:33:26 -0600 (CST) From: Julia Cartwright To: , CC: Thomas Gleixner , Steven Rostedt , Carsten Emde , "Sebastian Andrzej Siewior" , John Kacur , "Paul Gortmaker" , Subject: [PATCH RT 3/4] kernel/hrtimer: migrate deferred timer on CPU down Date: Fri, 10 Nov 2017 10:33:25 -0600 Message-ID: <325304ee540e3c916d6c7b15f6e860b7729d138c.1510269414.git.julia@ni.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-10_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_policy_notspam policy=outbound_policy score=30 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=30 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711100230 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.1.46-rt52-rc1 stable review patch. If you have any objection to the inclusion of this patch, let me know. --- 8< --- 8< --- 8< --- From: Sebastian Andrzej Siewior hrtimers, which were deferred to the softirq context, and expire between softirq shutdown and hrtimer migration are dangling around. If the CPU goes back up the list head will be initialized and this corrupts the timer's list. It will remain unnoticed until a hrtimer_cancel(). This moves those timers so they will expire. Cc: stable-rt@vger.kernel.org Reported-by: Mike Galbraith Tested-by: Mike Galbraith Signed-off-by: Sebastian Andrzej Siewior (cherry picked from commit b3c08bffdcdd23f1b3ca8d9c01e3b8a715e03d46) Signed-off-by: Julia Cartwright --- kernel/time/hrtimer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c index 2c6be169bdc7..75c990b00525 100644 --- a/kernel/time/hrtimer.c +++ b/kernel/time/hrtimer.c @@ -1951,6 +1951,11 @@ static void migrate_hrtimer_list(struct hrtimer_clock_base *old_base, /* Clear the migration state bit */ timer->state &= ~HRTIMER_STATE_MIGRATE; } +#ifdef CONFIG_PREEMPT_RT_BASE + list_splice_tail(&old_base->expired, &new_base->expired); + if (!list_empty(&new_base->expired)) + raise_softirq_irqoff(HRTIMER_SOFTIRQ); +#endif } static void migrate_hrtimers(int scpu) -- 2.14.2 From 1584073794585841297@xxx Tue Nov 14 20:14:53 +0000 2017 X-GM-THRID: 1584073794585841297 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread