Received: by 2002:a05:7412:8d11:b0:fa:4934:9f with SMTP id bj17csp19848rdb; Sun, 14 Jan 2024 05:03:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IGvSBE19vyqSZtMtCAeneGApboq0qYucaGqDfN3CuBnkgv5KXFUAV6zRmF+uYCcv3FnUEvf X-Received: by 2002:a17:906:4acb:b0:a2d:4814:5766 with SMTP id u11-20020a1709064acb00b00a2d48145766mr461291ejt.143.1705237388572; Sun, 14 Jan 2024 05:03:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705237388; cv=none; d=google.com; s=arc-20160816; b=CDL0DDY9IrBZYjSq1qeeBlCpNyvfVI60/EsTEEc54alv7Tm3vtje42kXnfdDWp/vWQ 64JrEvGgil8Lup0XEY2HncM+apvzhe9tni3lHgWts3KSp1WyWYLckKSgAgMYhk2uMDvI Lnyz5BzzVU2NQ/NmbmN5i99qN6d2rmpswAtcPISgl1ACch9DC9GBpDwg6sAX5Pw55Ejj izYAdyl+N4YfFNDHlhQ/nEf5YsqQj4KtgiZfI+vGkDI/LJh6rtDf7R5pL6A5dArhCTyf SPs6EA5PJOUH38N43/CR4MFQKkjx+5Q7YmSo25wcVhLeF0BeNtn9Ojqs0vYQlWxluPRH KldA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=gQqEdzvZPUUPjN19siTkqJudWOSgfvjXk3o/GLXU1iI=; fh=K7rbmgWbxSnSohHsx3MPsqCzQt4gwv1R0jjjTGV+AQU=; b=KWJnry50MiIn6QblAGr50JWV5BT3SVGX2ZXKvBVwjjoiPxy3weMkKD0ldt4sI7o5hj CAmrK6UGxczReYHG08IS/4QHKbeBP2IwuYuYm9kuH+nrgCywTSv0CQGNhEHddO6c8Awl PKCSQrsRnNDgV13gT9hB5DBnygIVQRdNZLz3FIl9KFEwsEEwO60WF6UVJj/t+K+aB+RV YYSBNeyraxl7GW/PIxqUgooudKW5IAb6VG4Sr4LsohQZ8Oxxs7dzEXIBQZ6ZAQ6kV8T+ fJXU8mhp4sWjG7H9/b/dUHrGAN5QtgeFx21NC+p5Ngyi6oMmky7s8QuwMeOWPMiFFRSV nPCg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id k13-20020a170906128d00b00a234b6bc08csi2880975ejb.262.2024.01.14.05.03.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 05:03:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-25464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-25464-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-25464-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4A3301F2168A for ; Sun, 14 Jan 2024 13:03:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 209E93C2D; Sun, 14 Jan 2024 13:03:00 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87A6028FA for ; Sun, 14 Jan 2024 13:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 B6D5A1FB; Sun, 14 Jan 2024 05:03:36 -0800 (PST) Received: from [192.168.2.88] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id DF8283F73F; Sun, 14 Jan 2024 05:02:47 -0800 (PST) Message-ID: <711c20cf-4aa7-4380-b076-195736bc4978@arm.com> Date: Sun, 14 Jan 2024 14:02:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [GIT PULL] Scheduler changes for v6.8 Content-Language: en-US To: Wyes Karny , Vincent Guittot Cc: Linus Torvalds , Qais Yousef , Ingo Molnar , linux-kernel@vger.kernel.org, Peter Zijlstra , Thomas Gleixner , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider References: <20240114091240.xzdvqk75ifgfj5yx@wyes-pc> <20240114123759.pjs7ctexcpc6pshl@wyes-pc> From: Dietmar Eggemann In-Reply-To: <20240114123759.pjs7ctexcpc6pshl@wyes-pc> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 14/01/2024 13:37, Wyes Karny wrote: > On Sun, Jan 14, 2024 at 12:18:06PM +0100, Vincent Guittot wrote: >> Hi Wyes, >> >> Le dimanche 14 janv. 2024 � 14:42:40 (+0530), Wyes Karny a �crit : >>> On Wed, Jan 10, 2024 at 02:57:14PM -0800, Linus Torvalds wrote: >>>> On Wed, 10 Jan 2024 at 14:41, Linus Torvalds >>>> wrote: [...] > Yeah, correct something was wrong in the bpftrace readings, max_cap is > not zero in traces. > > git-5511 [001] d.h1. 427.159763: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > git-5511 [001] d.h1. 427.163733: sugov_get_util: [DEBUG] : util 1024, sg_cpu->util 1024 > git-5511 [001] d.h1. 427.163735: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > git-5511 [001] d.h1. 427.167706: sugov_get_util: [DEBUG] : util 1024, sg_cpu->util 1024 > git-5511 [001] d.h1. 427.167708: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > git-5511 [001] d.h1. 427.171678: sugov_get_util: [DEBUG] : util 1024, sg_cpu->util 1024 > git-5511 [001] d.h1. 427.171679: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > git-5511 [001] d.h1. 427.175653: sugov_get_util: [DEBUG] : util 1024, sg_cpu->util 1024 > git-5511 [001] d.h1. 427.175655: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > git-5511 [001] d.s1. 427.175665: sugov_get_util: [DEBUG] : util 1024, sg_cpu->util 1024 > git-5511 [001] d.s1. 427.175665: get_next_freq.constprop.0: [DEBUG] : freq 1400000, util 1024, max 1024 > > Debug patch applied: > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > index 95c3c097083e..5c9b3e1de7a0 100644 > --- a/kernel/sched/cpufreq_schedutil.c > +++ b/kernel/sched/cpufreq_schedutil.c > @@ -166,6 +166,7 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy, > > freq = get_capacity_ref_freq(policy); > freq = map_util_freq(util, freq, max); > + trace_printk("[DEBUG] : freq %llu, util %llu, max %llu\n", freq, util, max); > > if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update) > return sg_policy->next_freq; > @@ -199,6 +200,7 @@ static void sugov_get_util(struct sugov_cpu *sg_cpu, unsigned long boost) > util = max(util, boost); > sg_cpu->bw_min = min; > sg_cpu->util = sugov_effective_cpu_perf(sg_cpu->cpu, util, min, max); > + trace_printk("[DEBUG] : util %llu, sg_cpu->util %llu\n", util, sg_cpu->util); > } > > /** > > > So, I guess map_util_freq going wrong somewhere. sugov_update_single_freq() -> get_next_freq() -> get_capacity_ref_freq() Is arch_scale_freq_invariant() true in both cases, so that get_capacity_ref_freq() returns 'policy->cpuinfo.max_freq' and not just 'policy->cur'?