Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759944Ab3GZVu2 (ORCPT ); Fri, 26 Jul 2013 17:50:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:53316 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759842Ab3GZVuX (ORCPT ); Fri, 26 Jul 2013 17:50:23 -0400 Date: Fri, 26 Jul 2013 23:50:11 +0200 From: Peter Zijlstra To: Paul Turner Cc: Max Hailperin , LKML , Ingo Molnar Subject: Re: PROBLEM: Persistent unfair sharing of a processor by auto groups in 3.11-rc2 (has twice regressed) Message-ID: <20130726215011.GK27075@twins.programming.kicks-ass.net> References: <9E84D12D-7389-4D9A-803A-91FD704A92FA@gustavus.edu> <20130725112123.GT27075@twins.programming.kicks-ass.net> <228E8D34-E1A9-4D82-B353-F095E473B8D7@gustavus.edu> <20130725164051.GZ27075@twins.programming.kicks-ass.net> <20130725211521.GE18254@gmail.com> <20130726210317.GC20909@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2366 Lines: 64 On Fri, Jul 26, 2013 at 02:24:50PM -0700, Paul Turner wrote: > On Fri, Jul 26, 2013 at 2:03 PM, Peter Zijlstra wrote: > > > > > > OK, so I have the below; however on a second look, Paul, shouldn't that > > update_cfs_shares() call be in entity_tick(), right after calling > > update_cfs_rq_blocked_load(). Because placing it in > > update_cfs_rq_blocked_load() means its now called twice on the > > enqueue/dequeue paths through: > > > > {en,de}queue_entity() > > {en,de}queue_entity_load_avg() > > update_cfs_rq_blocked_load() > > update_cfs_shares() > > Yes, I agree: placing it directly in entity_tick() would be better. OK, how about the below then? > [ In f269ae046 the calls to update_cfs_rq_blocked_load() were amortized > and the separate update in {en,de}queue_entity_load_avg() were > removed. ] Right, I remember/saw that. Did you ever figure out why that regressed; as in should we look to bring some of that back? --- Subject: sched: Ensure update_cfs_shares() is called for parents of continuously-running tasks From: Peter Zijlstra Date: Fri Jul 26 23:48:42 CEST 2013 We typically update a task_group's shares within the dequeue/enqueue path. However, continuously running tasks sharing a CPU are not subject to these updates as they are only put/picked. Unfortunately, when we reverted f269ae046 (in 17bc14b7), we lost the augmenting periodic update that was supposed to account for this; resulting in a potential loss of fairness. To fix this, re-introduce the explicit update in update_cfs_rq_blocked_load() [called via entity_tick()]. Cc: stable@kernel.org Reported-by: Max Hailperin Reviewed-by: Paul Turner Signed-off-by: Peter Zijlstra --- kernel/sched/fair.c | 1 + 1 file changed, 1 insertion(+) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2032,6 +2032,7 @@ entity_tick(struct cfs_rq *cfs_rq, struc */ update_entity_load_avg(curr, 1); update_cfs_rq_blocked_load(cfs_rq, 1); + update_cfs_shares(cfs_rq); #ifdef CONFIG_SCHED_HRTICK /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/