Received: by 2002:a05:7208:13ce:b0:7f:395a:35b6 with SMTP id r14csp353552rbe; Thu, 29 Feb 2024 01:12:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWMn940xJczyQrULyTMVx1QPnEbmy+9EnwSJEJnIGW8Cz3Ir8hf997uAQnDLgj5S7gd83ER/bLCAIPnK1/PgqOkmiQRE0pAdipLnxX9Cw== X-Google-Smtp-Source: AGHT+IEGqNPs0CV7Mq+k0770t6E8xs7DgdTVFXRcl8alyA7oqKtr0/p7tOC22R2paQGNOWlx5u+2 X-Received: by 2002:a17:906:a45a:b0:a44:52ec:b9e7 with SMTP id cb26-20020a170906a45a00b00a4452ecb9e7mr360150ejb.16.1709197966393; Thu, 29 Feb 2024 01:12:46 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709197966; cv=pass; d=google.com; s=arc-20160816; b=HBgl8KwdBJwmTi7ORE0Wfvr/JZs3k6bacvOPDGcLbQwhIdTy8TIK+qWaLtzunWmD/E dy1nymmE0Gifrhh7SPcC3b3t0vxXwBkpWZBBJZSP8yxYuhi02ZB6eWcIaatEjJ40E7VM crj9jpYnX1BMAkslduLCfNh/YOAEilEAT9Zh47YI3RVQRNtGNVQBX/3q8rTj84mARNke 7bK79kKhcUde+SyVtj2l7SNxB9Hv35DI7lV+PJ+q8GUnVcuVVJ5RpLvuiT3mG6IFiy5U xfXNN8n/40cfXj+2HCtebi4hhf51rkgcvjkNcHSOEMLCmAGOzvoic/lXiaro3/YHdS1C qQGQ== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=/KD/2zLB7MAUor0FaXWHyR99dGbbws6U5+L/dkyR7Vo=; fh=gYu2lp5EKn/hVNOZ+5r67z7K/eXsdt/RtkQnoUJTVDA=; b=Ku0xzRzDLY4W0GZxuY0CPGOuPDfFFO/XI1o/P8GkMu/z4XU96qthckGYaOTyd5Et+t 0C+3VKFtuYkO5pA4y0Gp2S57ZigwHNpZjO5N/FKIJXMCesrdzSsdahy9pEQUB2M1kFTB Gvea8FPcVLAbjtWNmkuBjLUHoaDRVxcBIka1qQVXJJW1EEe32M9J0Y1REiiJqkwhJo8/ tEZVP5aUPLrrrJouh8VrMRb4TuiTU+LMwIWwLdeTozXV4U/H55T7bIXeKo9utPD3Wqpi nMw/E96uaC5wlOoNhekkVMgMSeiavmu4a8ZyT/IzQX4onJIleTGJrcxEfO5gk90OBIbi 4elg==; 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-86375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86375-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. [147.75.80.249]) by mx.google.com with ESMTPS id qk28-20020a170906d9dc00b00a43ea4fe04fsi416412ejb.157.2024.02.29.01.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 01:12:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-86375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-86375-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-86375-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 477E41F23FE2 for ; Thu, 29 Feb 2024 09:11:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE93458201; Thu, 29 Feb 2024 09:11:23 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2406C5788E for ; Thu, 29 Feb 2024 09:11:20 +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=1709197883; cv=none; b=Vax/njFghYfohXxPd4ZxZcybfxmzlrMPDVNJO4J5L+4hWAu5bkc0ysZwI/bZ/l8LkFe8aAEeWw3YVG2BH48DamCkMGMEIrW9Jb/NuOSmrgUE4aM1taq3GCkGnj1bIRW5KIgzYzgAE7AcI89/obdl+3o0p8RqFK7fWhCMJUlrh6Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709197883; c=relaxed/simple; bh=wzuplOLv4wlaYt2/x9o+UtsMuM1pQzwC9hVrwl7L6Hg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=VLn4FfD6XPtia0Xhvb1bYXNUnHDfGEiAbFIVDVmUwInEud0f1AxAkOK/5DgGUzziIJlkFq/4Kcaxxc5dcLOPc8h8sw49kiJ+XDkwCc5iikXmy/8JeNe6rV/uJsH+b2v/7Ipip4O0x987gubjnLUCNqqmSaNEGVpXISI3rJb/GqM= 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 751671FB; Thu, 29 Feb 2024 01:11:59 -0800 (PST) Received: from [10.34.100.133] (e126645.nice.arm.com [10.34.100.133]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DC563F6C4; Thu, 29 Feb 2024 01:11:18 -0800 (PST) Message-ID: <26af2033-c5e0-43a1-8953-35435ffbbdd0@arm.com> Date: Thu, 29 Feb 2024 10:11:09 +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: [PATCH v2 1/2] sched/fair: Add EAS checks before updating overutilized To: Shrikanth Hegde Cc: yu.c.chen@intel.com, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, nysal@linux.ibm.com, aboorvad@linux.ibm.com, srikar@linux.vnet.ibm.com, vschneid@redhat.com, morten.rasmussen@arm.com, qyousef@layalina.io, mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org References: <20240228071621.602596-1-sshegde@linux.ibm.com> <20240228071621.602596-2-sshegde@linux.ibm.com> <86f000a3-3068-4c57-858d-c00e3eb6e974@arm.com> <72c2d279-90ae-4612-9b96-e579333b8088@linux.ibm.com> Content-Language: en-US From: Pierre Gondois In-Reply-To: <72c2d279-90ae-4612-9b96-e579333b8088@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hello Shrikanth, On 2/28/24 18:24, Shrikanth Hegde wrote: > > > On 2/28/24 9:28 PM, Pierre Gondois wrote: > > Hi Pierre, Thanks for taking a look. > >> It is nice to avoid calling effective_cpu_util() through the following >> when EAS is not enabled: >> I think we are avoiding calling cpu_overutilized except in update_sg_lb_stats. > I didnt want to put a EAS check in cpu_overutilized as it could be useful > function in non-EAS cases in future. calling cpu_overutilized alone doesnt > do any access to root_domain's overutilized field. So we are okay w.r.t to > cache issues. > But we will do some extra computation currently and then not use it if it > Non-EAS case in update_sg_lb_stats > > Would something like this makes sense? > @@ -9925,7 +9925,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, > if (nr_running > 1) > *sg_status |= SG_OVERLOAD; > > - if (cpu_overutilized(i)) > + if (sched_energy_enabled() && cpu_overutilized(i)) > *sg_status |= SG_OVERUTILIZED; > Yes right. I think that what Dietmar suggested is also a good idea which could be used instead. > > > > I didnt find how would util_fits_cpu ends up calling effective_cpu_util. > Could you please elaborate? Sorry I meant this path: cpu_overutilized() \-cpu_util_cfs() \-cpu_util() effective_cpu_util() is effectively not involved. > >> cpu_overutilized() >> \-util_fits_cpu() >>   \- ... >>     \-effective_cpu_util() >> [snip] Regards, Pierre