Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp59822pxb; Mon, 13 Sep 2021 12:55:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzx+HbLPsey1NEIXYxzmH2sWCdrEmQMNAQ6Z82dc0KP1U0Z0rhM7GR0TlLMvQn7gsyrtXY X-Received: by 2002:a92:d84f:: with SMTP id h15mr9094116ilq.42.1631562934759; Mon, 13 Sep 2021 12:55:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631562934; cv=none; d=google.com; s=arc-20160816; b=xXJqrQ4w19XeZc6cImp18VKPZQnLeEz7WmV34sOn1CdaNuGjh4latqn3XQmae3GEwz 8lGo/u/bTkn780mNFGgN8KEaY3c6dYQyjxSRlWwh6H25Q7QJSw49v5RolaOXhiijGjqb 435LOEWgdZHHzN1iCLIEKnwSY3bkRCQ/oCRlZW35Hw6kKpZyzyhK+nG+KJLy5Xtln6xy guav0XyE1IfuzkvHA3EIX2jHV4FnqkrFvac5ZB28zVzUYgIcJv2NVQOYYI10N9BhQcJW /2j80atkI8UuaxKHD92fU9fhFkJHQgDG1xO5Pu7IIKJXS/nXU3dIBQ5pp52xC+sZtGpt z0ZA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ekp5fHtX4fcxVMkffQXFZrXfKYh/+0Mbvizbwlhbhfk=; b=SK5Fha7BC497r8dI6F63Q1bdUOP+MKT5+VmJKOTBtpuARmHx6JJWnTnaJ2iTnEZJts 9Ft2Jw2G1empuw13UKywkP2VPc760JTG3hOLt7zkfZalMbD3oz2T2zwyjPGdlA83tQHb owpe2wS4bEtA0ZIhJ+zqbJ0OVkZXreHvws0tGx/c+ne4M1dSD43oFfd2SqeTvlaVLuwE /8K0b8cm9jaTWkvDu6zKJ34dsbvD3opVGZI3Kji+tZz5B6oN/PEqFiuQMBxdJApDK4gb tbAcGx3j2GuHeakBg5sUa+98EI2s6E3wLW2v6LjqytKL3mUg3fMToWDPRaT3WlISZfMH U0KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aUdsxKGV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si7884411ile.8.2021.09.13.12.55.22; Mon, 13 Sep 2021 12:55:34 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aUdsxKGV; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242835AbhIMNe1 (ORCPT + 99 others); Mon, 13 Sep 2021 09:34:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:34830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240129AbhIMNT4 (ORCPT ); Mon, 13 Sep 2021 09:19:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 91CD9610E6; Mon, 13 Sep 2021 13:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539057; bh=lCEqwOHgy8VyTFJn1sav7f7GkOc6F4tEJaOHo6rs8ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aUdsxKGV6NauwvzI+AL3BLZni7j3Xerg7iqMRhFo1j638D/bW+oSGWSKXVhpVUjfB yEQf0TooY55t58DZo1yIxNCOuocQfbh6thMl7iKrA8hXS2orwjp5qY1Kv5qYoluLvr LPNu9lPwSzSgz9C7iHXnPp3SZzX4NF/h6kD06R5Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bruno Goncalves , Dietmar Eggemann , "Peter Zijlstra (Intel)" , Daniel Bristot de Oliveira , Juri Lelli , Sasha Levin Subject: [PATCH 5.4 007/144] sched/deadline: Fix missing clock update in migrate_task_rq_dl() Date: Mon, 13 Sep 2021 15:13:08 +0200 Message-Id: <20210913131048.210471386@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131047.974309396@linuxfoundation.org> References: <20210913131047.974309396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dietmar Eggemann [ Upstream commit b4da13aa28d4fd0071247b7b41c579ee8a86c81a ] 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Daniel Bristot de Oliveira Acked-by: Juri Lelli Link: https://lore.kernel.org/r/20210804135925.3734605-1-dietmar.eggemann@arm.com Signed-off-by: Sasha Levin --- kernel/sched/deadline.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index 7ab0b80cb12d..2bda9fdba31c 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -1654,6 +1654,7 @@ static void migrate_task_rq_dl(struct task_struct *p, int new_cpu __maybe_unused */ raw_spin_lock(&rq->lock); if (p->dl.dl_non_contending) { + update_rq_clock(rq); sub_running_bw(&p->dl, &rq->dl); p->dl.dl_non_contending = 0; /* -- 2.30.2