Received: by 2002:ab2:2994:0:b0:1ef:ca3e:3cd5 with SMTP id n20csp742360lqb; Fri, 15 Mar 2024 05:31:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWM+OyPJpNh3z01HyxHkIP0F5Ysbz+aPzj3a1vfsCm7Dg3XYhHpBRnTnmomYMT7hWaRIDb1QA+gIal3dvqAhrvf4Ry7/51tbEzKROCoUQ== X-Google-Smtp-Source: AGHT+IFq1nKgylE3a6h7xsz3y2dLF24wEmqEh4soWdkSg992O403QL9w9OBMU0pqHq11YypA+bm8 X-Received: by 2002:a17:906:9c8c:b0:a3e:cdae:7aa2 with SMTP id fj12-20020a1709069c8c00b00a3ecdae7aa2mr3887810ejc.35.1710505889011; Fri, 15 Mar 2024 05:31:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710505889; cv=pass; d=google.com; s=arc-20160816; b=hX/wFTGzSF+0rbJZVBermvRvDWJDw9ZtDhMbH1sGzJGwx4tdVr8zvBT+/aEPSr3/0m FFxuXLaZS3qabJNOJ6QoJ++5EaSbtOapDY7abhD7B6SPCIyaKP3CR6woYIJg3hdfUwrf iSUvVYCGfHbjNsC1r+vhwU/feHf/k4AwejLMI7MhFHGMXXKh+T4BNALoew65veFZDKBu 3dEBJsjKHpQJ+KCnI4YWp7bG/vrqRq9AH1Iw6p06/ss+XzjtDLKn1MssytDu7WtpR9iZ cd2ts56cZZsey8JyMpbQzU1MIyGwdsBqu8za3ES6pQoL8cfCPwZEpgau+7vbIdxd01Im 7nkg== ARC-Message-Signature: i=2; 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=JFv0B5ga4eoQP/oz3fo+Joth8S2CDrosT03LXrx3X9c=; fh=bYoAnI7wLLEzElKRdayDf9Y/2auM3U5UPNYmD0YBCZQ=; b=ThTQ9QWeoWh1ViMXKpVwT7Kz93vALVDFOAe4I0lmptnIYFEh3kllBsFGii0Bh8qQ6R 4Tuivx2YN2QJER/dzjO/VgLayP/9GleygxKCEN2mZUjebjKDSCrREXhFHhzTtfzTGHiS m8tddV4IYUrV3fmhDLgOlXK/2el5VabIdRazjl7h0rfGraA8kft/ru2TNKtzjnNORB2z EonGaaujAZnVDJmRm/IFGSQsOyOscxqD7r2oY99GIChGxZp7JV0gTcATnyTd8ycX1O6F I9DkDHU9Ul/dIV6cgbEvJ7fQ1gsa12A84bYY96N1ms507lVtV45ImAcAi5ksrtlljgRG WSrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-104399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104399-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 f5-20020a170906560500b00a466a1fd948si1686376ejq.278.2024.03.15.05.31.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 05:31:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104399-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; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-104399-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104399-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 BADD91F22CA6 for ; Fri, 15 Mar 2024 12:31:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D636241E5; Fri, 15 Mar 2024 12:31:21 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9187418E2A; Fri, 15 Mar 2024 12:31:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505880; cv=none; b=Jgs6JxY8hpY+b46WWrzJWqg3lnS30DyCDRpvMA53cW9ymJdsTl0gw5Ulj+MMMsEvmJb7ShUPzUPjWARG2n4KV/mIn4q9812ueath0TN1IiCXnGGncgfK395404ntvBZjb64bRl29ZaDhWoMS+qkFt0IG0/Ie18UNcN53E5I1ExU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710505880; c=relaxed/simple; bh=JTSXdyneMUtKsAMMlrMN88s36RTjQQq2KAmbHZDa4x8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QUTou/Rg1es85I82N2d40743/gHvgScYMx3LZt6Ld0Lef8MGwPeqgU531tV4joyO8p2cD8vuWunzNK0ZAYlOl8PJfK0YIYDoBcwNWa68DKV0MPfELSzSveefdWQli+NEksyJl9AHb0rSPL+KIoad2Lvat5YDw5MpFgq1oMqyu/4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 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 023F1C15; Fri, 15 Mar 2024 05:31:53 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 04E1F3F73F; Fri, 15 Mar 2024 05:31:14 -0700 (PDT) Message-ID: <5bb38524-fd13-477f-adde-0a9ac01bfeae@arm.com> Date: Fri, 15 Mar 2024 13:31:06 +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: [RFC PATCH v2 4/7] sched/fair: Use CFS util_avg_uclamp for utilization and frequency Content-Language: en-US To: Hongyan Xia , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Juri Lelli , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , "Rafael J. Wysocki" , Viresh Kumar Cc: Qais Yousef , Morten Rasmussen , Lukasz Luba , Christian Loehle , linux-kernel@vger.kernel.org, David Dai , Saravana Kannan , linux-pm@vger.kernel.org References: <4f755ae12895bbc74a74bac56bf2ef0f30413a32.1706792708.git.hongyan.xia2@arm.com> From: Dietmar Eggemann In-Reply-To: <4f755ae12895bbc74a74bac56bf2ef0f30413a32.1706792708.git.hongyan.xia2@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 01/02/2024 14:12, Hongyan Xia wrote: [...] > @@ -7685,11 +7697,13 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target) > static unsigned long > cpu_util(int cpu, struct task_struct *p, int dst_cpu, int boost) > { > - struct cfs_rq *cfs_rq = &cpu_rq(cpu)->cfs; > - unsigned long util = READ_ONCE(cfs_rq->avg.util_avg); > + struct rq *rq = cpu_rq(cpu); > + struct cfs_rq *cfs_rq = &rq->cfs; > + unsigned long util = root_cfs_util(rq); > + bool capped = uclamp_rq_is_capped(rq); I try to rerun your tests in your 2 ipynbs (cover letter) but this let's the sum aggr stack go sideways ... if 'sched_uclamp_used' then uclamp_rq_is_capped() will call cpu_util_cfs()->cpu_util() which then calls uclamp_rq_is_capped() recursively resulting in a stack overflow. Do you have a fix for that you can share? For the time I remove the call to uclamp_rq_is_capped() in cpu_util(). [...]