Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1231748pxj; Fri, 18 Jun 2021 02:32:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKo/kKrQbkyj0ofREc2bS0Qo3xGeT4BRVVenIQsLyWXPwAJrFgl7KckNqxJRkf77VQHJye X-Received: by 2002:a17:906:2dd3:: with SMTP id h19mr602203eji.272.1624008772264; Fri, 18 Jun 2021 02:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624008772; cv=none; d=google.com; s=arc-20160816; b=eOxc1xQSV1pRMQJQPe5MS4/7ij7aNS9x6eL6bSP2aghurxhlZ+/HqcoJMO7oQKihRr EQASIE0hdXV2RvD/0WI6vJZZL6zcjyeijVJF37PgMA+SdIOlE0MPOOvjangS9RLWwl0Y jEm0kuatXK/8izOHEY6YT6wfpcyNrFEow7Lt/3Og9ute/jp8xkgOffxOA6BPJeQVoYVi Gr6pVzPXLKe+g8nsFQ+PAOPPYg3320sltYkWA9wMJ3ZO1SRinRwFxf+r9TRkzmOW3e2x BHQ6rJBKFTBPd0Y4vA48oHE8KsNghPK7aOQldrijutfevF684N1YarfNTz8Xub7JVIta hfPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=k6uPhUqy+eKUapq1oNgY80IMx1sPkSy9lrTqRk3VuGk=; b=k31PS4Ro8gBEHyUM4xobhw95rWUaa6d+1NNJqJMijDT6cTDk95v+Yawp3TJAqIxEQP oXp0fnZmrqOGtcvwl1Rk6JL3e5g0TY+lGDPhdYffYQ4r23LCxu1jxItJUVKc1JZzXqRt 6JeariIncIdxWYEMGrh6ygk96e51J2XV0Xf6BLp/W2jh06OAbsDlqMLfpfwIqLfJbY3h clFIcdk7S4D8OclM8OWbixX5z+0wHTC46yKzCeax1UY6mpvAUPN/zegYVpPvVvaHPwnt VT/00hMq9tnXsEgQk95NBAHWsjZcd/ohPEpAg7kjI+VcRaEsRdYSzBDlUWQrp1hxrY1x 2mmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=w8Cidfny; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e10si8011716edz.393.2021.06.18.02.32.29; Fri, 18 Jun 2021 02:32:52 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=w8Cidfny; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233973AbhFRIsq (ORCPT + 99 others); Fri, 18 Jun 2021 04:48:46 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:54120 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233911AbhFRIsS (ORCPT ); Fri, 18 Jun 2021 04:48:18 -0400 Date: Fri, 18 Jun 2021 08:46:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1624005968; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k6uPhUqy+eKUapq1oNgY80IMx1sPkSy9lrTqRk3VuGk=; b=w8Cidfnys1yKq3uBKMQOoBjoM5NLGcZW8y8o57etEDJa9fPO3WJG89EETK5bg31eZYHEjT geoqWwO7mv4SCukuuoNISyBL9lBJq+aWWSZrTgLXzRO6fC/wGs66r5XLj0Vr7uYf5DI7eR Op85TmXZsbpHAPujs68+tSjczTIs+ZYgjM9wtgEc1llsqb5FTAYQJHeqXE1QMPqloIAdKe Z/NOKPngulyfWm5MlkvubFnjOrDO3sY0+TZfDPxpG0Lh9JoVTXCFXqE9dfKpXcGJYu9w3A jmEMuGpe5wKIKOTMBN9GhVShasrG4b+i4c45EdvfQa41Lg6vfc7fBCCJH3/KQw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1624005968; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k6uPhUqy+eKUapq1oNgY80IMx1sPkSy9lrTqRk3VuGk=; b=7xqdPuB45AynWcp4yTONxBXCGG64R8ShisG43LF8Rqlr9VzwvXcrVm0j1WA2ZiIzpu7XTz lnKP4GjwAmNuDwBg== From: "tip-bot2 for Vincent Guittot" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] sched/pelt: Check that *_avg are null when *_sum are Cc: Vincent Guittot , "Peter Zijlstra (Intel)" , Dietmar Eggemann , Odin Ugedal , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20210601155328.19487-1-vincent.guittot@linaro.org> References: <20210601155328.19487-1-vincent.guittot@linaro.org> MIME-Version: 1.0 Message-ID: <162400596764.19906.16000251209838889232.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 9e077b52d86ac364a295b05c916c7478a16865b2 Gitweb: https://git.kernel.org/tip/9e077b52d86ac364a295b05c916c7478a16865b2 Author: Vincent Guittot AuthorDate: Tue, 01 Jun 2021 17:53:28 +02:00 Committer: Peter Zijlstra CommitterDate: Thu, 17 Jun 2021 14:11:42 +02:00 sched/pelt: Check that *_avg are null when *_sum are Check that we never break the rule that pelt's avg values are null if pelt's sum are. Signed-off-by: Vincent Guittot Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Dietmar Eggemann Acked-by: Odin Ugedal Link: https://lore.kernel.org/r/20210601155328.19487-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 ce625bf..198514d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8026,6 +8026,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; }