From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED800C4338F for ; Fri, 30 Jul 2021 15:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D5D7E60F46 for ; Fri, 30 Jul 2021 15:23:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239739AbhG3PXg (ORCPT ); Fri, 30 Jul 2021 11:23:36 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:47584 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239355AbhG3PXe (ORCPT ); Fri, 30 Jul 2021 11:23:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627658609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rlpYEUP1fPYxSgEcVW4sk69FHL0RWRTkK44MBixj09Y=; b=C5dshoVIwr5aZ7GFGIFwj35LYob6TzNJgDz4Yd+Irrj78YflhmQBFZu2sYqtwiMumMrqQi 7qtXP9QblfNm5De0qkUvolkF9zyHR7klhLkzrBxmTdkgH3HbhODKcBOuRCk3oe9F0t6tuV ajlzc6LqcSKFs5inbcqKe9GkeTRC1bI= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-ZRH1P4gWOQWVBW5qQsHHXA-1; Fri, 30 Jul 2021 11:23:27 -0400 X-MC-Unique: ZRH1P4gWOQWVBW5qQsHHXA-1 Received: by mail-ot1-f69.google.com with SMTP id 16-20020a9d04100000b02904cdb63ceafcso3913372otc.6 for ; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rlpYEUP1fPYxSgEcVW4sk69FHL0RWRTkK44MBixj09Y=; b=SjWwECcL5Mufmk6Qfjoj0+ba3LttEJvmxTSRNJg+UuSvymzsEc4Wmo8x3MKMdlBNBC ypypXxWYTmj97/sFAm1A8v/W3PpjNKUnZIMgDv9pEEqyLwd4bFurDPPtXy8u+c04iKjA 8QdaKxGRVmBTQ8JXHJwNUNxzfs8xDBFUOjCYjz5UNfeWd8jKzO/3MiuRh6bfyJbPpX4p N8sIWt5p0sx/tA/vU9TQ/hW1zwQiv5hLSbEEi59xyvKACBid9D7y49xYMCqXL5fZSbbw /JUBJvwjpU9UWT4OtlKk+G4ca1Zi7ioZv7uykj9XKM53xlD2fvdGz5umU+RGjLE7FDJI CWmg== X-Gm-Message-State: AOAM533Fuq8ahIc/G49P5kocUlWbi+ITmoYz2/zhebkTX6ImUlNk6KSW pws2CXe/trGxzYYKLHI1FNtsUk3J9xzqVqtyWI9OzG/dsHr5C8GlRravAzAha6RWZKP4jltrY8z TMLqrdZTSFqW8hV1VkcN1kThYlcCrgZhuQ9l//f9V X-Received: by 2002:a05:6808:1887:: with SMTP id bi7mr2168239oib.115.1627658607160; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAkIxOoxTGpKbq3vstvHFS3+FBdzu91X0ATz48bfJejhQugTZ5UfQaonBLpYic53MzOmS4bc6K9kxoDjplIEY= X-Received: by 2002:a05:6808:1887:: with SMTP id bi7mr2168225oib.115.1627658607019; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) MIME-Version: 1.0 References: <1ea2fa5c-ae81-2389-7f02-2227636582e4@arm.com> In-Reply-To: <1ea2fa5c-ae81-2389-7f02-2227636582e4@arm.com> From: Bruno Goncalves Date: Fri, 30 Jul 2021 17:23:15 +0200 Message-ID: Subject: Re: WARNING: CPU: 112 PID: 2041 at kernel/sched/sched.h:1453 To: Dietmar Eggemann Cc: CKI Project , linux-kernel@vger.kernel.org, nathan@kernel.org, Memory Management , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 30, 2021 at 2:22 PM Dietmar Eggemann wrote: > > On 29/07/2021 16:38, Dietmar Eggemann wrote: > > On 29/07/2021 14:36, Bruno Goncalves wrote: > >> On Wed, Jul 28, 2021 at 5:55 PM Dietmar Eggemann > >> wrote: > >>> > >>> On 28/07/2021 15:11, Bruno Goncalves wrote: > > > > [...] > > > >>> Can't reproduce it on my Juno (arm64) (slow-switching (scpi-cpufreq > >>> driver)). > >> > >> We seem to be able to reproduce this only on Ampere Altra machines, > >> specifically on mtjade and mtsnow cpus. > >> > >> # cpupower frequency-info > >> analyzing CPU 0: > >> driver: cppc_cpufreq > >> CPUs which run at the same hardware frequency: 0 > >> CPUs which need to have their frequency coordinated by software: 0 > >> maximum transition latency: Cannot determine or is not supported. > >> hardware limits: 1000 MHz - 2.80 GHz > >> available cpufreq governors: conservative ondemand userspace > >> powersave performance schedutil > >> current policy: frequency should be within 2.00 GHz and 2.80 GHz. > >> The governor "schedutil" may decide which speed to use > >> within this range. > >> current CPU frequency: 1.55 GHz (asserted by call to hardware) > >> > >> # ps -eTo comm,pid,pri,class | grep sugov > >> sugov:0 1082 140 DLN > >> sugov:1 1085 140 DLN > >> ... > >> sugov:78 1319 140 DLN > >> sugov:79 1320 140 DLN > > > > Thanks! In the meantime I got access to an Ampere Altra so I can try > > 5.14.0-rc1 later today. > > The task causing this seem to be the new `cppc_fie` DL task introduced > by commit 1eb5dde674f5 "cpufreq: CPPC: Add support for frequency > invariance" in v5.14-rc1. > > With `CONFIG_ACPI_CPPC_CPUFREQ_FIE=y` and schedutil cpufreq governor on > slow-switching system: > > DL task curr=`sugov:X` makes p=`cppc_fie` migrate and since it 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. > > Can you try this snippet? It should fix it. Thank you, I've tried the patch and it fixes the issue. Bruno > > --8<-- > > From: Dietmar Eggemann > Date: Fri, 30 Jul 2021 14:03:40 +0200 > Subject: [PATCH] sched/deadline: Fix missing clock update in > migrate_task_rq_dl() > > 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61E26C4338F for ; Fri, 30 Jul 2021 15:27:43 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B1466023E for ; Fri, 30 Jul 2021 15:27:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2B1466023E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lTzA4idGcNauiZGXA6uXiZT1gJviPRuTqiz0Ve4ZGWo=; b=GBPCQhGHv0w6eD MxIuSTfToBhSMnQ7CZetIraZoJmCZACIumAM42ThOGyrXL9sC2Crw0+PjYFul/aAl4cmVLeL0nGsF MYWymdDUUte6JsNllJau9xR6KL3IFCzXO4EBKlW7bL1QM75zlPzZKfUnz67iznCho7ABawOpkPJPq H+G0KBoeT95krp7Mgc198cKtpfpJMH98f+NBCXSHRfJ4TZlqUf0CnV764BSr4Cg3XC+Hk7kQKGaDH UzK1LcGb6KehEIX4qYagftoCAxe4WB0lfRwhzmYXpbRYb8iyqRw4eaD3Qgr0sdCN18n1nHOp8ZQ+a wrLCeE8uz+MwoxMmP/xg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9UNU-009Hiy-VO; Fri, 30 Jul 2021 15:24:52 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9UMH-009HHc-J4 for linux-arm-kernel@lists.infradead.org; Fri, 30 Jul 2021 15:23:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627658609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=rlpYEUP1fPYxSgEcVW4sk69FHL0RWRTkK44MBixj09Y=; b=C5dshoVIwr5aZ7GFGIFwj35LYob6TzNJgDz4Yd+Irrj78YflhmQBFZu2sYqtwiMumMrqQi 7qtXP9QblfNm5De0qkUvolkF9zyHR7klhLkzrBxmTdkgH3HbhODKcBOuRCk3oe9F0t6tuV ajlzc6LqcSKFs5inbcqKe9GkeTRC1bI= Received: from mail-oi1-f198.google.com (mail-oi1-f198.google.com [209.85.167.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-493-buxfdJ4pMECXLoq-bj-eWw-1; Fri, 30 Jul 2021 11:23:27 -0400 X-MC-Unique: buxfdJ4pMECXLoq-bj-eWw-1 Received: by mail-oi1-f198.google.com with SMTP id s17-20020a0568080b11b02901f424a672b7so4654771oij.18 for ; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rlpYEUP1fPYxSgEcVW4sk69FHL0RWRTkK44MBixj09Y=; b=GMwV1ipf2uAu2UpvMMk01rjyp6/mYjN6yd/49KZusxnESzWxYIlgPGrt/Ix0zoyJDA HHqibWua8EMOgOv2TdZFYHKcqc6MEl8aq43Bun+3IyQie+qBGvDOsgFJygctJJvAaa9W i5CYOioV+xcG6bdD+EyoGtNu/aO6gfr7X0wjH6y/Cp7KXjfx3s0MOXJ03DKg3bRVAId9 QMXMY8VoumJK9p+NJqbSbSFsi8AAUUzaPlYTSdykAyXuYTEZYQFDMNLOaOjRGWDfyUHK /cU73aB18Ropg+HURiHU0UXH9s0OOHkZmVOKmQnRslHnoVf/kX8deyR4E6ktAy4kbU/4 Q3Gw== X-Gm-Message-State: AOAM530RSULmWN2oH52BDyCvtOAPOYM/dQsF/wEuu6LwHWVV+u7MziFq FlAuf8l5EO7PNonXWtLbBkafeG7FYxV86gTwFItNXe0AtithPgr6RzTzju1njOIEkoHz4QzzeL0 OCrp4ZpeNCbyAmY68pRS9q3B36C3phTwQQWvgvmthrM9jp2sl2XI= X-Received: by 2002:a05:6808:1887:: with SMTP id bi7mr2168237oib.115.1627658607160; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAkIxOoxTGpKbq3vstvHFS3+FBdzu91X0ATz48bfJejhQugTZ5UfQaonBLpYic53MzOmS4bc6K9kxoDjplIEY= X-Received: by 2002:a05:6808:1887:: with SMTP id bi7mr2168225oib.115.1627658607019; Fri, 30 Jul 2021 08:23:27 -0700 (PDT) MIME-Version: 1.0 References: <1ea2fa5c-ae81-2389-7f02-2227636582e4@arm.com> In-Reply-To: <1ea2fa5c-ae81-2389-7f02-2227636582e4@arm.com> From: Bruno Goncalves Date: Fri, 30 Jul 2021 17:23:15 +0200 Message-ID: Subject: Re: WARNING: CPU: 112 PID: 2041 at kernel/sched/sched.h:1453 To: Dietmar Eggemann Cc: CKI Project , linux-kernel@vger.kernel.org, nathan@kernel.org, Memory Management , linux-arm-kernel@lists.infradead.org Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=bgoncalv@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210730_082333_784765_E506497C X-CRM114-Status: GOOD ( 29.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 30, 2021 at 2:22 PM Dietmar Eggemann wrote: > > On 29/07/2021 16:38, Dietmar Eggemann wrote: > > On 29/07/2021 14:36, Bruno Goncalves wrote: > >> On Wed, Jul 28, 2021 at 5:55 PM Dietmar Eggemann > >> wrote: > >>> > >>> On 28/07/2021 15:11, Bruno Goncalves wrote: > > > > [...] > > > >>> Can't reproduce it on my Juno (arm64) (slow-switching (scpi-cpufreq > >>> driver)). > >> > >> We seem to be able to reproduce this only on Ampere Altra machines, > >> specifically on mtjade and mtsnow cpus. > >> > >> # cpupower frequency-info > >> analyzing CPU 0: > >> driver: cppc_cpufreq > >> CPUs which run at the same hardware frequency: 0 > >> CPUs which need to have their frequency coordinated by software: 0 > >> maximum transition latency: Cannot determine or is not supported. > >> hardware limits: 1000 MHz - 2.80 GHz > >> available cpufreq governors: conservative ondemand userspace > >> powersave performance schedutil > >> current policy: frequency should be within 2.00 GHz and 2.80 GHz. > >> The governor "schedutil" may decide which speed to use > >> within this range. > >> current CPU frequency: 1.55 GHz (asserted by call to hardware) > >> > >> # ps -eTo comm,pid,pri,class | grep sugov > >> sugov:0 1082 140 DLN > >> sugov:1 1085 140 DLN > >> ... > >> sugov:78 1319 140 DLN > >> sugov:79 1320 140 DLN > > > > Thanks! In the meantime I got access to an Ampere Altra so I can try > > 5.14.0-rc1 later today. > > The task causing this seem to be the new `cppc_fie` DL task introduced > by commit 1eb5dde674f5 "cpufreq: CPPC: Add support for frequency > invariance" in v5.14-rc1. > > With `CONFIG_ACPI_CPPC_CPUFREQ_FIE=y` and schedutil cpufreq governor on > slow-switching system: > > DL task curr=`sugov:X` makes p=`cppc_fie` migrate and since it 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. > > Can you try this snippet? It should fix it. Thank you, I've tried the patch and it fixes the issue. Bruno > > --8<-- > > From: Dietmar Eggemann > Date: Fri, 30 Jul 2021 14:03:40 +0200 > Subject: [PATCH] sched/deadline: Fix missing clock update in > migrate_task_rq_dl() > > 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 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel