Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3163163lqp; Tue, 26 Mar 2024 00:58:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjiKQdZBEezcYx3B3oGn60zLSkUiSQBcnIpzU1wfGUidLjdzenG7goQRIxdKE5G5+TK/26dSenpikIktC4+zR02rnmWkinHGeCVzTeEQ== X-Google-Smtp-Source: AGHT+IEJpJ/hmVmodqgLSYYg4a6N0cc4348XVJQz0EdjdUhPDkQkzdANd0gkA4wRPSiV4CKtwEeC X-Received: by 2002:a17:902:d2c8:b0:1e0:aced:a897 with SMTP id n8-20020a170902d2c800b001e0aceda897mr280019plc.38.1711439927456; Tue, 26 Mar 2024 00:58:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711439927; cv=pass; d=google.com; s=arc-20160816; b=BcfB0zx+TdkUGunkfIGssc8nhJLwYW1ofqeUi85lqdbDLBJNWDCxCE+C1wi1mH9uU6 0m0teocT4/bHnObEN3KIcxYMmjPTyz6EEBDgwmROuK+Q2SpWLdINkxDxjs6HttFeNPfo EZZo8Wxbh3B1Af8uC95CyMZCIrPVjerh3zND56mS7kZ2+bPtUGvP6jdMK4Stac2spfDq QrpeqFfXgmvUR+f7pQJGX+wol6TuqETJlmWMy5KS+9Dl/oSK+d+3dv4OC0iB5Je4OHHt /ZAeQTpcTPZeym2bT8pFr4RWrgk4mS9Mt2Z/5Gs+H0B66YpXxKWW5Kx2wJAM733Jvh9s +vQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:sender:dkim-signature; bh=I7oBJ+VsJSm9DaP+glmzMitdlm9IXiT7OAprSHRUPLU=; fh=gobRHkmLH57caAIbRs7yXW99EM+1VMm1UdTq8qZgnhE=; b=uRH4caXDX4jGn02IP8L1W4PsxlQNnRlOy/I5QE6H+KLF1bsj6g5arS3tHGDhEpPY2v 7SqrrywfvLtWQSDw1TT0xMMJw0jepLHeWSoLUiiZZa/DqVKZoy5N5q3/hBP1OD8RLbwt 8wMpApTpabcdn+SWOAirvzRiCghtc4x35Nxk//KO0qUm6c9p1vpFpxbrCjJN72xsGOz0 QaGrnlyv4dk4qpEoPw7wMEdD+C3H8akZB9rFoTKvM24B8QsEahuAEst5QN2awbx+XxS0 +iZ94tLf5U+FxR9ToR5cmR4v5Y5oT7vfjMob9f/vvghcdXYiJD/JQBDGgTzyZlaoVtHQ 4Cqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Zn/yxDUa"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-118497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q17-20020a170902e31100b001dd8be49c72si233005plc.292.2024.03.26.00.58.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 00:58:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="Zn/yxDUa"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-118497-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118497-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 03C04B21EBF for ; Tue, 26 Mar 2024 07:58:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E497C132C1A; Tue, 26 Mar 2024 07:58:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Zn/yxDUa" Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79AC618C38 for ; Tue, 26 Mar 2024 07:58:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711439915; cv=none; b=QMT8OAiJFr3D88hJBusmta2+OJu2p3D8fmqq1qyr4VEZmOgPYM6/lgXuAmZPhtqhXdMOFVDQHtdXhXeKYMC/+7lu1T4ZV9KApquaBXL1Sgks5oWAGclAWlbB6KS/8Kon9tS4GYMps3PEK6AKngqCQo7hQW3r0guZHMAAGgSFjgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711439915; c=relaxed/simple; bh=PphWuelZfnpwiYVrz8R7ITRKIyFMxy5KrpQlOyfjIPc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=telZ+hVF6p2+5bH0PQf5EUqEgsycH4P3/pLvywed4ql6Wfen4XFHiC4GTMVuyuHtpDjGeItj6giz15uSo46+SnSsUhshT4Zoms+TydsA/6PTSLaql9ePlAWlTMdSc/CTfVLFNzmDDU/Eu2EsWhfiIV7l7AEQqQiFI7R/MYx2Ky8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Zn/yxDUa; arc=none smtp.client-ip=209.85.208.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ed1-f49.google.com with SMTP id 4fb4d7f45d1cf-56845954ffeso7259595a12.2 for ; Tue, 26 Mar 2024 00:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711439912; x=1712044712; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=I7oBJ+VsJSm9DaP+glmzMitdlm9IXiT7OAprSHRUPLU=; b=Zn/yxDUaXGswc2BBQ6rs2Z6A3grENl6stRNWolA9Cn/qgNUTSPX4jn1JZ9zNYZasM3 fSKZIBdKP1LsMooXPORtOONjyog2oAkPw8ywI8M2Te6Z7RKVbkQIF+g1uuZHGRBuv32k i7pYmLcYsyV6C5g16EbiBp66bIXffv8fiaU69BMV15YQl8s+G526xQevVKIPcYiBdHC6 mhpAGBB3eO7QWtwtQuFR7ffalRmvw/z5B/6hpDsvx/ztifc1IBsGALHfZatcEXyLBCmt O2V4DX1bO72q2+ycJ/Tp8bREQz30Y5h3kpffE5lsYBCeNjQikLrWdpWtPPTDagHg7phP f7oA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711439912; x=1712044712; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=I7oBJ+VsJSm9DaP+glmzMitdlm9IXiT7OAprSHRUPLU=; b=ZOrDxE9RQr/5hUmpjgdokaAQnJMahj3KRZc9VzkpBGLVvsOBkt8DFsxNAblQu3FRAT Emo4GAD9cQKBCNZ59NgwGDNu/BnhwK4Qygk8oOxKmabVyuXxFJ1zTOYBUDH53tb76Ops rQtjwdPrR1bR/5HrBjcTHK+B6XcbM82Nr0+VEyoNRcwnKWfOCJO67/2kEDmaECu3gDj2 qaclui5uLehD/A8tOR2h2mC0aFP30bDNBVFJZ7AvhrhIqcTVMy5cvbUY6VZc+yL9Kyr9 JXQfid1F8GfkB0JT6G9hNCIwCr3mKzL1q87A1eXP+wexQtmKXNH5CwuMx4FEpNh70kJe /9NQ== X-Forwarded-Encrypted: i=1; AJvYcCWSuzUzdO3SQWQuPq8PvIDZvthjzAVykkW1iVOWzVU4M4bRKvJ+GpampZe5psMGcBKr5zyMTV5YHoyfNYlLdtBNz+VIa9bHcF1UoqcF X-Gm-Message-State: AOJu0YyjjMyO2QRZcQ63GjHWeh2WAHqrojkxVoD79ZE+r8rkmZKJEWFA +CcUgmbLuVn0T8F4JrKChDcAmb3oUBQPq1MKI3Fvnk9CiwtIZlwq X-Received: by 2002:a17:907:8694:b0:a47:4d61:de44 with SMTP id qa20-20020a170907869400b00a474d61de44mr5549287ejc.55.1711439911184; Tue, 26 Mar 2024 00:58:31 -0700 (PDT) Received: from gmail.com (1F2EF63C.nat.pool.telekom.hu. [31.46.246.60]) by smtp.gmail.com with ESMTPSA id oq25-20020a170906cc9900b00a46c8dbd5e4sm3906226ejb.7.2024.03.26.00.58.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 00:58:30 -0700 (PDT) Sender: Ingo Molnar Date: Tue, 26 Mar 2024 08:58:28 +0100 From: Ingo Molnar To: Shrikanth Hegde Cc: peterz@infradead.org, vincent.guittot@linaro.org, yu.c.chen@intel.com, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, nysal@linux.ibm.com, aboorvad@linux.ibm.com, srikar@linux.ibm.com, vschneid@redhat.com, pierre.gondois@arm.com, qyousef@layalina.io Subject: Re: [PATCH v6 3/3] sched/fair: Combine EAS check with overutilized access Message-ID: References: <20240307085725.444486-1-sshegde@linux.ibm.com> <20240307085725.444486-4-sshegde@linux.ibm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240307085725.444486-4-sshegde@linux.ibm.com> * Shrikanth Hegde wrote: > /* > - * Ensure that caller can do EAS. overutilized value > - * make sense only if EAS is enabled > + * overutilized value make sense only if EAS is enabled > */ > -static inline int is_rd_overutilized(struct root_domain *rd) > +static inline int is_rd_not_overutilized(struct root_domain *rd) > { > - return READ_ONCE(rd->overutilized); > + return sched_energy_enabled() && !READ_ONCE(rd->overutilized); > } While adding the sched_energy_enabled() condition looks OK, the _not prefix This is silly: putting logical operators into functions names is far less readable than a !fn()... > - if (!is_rd_overutilized(rq->rd) && cpu_overutilized(rq->cpu)) > + if (is_rd_not_overutilized(rq->rd) && cpu_overutilized(rq->cpu)) Especially since we already have cpu_overutilized(). It's far more coherent to have the same basic attribute functions and put any negation into *actual* logical operators. Thanks, Ingo