Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4282393ybl; Mon, 9 Dec 2019 08:17:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxhfyyU/HWOfKmeUhLR0qIl/SRuhbTE/1lsItF4gdHpbYCtCjW6FkSkLWqf5RFzfCpC1n9m X-Received: by 2002:aca:cf83:: with SMTP id f125mr23835366oig.15.1575908270982; Mon, 09 Dec 2019 08:17:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575908270; cv=none; d=google.com; s=arc-20160816; b=oSccnS7ZmAF4gdu2XDJsx2JNqrpIiUS/i5XmpR1Af2gSbDWquQAX3+fPUVdsYhpA+U 5p93X616h35pWjO9wZOhv/gQGyymZh/20esp5Gj2k4gZLHyW5WMna/XceLNZwVpgTGjT INUp/95tGNReLwV51ozGXNjBuPgVK+PjFnTC15xoBcHY269007ZEXHg6hGnl6iFMXuNk /lMXXM9ipFc3KXyvfJzBZPWZEbzgPzuFcOeS3gMC5zq9jGACEoeXqFXxvFhhFf1wPZoU LHNLF72A+g5JQLEpLDp37fA4BxVZkRKqCik2ALqaiFgHevr48lmtxgEuky9ogSBdZung nwPw== 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=yTSggCUrDnLDOq0j19tc29s50NlGdHpCrc0hkMGDCws=; b=ANAefJiA03VUYNHQs08diV2VJFMohFg8U0xDYnrcjCmmXpDT9yg/DNlLxZtZ2qqSXh PCzSGxtG21jPyTMIBWQe32Sq0EQz8RMVoQ6IdQ8AOFo4bS4EUGqEY8sgOlB7LXpAnwBa wL/zAHLTSHM44aqRgEv+kU0rYnQ7MTd2m4uqGUpWoLhfRVvM+tkyESnviWV3WtVkkewC LeYt6Ihn/nc+23Lt1Yp3TlGubtk79nyPYCEnlotGWgu7GBRZLm+/PqALPb03B1Cz4/uL fmYyJ0Y59XYfkFLW0YPxLyzEzLvoIf5b6bqCSMfnpC+z1K9c7xbBu0B/tph7eXWt/Tzk Ya3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=oKkKM8vX; 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 y8si106588oih.141.2019.12.09.08.17.39; Mon, 09 Dec 2019 08:17:50 -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=oKkKM8vX; 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 S1726689AbfLIQRC (ORCPT + 99 others); Mon, 9 Dec 2019 11:17:02 -0500 Received: from merlin.infradead.org ([205.233.59.134]:59974 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725904AbfLIQRC (ORCPT ); Mon, 9 Dec 2019 11:17:02 -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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=yTSggCUrDnLDOq0j19tc29s50NlGdHpCrc0hkMGDCws=; b=oKkKM8vX6ltfuE7C/RHqu7s45 2R0H1nP6XZlEUXWu6zUV/lka8GDXccwYSLYAaJ+Xm5Z4iAG21GtfyFXkw2NfuHmzWFkHeYQtnb0k/ KjRBKIjY/BLVVhrv7d5owpPEXe8TZ0Wg0KQRQDWwxIVWBF+T3J1yfN3mObxnnPmXEG4vpox1X5TFN Ly4v6yA2jH9xJ6H1bi3XIizSM1XM8fhCIiiuK/yhAqG4AbrLv7CNWqYgfwP4MDtxgT1ic4SshlbY5 rESHN3OhCjLLALp+9JWgc60UrBAyHS4mFCjGNO9gztcEPk7R5f+r0pWo8waFclQJMjkfqMoRpFi6f WSZIIreKA==; 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 1ieLi3-0003jH-0b; Mon, 09 Dec 2019 16:16:31 +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 7748430025A; Mon, 9 Dec 2019 17:15:08 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 84C8928719325; Mon, 9 Dec 2019 17:16:27 +0100 (CET) Date: Mon, 9 Dec 2019 17:16:27 +0100 From: Peter Zijlstra To: Peng Wang Cc: mingo@redhat.com, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, linux-kernel@vger.kernel.org Subject: Re: [PATCH] schied/fair: Skip updating "contrib" without load Message-ID: <20191209161627.GJ2810@hirez.programming.kicks-ass.net> References: <1575648862-12095-1-git-send-email-rocking@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1575648862-12095-1-git-send-email-rocking@linux.alibaba.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 Sat, Dec 07, 2019 at 12:14:22AM +0800, Peng Wang wrote: > We only update load_sum/runnable_load_sum/util_sum with > decayed old sum when load is clear. What you're saying is that because of the: if (!load) runnable = running = 0; clause in ___update_load_sum(), all the actual users of @contrib in accumulate_sum(): if (load) sa->load_sum += load * contrib; if (runnable) sa->runnable_load_sum += runnable * contrib; if (running) sa->util_sum += contrib << SCHED_CAPACITY_SHIFT; don't happen, and therefore we don't care what @contrib actually is and calculating it is pointless. I suppose that is so. did you happen to have performance numbers? Also, I'm thinking this wants a comment. > Signed-off-by: Peng Wang > --- > kernel/sched/pelt.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/pelt.c b/kernel/sched/pelt.c > index a96db50..4392953 100644 > --- a/kernel/sched/pelt.c > +++ b/kernel/sched/pelt.c > @@ -129,8 +129,9 @@ static u32 __accumulate_pelt_segments(u64 periods, u32 d1, u32 d3) > * Step 2 > */ > delta %= 1024; > - contrib = __accumulate_pelt_segments(periods, > - 1024 - sa->period_contrib, delta); > + if (load) > + contrib = __accumulate_pelt_segments(periods, > + 1024 - sa->period_contrib, delta); > } > sa->period_contrib = delta; > > -- > 1.8.3.1 >