Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp165695pxj; Thu, 3 Jun 2021 03:44:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwf5Rgb+dAdVrmoKnjxqrfNF0H3pxhXE1W8aawysFFDbMtU6rpxrku8s2EHRfFgSxg0VhvI X-Received: by 2002:a05:6402:1648:: with SMTP id s8mr36249462edx.256.1622717064574; Thu, 03 Jun 2021 03:44:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622717064; cv=none; d=google.com; s=arc-20160816; b=oqlAQ+7nZHIX3c7TdRNA/ylQG4+cqcNO5Pmoc5gPJoB9TzBMQXXO0kRB5O31G7t5/C PjHitEKBEzZ9ttFQ1P9/DFRXh6/xQHO6/Dm4O0MUAED0GawNefd5aF4GwmCUey8uHNJN JTEF7VFjEVc3Nwai7f2m/azFiaopyz43b1bnhWy9VWCM+EKd+RL+sHpvuo29JrRDfqZM a0PO+Bsx/zxRUUDNNDdieyuyFlcAxL9Wgo2AlDwfQJXAbUzy1JgYHS029JHPA/pO2Q9B F2/1t+GEAaBKMNraoBvBDViNavG+Pu1Y1XwYy6EWb0VNWVzOSNyl0vTTfBcQtGwuD3TY prlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=L54wJvxBBd9qxYQBDIl+xvCZx7JZFSyMLk6mzKDIatI=; b=o8hHutFTUoYDL+pqGSy0mG+B3icdX8CLiu2qq8dYv+Lc2mxwo7dafmG+kLv0YnA0DL 6ISyrFg17F0mBwxLJR0LHpCrswl1NmtIPLrTwqZ59dcI0iXb043XMfF1uEmebUvDtHmO v2xaF3pl1uv5V+Saw5OJeYrnlI51mMkHFgfgM1MYq3rbQwyT0qrfU+agI4mwJllXnSJE B2OI7cT8HANq98VVDqiTI81DlG/Ym2UAuy/KKdeC6uXOMrxiFRpejJZLGPOxmUFB8kyL KZ4DYV6Uf++KOPLXvx3FSAOouHxv4OccKFd7FzLHmRdnhJTFQs1uOH4SNEXjEqrked8F dH+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a14si1880871edy.464.2021.06.03.03.44.02; Thu, 03 Jun 2021 03:44:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229950AbhFCKoZ (ORCPT + 99 others); Thu, 3 Jun 2021 06:44:25 -0400 Received: from foss.arm.com ([217.140.110.172]:37850 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbhFCKoY (ORCPT ); Thu, 3 Jun 2021 06:44:24 -0400 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 1C5001063; Thu, 3 Jun 2021 03:42:40 -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 5EEAB3F774; Thu, 3 Jun 2021 03:42:38 -0700 (PDT) Subject: Re: [PATCH] sched/pelt: check that *_avg are null when *_sum are To: Vincent Guittot , mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, linux-kernel@vger.kernel.org Cc: odin@uged.al References: <20210601155328.19487-1-vincent.guittot@linaro.org> From: Dietmar Eggemann Message-ID: <438d95b4-330b-8a4b-a800-bab15db4f170@arm.com> Date: Thu, 3 Jun 2021 12:42:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210601155328.19487-1-vincent.guittot@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/06/2021 17:53, Vincent Guittot wrote: > Check that we never break the rule that pelt's avg values are null if > pelt's sum are. > > Signed-off-by: Vincent Guittot > --- > > This is what I used for patch 20210601085832.12626-1-vincent.guittot@linaro.org > > kernel/sched/fair.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index a2c30e52de76..c17feadeafcc 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -8021,6 +8021,15 @@ static inline bool cfs_rq_is_decayed(struct cfs_rq *cfs_rq) > if (cfs_rq->avg.runnable_sum) > return false; > > + /* > + * _avg must be null when _sum are null because _avg = _sum / divider > + * Make sure that rounding and/or propagation of PELT values never > + * break this. > + */ > + SCHED_WARN_ON(cfs_rq->avg.load_avg || > + cfs_rq->avg.util_avg || > + cfs_rq->avg.runnable_avg); > + > return true; > } Reviewed-by: Dietmar Eggemann