From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756896AbdELNQK (ORCPT ); Fri, 12 May 2017 09:16:10 -0400 Received: from mail-yw0-f193.google.com ([209.85.161.193]:32801 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756117AbdELNQI (ORCPT ); Fri, 12 May 2017 09:16:08 -0400 Date: Fri, 12 May 2017 09:16:04 -0400 From: Tejun Heo To: Vincent Guittot Cc: Ingo Molnar , Peter Zijlstra , linux-kernel , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , kernel-team@fb.com Subject: Re: [PATCH v2 for-4.12-fixes 2/2] sched/fair: Fix O(# total cgroups) in load balance path Message-ID: <20170512131604.GA1161@wtj.duckdns.org> References: <20170509161740.GD8609@htj.duckdns.org> <20170509161854.GE8609@htj.duckdns.org> <20170510144414.GA32165@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.0 (2017-02-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Vincent. On Thu, May 11, 2017 at 09:02:22AM +0200, Vincent Guittot wrote: > Sorry, what i mean is: > When the group entity of a cfs_rq is enqueued, we are sure that either > the parents is already enqueued or it will be enqueued in the same > sequence. We must be sure that no other branch will be enqueued in the > middle of the sequence and will reset tmp_alone_branch. > This is true with current implementation but I wondered it can happen > if we del/add the cfs_rq out of order > > That said i haven't find a use case that break the sequence Hmm... a cfs_rq can be removed from leaf list iff it's empty and dequeued, and enqueueing is always from top down. If an ancestor is already enqueued, it's guaranteed to be on the leaf list; otherwise, it's guaranteed to be enqueued beforehand and thus put on the leaf list too. I think it should be fine. Thanks. -- tejun