Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp6277681ybi; Wed, 31 Jul 2019 11:25:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJvgTy00Feffu4qeMndsGWyL4PNHeA/Baem9poKJ8tggB8pSKQRwiBamGP5h/cjPiH9fNf X-Received: by 2002:aa7:9afc:: with SMTP id y28mr47960101pfp.252.1564597510798; Wed, 31 Jul 2019 11:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564597510; cv=none; d=google.com; s=arc-20160816; b=y6GM4Em9De7L9TgpsMfO5lDJ5FWSCHODbiuatbSftMxM1fByqY9mtAuqSxV5r2qZBU 0rFZeroAC62bvqFfVeHxBVqiDFOorL9bfdlihA6bVHaZRQ/BjLloArIU6jnwdpKlDiQ2 fvd8jvu8Fw2gw3euyPlFs3kPI5xUJ+erPRFu+TsoTHrNZE5YfPxOvt3UAw52IeSsQIZ2 6iLJKkyG0rvUTsFGIYlxQFuGGidM9QPRlfw75+jkhP8dcx2e+5ktJ1YmDCLovyqZ1OSZ u/zfw/33bbW5VAK1O1SFdvjZ4767764TOmWYJhM7m8SeV/niUV7q7CrPjJtOMTLNy/n5 MupQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=txfSN/fF8f35hHNUzsvRfsLyFj8kxwbIYIzNM7C5IfM=; b=L9vIQahyxL8OO8ehKa/VovHO/sfgAOBIprfwqChXifOST4p6VxK1wG23x7kzepK1mq vJTgO5C/W2SkywD8gjprmnPF1jOjrPXyOfXfSMoch0Z/k6AGgNQ0vJ2dObuo/ghTdjzb pLXScjcGfRWplSH7WRQl94cDzGl+bxNt2YtuRwrsbnYKd5LxJDOGd//Tq83etEQIuPDJ DZu/7vF84FXRjFz2rINYMRxideQH4FWutDq3s8IyTrAHzp4HZiIuHRfpuIY/Z2CXl3Gf /CaOWMJ/M9iMBQLi8f87dlqkhxGnE+iSvvKTqQjHmiR8DcU2KaGfiKfY6YgpWpAmJIb3 RTSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iCJMLk+l; 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 p62si2033493pjp.66.2019.07.31.11.24.55; Wed, 31 Jul 2019 11:25:10 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=iCJMLk+l; 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 S1728482AbfGaPah (ORCPT + 99 others); Wed, 31 Jul 2019 11:30:37 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:33464 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbfGaPag (ORCPT ); Wed, 31 Jul 2019 11:30:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=txfSN/fF8f35hHNUzsvRfsLyFj8kxwbIYIzNM7C5IfM=; b=iCJMLk+l6ZS8Xq44DdqtR0b9cW RfdhxvJrO+2JiQeO/E6CLPfRPZYNhYlDgyHNUot+p69H2HAiSS7HCuC3J17jZSpMKjZlLWC6rYRCy sOsZV0cizqVgP2WfHJREKrFdDgt3rXpelqM8O3vH3L3uydmiujZbsfjqxI1eoHXixzGrTPXu5AQc+ fK4roaoL3u40IxKOrlYi+OMbLMHE81g4wjwwMIhbkAQ34U7GcELbV/0RjfkzuoR8KkeGtkjrUEtW+ 2l6wc53RZzrCwRlP10T7dnbH+9BomDcc2AipFKKojgH5sWnEIkoMcgejtREGGrLu97UsCnL8SZXEy Vur5pOoQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.92 #3 (Red Hat Linux)) id 1hsqYf-0003EQ-Mx; Wed, 31 Jul 2019 15:30:29 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 93ED12029FD58; Wed, 31 Jul 2019 17:30:27 +0200 (CEST) Date: Wed, 31 Jul 2019 17:30:27 +0200 From: Peter Zijlstra To: Rik van Riel Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, pjt@google.com, dietmar.eggemann@arm.com, mingo@redhat.com, morten.rasmussen@arm.com, tglx@linutronix.de, mgorman@techsingularity.net, vincent.guittot@linaro.org Subject: Re: [PATCH 09/14] sched,fair: refactor enqueue/dequeue_entity Message-ID: <20190731153027.GV31381@hirez.programming.kicks-ass.net> References: <20190722173348.9241-1-riel@surriel.com> <20190722173348.9241-10-riel@surriel.com> <20190730093617.GV31398@hirez.programming.kicks-ass.net> <20190731093525.GH31425@hirez.programming.kicks-ass.net> <461f14cafabb7e6f78556f138b6aa619eff12dee.camel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <461f14cafabb7e6f78556f138b6aa619eff12dee.camel@surriel.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 Wed, Jul 31, 2019 at 11:03:01AM -0400, Rik van Riel wrote: > I think I understand the problem you are pointing out, but if > update_load_avg() keeps the load average for the runqueue unchanged > (because that is rate limited to once a jiffy, and has been like that > for a while), why would calc_group_shares() result in a different > value than what it returned the last time? >=20 > What am I overlooking? I'm thinking you're thinking (3): tg->weight * grq->avg.load_avg shares =3D ------------------------------ tg->load_avg Where: tg->load_avg ~=3D \Sum grq->avg.load_avg Which is the straight forward shares calculation, and purely depends on the load averages (which haven't been changed etc..) But what we actually do is (6): tg->weight * grq->avg.load_avg shares =3D --------------------------------------------------------------= ------------- tg->load_avg - grq->avg.load_avg + max(grq->load.weight, grq->av= g.load_avg) And even if tg->load_avg and grq->avg.load_avg haven't changed, grq->load.weight most certainly has.