Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp106333pxt; Wed, 4 Aug 2021 07:02:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUFURz+v839/6QqpHJgVMAIYidb8xXJmP1SaMmMerprlKsWPtY7p7CXzsUkpXW36YmNerO X-Received: by 2002:aa7:df09:: with SMTP id c9mr32945321edy.379.1628085718852; Wed, 04 Aug 2021 07:01:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628085718; cv=none; d=google.com; s=arc-20160816; b=Go23ErXJPRUsRZA72Y1+Oto2DhlaQ3BD5EEg5Z+EJQVH6KdI/UH0+87+XTSFQe71Vu DtNVsyU5cuhrOGhKZIDKkFiGwuuy+i/AQJMKVfH4nabWvXoDD5YAM03pHFdQLCyqTsOn 1Dlx5jF2w0v6gaxq1HHi08AyM7WAjFCoJfEkVoK0KGQR9ajrZU1hdwNVT7Jx3sRbqoE7 24Ayb5flUB1i71/k//u+Rz8/dRdrM/TsSo5o6gQTJ5ru/Vq8znnwqAw/l1y8AMiffyVG HP4qdfdrUXiXfmL2vDh6XdznwH1FD7OOxos5OanRxf3cWx5VdwmquuiJ0WNXes5TaxjL zKVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=rlzuaSjIASlcATCpjP3OWu94CCrYDB8EA7XP37o3Cb0=; b=R4v/nuJqJeub6YXADS1im807MJV03TxV5Nehb55jHoYHnDKJr3oJJOrTEa0GMtu779 4goACkD5ICyZKC+c9EUoZe1u3KlUZBDxTMI0gGQynrnHfz7/7KG0+uPlbWnCB+5yhSt2 w2JoK7LYhp3tOXA9hVAlVWKlbE57h7V0mzA+mqV+lEHh636NIcJGkMhp+zZzD0uRsj0h kLbz0tJecvYNsTXSr9aos7lrDmVqQv2XSls3T3W5OcwOX7RRvmkeqj8O2ArZhZCY2Vx9 kA9ANgFtGyBdZtW/IrzKBLQyN4YksNeK8Wzl5YIS7RMOnO6YwTB/nyDnCQarQzoKqNKu fkpA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p7si2326945ejr.642.2021.08.04.07.01.30; Wed, 04 Aug 2021 07:01:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238342AbhHDN75 (ORCPT + 99 others); Wed, 4 Aug 2021 09:59:57 -0400 Received: from foss.arm.com ([217.140.110.172]:60960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238053AbhHDN7y (ORCPT ); Wed, 4 Aug 2021 09:59:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id C062E11FB; Wed, 4 Aug 2021 06:59:41 -0700 (PDT) Received: from e125579.eggemann (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 294033F719; Wed, 4 Aug 2021 06:59:40 -0700 (PDT) From: Dietmar Eggemann To: Ingo Molnar , Peter Zijlstra , Juri Lelli Cc: Steven Rostedt , Vincent Guittot , Daniel Bristot de Oliveira , Bruno Goncalves , linux-kernel@vger.kernel.org Subject: [PATCH] sched/deadline: Fix missing clock update in migrate_task_rq_dl() Date: Wed, 4 Aug 2021 15:59:25 +0200 Message-Id: <20210804135925.3734605-1-dietmar.eggemann@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A missing clock update is causing the following warning: rq->clock_update_flags < RQCF_ACT_SKIP WARNING: CPU: 112 PID: 2041 at kernel/sched/sched.h:1453 sub_running_bw.isra.0+0x190/0x1a0 ... CPU: 112 PID: 2041 Comm: sugov:112 Tainted: G W 5.14.0-rc1 #1 Hardware name: WIWYNN Mt.Jade Server System B81.030Z1.0007/Mt.Jade Motherboard, BIOS 1.6.20210526 (SCP: 1.06.20210526) 2021/05/26 ... Call trace: sub_running_bw.isra.0+0x190/0x1a0 migrate_task_rq_dl+0xf8/0x1e0 set_task_cpu+0xa8/0x1f0 try_to_wake_up+0x150/0x3d4 wake_up_q+0x64/0xc0 __up_write+0xd0/0x1c0 up_write+0x4c/0x2b0 cppc_set_perf+0x120/0x2d0 cppc_cpufreq_set_target+0xe0/0x1a4 [cppc_cpufreq] __cpufreq_driver_target+0x74/0x140 sugov_work+0x64/0x80 kthread_worker_fn+0xe0/0x230 kthread+0x138/0x140 ret_from_fork+0x10/0x18 The task causing this is the `cppc_fie` DL task introduced by commit 1eb5dde674f5 ("cpufreq: CPPC: Add support for frequency invariance"). With CONFIG_ACPI_CPPC_CPUFREQ_FIE=y and schedutil cpufreq governor on slow-switching system (like on this Ampere Altra WIWYNN Mt. Jade Arm Server): DL task `curr=sugov:112` lets `p=cppc_fie` migrate and since the latter is in `non_contending` state, migrate_task_rq_dl() calls sub_running_bw()->__sub_running_bw()->cpufreq_update_util()-> rq_clock()->assert_clock_updated() on p. Fix this by updating the clock for a non_contending task in migrate_task_rq_dl() before calling sub_running_bw(). Reported-by: Bruno Goncalves Signed-off-by: Dietmar Eggemann --- kernel/sched/deadline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index aaacd6cfd42f..4920f498492f 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1733,6 +1733,7 @@ static void migrate_task_rq_dl(struct task_struct *p, int new_cpu __maybe_unused */ raw_spin_rq_lock(rq); if (p->dl.dl_non_contending) { + update_rq_clock(rq); sub_running_bw(&p->dl, &rq->dl); p->dl.dl_non_contending = 0; /* -- 2.25.1