Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp730387ybi; Wed, 19 Jun 2019 06:59:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqww5URMASZY7zUA3WMkFIdHMchVCIKdKHKPT8LQ4YknWvzGVhC7MuRrv+Syhw3P8xbmi0jj X-Received: by 2002:a17:902:b18f:: with SMTP id s15mr122947715plr.44.1560952772738; Wed, 19 Jun 2019 06:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560952772; cv=none; d=google.com; s=arc-20160816; b=rZBCFO0EX9JqEvYSgmbklVfhb4ewg3zNTg9rkHd1kWGuTuARhRAs8XC1kPs0QvaWIV Xz59UnM3tg90P+f9Ju0+tukAhuGMnIPuVC1ko2zamHTEb+sLSelvvMF5ZBmDOSMIZWO4 Q9Vog6W1GzPYbZSjEwghNDd2QnifM5/ARweSbAuzgsI+aL5VZLS4neCkI+BUBHowQIBd 7mxJoqCDT9hA5lXCnHdsm7yPmB7DsRdDxMYqwZRX3OPt6Ur4CmCHPFFesX3qR3DFSJzD eXIv9VK4P9KwWWSra3l2hBFer4XKO0HKChaRym6c0myyoGUUjwv5/ULeLhhSoIu2qPjG SNRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=7LdVyzFd2BzL/qloMDoFo5tl3EfTfPHH6xIZHpEb7F4=; b=BgsC1lPsGKW6BoDPzl9XiLH/F70wxcetZhUdJri/5qzdLtz+lact41o3egwn/pCFqq MQ/V0Xj3o/vBYqtP8s1UadxEeuwKnu6vAr6YT+jK4nWV0hjZpQ4MX1cFB6AGMntgrnjX 2YJ+c9728MQuqBmTN3az1BhyINL28/HOzkHO+JfJtP8UiRwvoshovkA8mzdFFVUTddPI 3n2U2p4nOOWlK91NWi+qLrWpLCtnalYFoErDrV4jtaZpa8elINf3VR+anhzG/gAyuagk 42fkS1W9DI7zHBwcZXw09ZWihjDB4/SkJg9awg9dThIwMDdZxsMvlltcH8xg7yZCaSCY qniQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s201si3077214pgs.522.2019.06.19.06.59.14; Wed, 19 Jun 2019 06:59:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729202AbfFSN5W (ORCPT + 99 others); Wed, 19 Jun 2019 09:57:22 -0400 Received: from shelob.surriel.com ([96.67.55.147]:56634 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbfFSN5W (ORCPT ); Wed, 19 Jun 2019 09:57:22 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hdb5P-0001OE-GR; Wed, 19 Jun 2019 09:57:15 -0400 Message-ID: Subject: Re: [PATCH 1/8] sched: introduce task_se_h_load helper From: Rik van Riel To: Dietmar Eggemann , peterz@infradead.org Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, kernel-team@fb.com, morten.rasmussen@arm.com, tglx@linutronix.de, dietmar.eggeman@arm.com, mgorman@techsingularity.com, vincent.guittot@linaro.org Date: Wed, 19 Jun 2019 09:57:14 -0400 In-Reply-To: <55d914d2-fba2-48c0-e7ff-3c7337c8cf8e@arm.com> References: <20190612193227.993-1-riel@surriel.com> <20190612193227.993-2-riel@surriel.com> <55d914d2-fba2-48c0-e7ff-3c7337c8cf8e@arm.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-oEUOPJ5dbVg088eTgini" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-oEUOPJ5dbVg088eTgini Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 2019-06-19 at 14:52 +0200, Dietmar Eggemann wrote: > > @@ -7833,14 +7834,19 @@ static void update_cfs_rq_h_load(struct > > cfs_rq *cfs_rq) > > } > > } > > =20 > > -static unsigned long task_h_load(struct task_struct *p) > > +static unsigned long task_se_h_load(struct sched_entity *se) > > { > > - struct cfs_rq *cfs_rq =3D task_cfs_rq(p); > > + struct cfs_rq *cfs_rq =3D cfs_rq_of(se); > > =20 > > update_cfs_rq_h_load(cfs_rq); > > - return div64_ul(p->se.avg.load_avg * cfs_rq->h_load, > > + return div64_ul(se->avg.load_avg * cfs_rq->h_load, > > cfs_rq_load_avg(cfs_rq) + 1); > > } >=20 > I wonder if this is necessary. I placed a BUG_ON(!entity_is_task(se)) > into task_se_h_load() after I applied the whole patch-set and ran > some > taskgroup related testcases. It didn't hit. >=20 > So why not use task_h_load(task_of(se)) instead? >=20 > [...] That would work, but task_h_load then dereferences task->se to get the se->avg.load_avg value. Going back to task from the se, only to then get the se from the task seems a little unnecessary :) Can you explain why you think task_h_load(task_of(se)) would be better? I think I may be overlooking something. --=20 All Rights Reversed. --=-oEUOPJ5dbVg088eTgini Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl0KPzsACgkQznnekoTE 3oPx1ggAjy93qmakRLrYS2CAJyHGDnZX81xCQXR5YGmPKVmQ85rNmNBNAapP5FHC UgRLZmPB1b8bA3gze3yiWeY/s6LLwvIa+LVXbxnhCnsWxATyRsbPOmtgcf1fpJ9+ rcWSAtCUxIMWUQcxcxHcHIyGdkaMfU0TYg45vB6D02tRuCMv+pRbzYNtEt05GWDH iUlm7OtMlWaII43pad7U74QBsHr+2NCnsGxaf6e+9YL8lLDtxDfN4HJaN3qyomhD Qawcf1ob6itUfqEbZ5HZZdQq2ha4D7cKplwwq88S0cqhN4Ow/rCLHnKkTFPUtfE0 avSSxATac/ldps74Pmd6dXTJY1WUew== =gXED -----END PGP SIGNATURE----- --=-oEUOPJ5dbVg088eTgini--