From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752110AbdEAQMH (ORCPT ); Mon, 1 May 2017 12:12:07 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:45925 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750967AbdEAQME (ORCPT ); Mon, 1 May 2017 12:12:04 -0400 Date: Mon, 1 May 2017 18:11:58 +0200 From: Peter Zijlstra To: Tejun Heo Cc: Ingo Molnar , =?utf-8?B?4oCcbGludXgta2VybmVsQHZnZXIua2VybmVsLm9yZ+KAnQ==?= , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , =?utf-8?B?4oCca2VybmVsLXRlYW1AZmIuY29t4oCd?= Subject: Re: [2/2] sched/fair: Fix O(# total cgroups) in load balance path Message-ID: <20170501161158.tgw3rko72aziygjx@hirez.programming.kicks-ass.net> References: <20170426004039.GA3222@wtj.duckdns.org> <20170426004350.GB3222@wtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170426004350.GB3222@wtj.duckdns.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2017 at 05:43:50PM -0700, Tejun Heo wrote: > @@ -7007,6 +7008,14 @@ static void update_blocked_averages(int > se = cfs_rq->tg->se[cpu]; > if (se && !skip_blocked_update(se)) > update_load_avg(se, 0); > + > + /* > + * There can be a lot of idle CPU cgroups. Don't let fully > + * decayed cfs_rqs linger on the list. > + */ > + if (!cfs_rq->load.weight && !cfs_rq->avg.load_sum && > + !cfs_rq->avg.util_sum && !cfs_rq->runnable_load_sum) > + list_del_leaf_cfs_rq(cfs_rq); > } > rq_unlock_irqrestore(rq, &rf); > } Right this is a 'known' issue and we recently talked about this. I think you got the condition right, we want to wait for all the stuff to be decayed out before taking it off the list. The only 'problem', which Vincent mentioned in that other thread, is that NOHZ idle doesn't guarantee decay -- then again, you don't want to go wake a CPU just to decay this crud either. And if we're idle, the list being long doesn't matter either.