Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5960339ybv; Tue, 18 Feb 2020 07:13:55 -0800 (PST) X-Google-Smtp-Source: APXvYqx0gygUnGQy/N0+Hinw33bkCWMvIgoqAFRuBb4N4DpiWzP6NzInOs1CXilYdCkGHv17Z8YY X-Received: by 2002:aca:53c6:: with SMTP id h189mr1531217oib.11.1582038835844; Tue, 18 Feb 2020 07:13:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582038835; cv=none; d=google.com; s=arc-20160816; b=hcw8VGCwD2B4P7NzJV2ASwUE+29xXAPmU36nZdIIztalqFKXeYKzL8Q2Mh6fUPzl+u 7GppmHJ2bz6WPvz3YqXmu7QKYK03ArvoEpMFKdMoMgO+5/bGhEuE+fSiH9VdEk7yrs+3 qxHbCEx57IcZRPHnc4K61cLTRa9a9dchRX8n97+dnbg4g/17RkMgw7uLPl87mmxqd68R qSnDo3q76+/EKWDuAK0RPcz44tf+Ik/Nwe1ikBP/QlRsxiWJn1EqotRfAQH9ksABLKrz uY56/noiysNCY/56T8JS54IX6pf4eP5BAiSIGC2McOwU9P6rwJLnAH1CeaYTlne3KxUR P40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aeEUpXSl8bZw39UsiswcpF9Du8gqq2lQNBid1Qos2wo=; b=uog4xk15P8PttpNtosCK0jKruzSORb5ii7n7kwF4r0qDCI7Ud6+OXdVjPkuMPd8s7M dlxJkeHqXZuRjklbTreA+zMQQMGkbv4S63b45QqpDDbVjq/c04odWOoKzfv76mPZZZCe fzrTKS4RS4wxg3rRq/fpsiACI7N6hC+AXg3bza0jsLi8XAdPT3A3a6Vuh/wEpEM8YyeT G0GYlt0cA3mrMmVD1a7LSp1J7n09CIZ/DgKRvfKLoVu6It57I1kRWjr/NSm2SQFOmIvM Q+f8Uj08e0am4J9heaPX/rxWSZsVDvPRuz9fGg/WI+HGJqj6uiGR4rdjYC+9jj8Gq7XY Dr/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=XnrUfAJM; 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 m26si1846532otk.305.2020.02.18.07.13.42; Tue, 18 Feb 2020 07:13:55 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=XnrUfAJM; 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 S1726799AbgBRPMi (ORCPT + 99 others); Tue, 18 Feb 2020 10:12:38 -0500 Received: from merlin.infradead.org ([205.233.59.134]:60274 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726719AbgBRPMi (ORCPT ); Tue, 18 Feb 2020 10:12:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aeEUpXSl8bZw39UsiswcpF9Du8gqq2lQNBid1Qos2wo=; b=XnrUfAJMKfIQWynwBL2X8A6J1o AUweg++Ukhc8jLmXhoxq+eP/he+tQ51ooXqjVkPLrjp21UuuSSNsC7AZK2zy2pXRIP1REDUzKR+lA zfpbt7f+aAQFDqxUIog4pLUkAF7yuzXBhfwXMIbzG8UTytEbwSRo4nT3SfuZ5OaDleo7PUKtAHtEr K/3ct1Ol4VRTfVEIDWMLrmlsDfve0oR8XQjSVgjPI1Z1NKAKZzDQ7Hc5tYqJVcP8A3bSnZuiW7R2d BgTucAuYbJkLyZqafKa+LmgTFnj4xKjd+cOxMpmy07g3PZjG5JYFPuujBa/Qg1rN+l44FufzESjT7 BMueKIsA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1j44Xl-0006q0-18; Tue, 18 Feb 2020 15:12:13 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id A3D43300606; Tue, 18 Feb 2020 16:10:19 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 91F862B935591; Tue, 18 Feb 2020 16:12:11 +0100 (CET) Date: Tue, 18 Feb 2020 16:12:11 +0100 From: Peter Zijlstra To: Valentin Schneider Cc: Vincent Guittot , mingo@redhat.com, juri.lelli@redhat.com, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org, pauld@redhat.com, parth@linux.ibm.com, hdanton@sina.com Subject: Re: [PATCH v2 4/5] sched/pelt: Add a new runnable average signal Message-ID: <20200218151211.GE14914@hirez.programming.kicks-ass.net> References: <20200214152729.6059-1-vincent.guittot@linaro.org> <20200214152729.6059-5-vincent.guittot@linaro.org> <5ea96f6e-433e-1520-56dc-a10e9a8e63c7@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ea96f6e-433e-1520-56dc-a10e9a8e63c7@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 18, 2020 at 02:54:40PM +0000, Valentin Schneider wrote: > Humph, that's an exact copy of update_tg_cfs_util(). FWIW the following > eldritch horror compiles... > > +#define DECLARE_UPDATE_TG_CFS_SIGNAL(signal) \ > +static inline void \ > +update_tg_cfs_##signal(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq *gcfs_rq) \ > +{ \ > + long delta = gcfs_rq->avg.signal##_avg - se->avg.signal##_avg; \ > + \ > + /* Nothing to update */ \ > + if (!delta) \ > + return; \ > + \ > + /* \ > + * The relation between sum and avg is: \ > + * \ > + * LOAD_AVG_MAX - 1024 + sa->period_contrib \ > + * \ > + * however, the PELT windows are not aligned between grq and gse. \ > + */ \ > + /* Set new sched_entity's runnable */ \ > + se->avg.signal##_avg = gcfs_rq->avg.signal##_avg; \ > + se->avg.signal##_sum = se->avg.signal##_avg * LOAD_AVG_MAX; \ > + \ > + /* Update parent cfs_rq signal## */ \ > + add_positive(&cfs_rq->avg.signal##_avg, delta); \ > + cfs_rq->avg.signal##_sum = cfs_rq->avg.signal##_avg * LOAD_AVG_MAX; \ > +} \ > > - /* Update parent cfs_rq runnable */ > - add_positive(&cfs_rq->avg.runnable_avg, delta); > - cfs_rq->avg.runnable_sum = cfs_rq->avg.runnable_avg * LOAD_AVG_MAX; > -} > +DECLARE_UPDATE_TG_CFS_SIGNAL(util); > +DECLARE_UPDATE_TG_CFS_SIGNAL(runnable); I'm not sure that's actually better though... :-)