From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756095AbdEDRb5 (ORCPT ); Thu, 4 May 2017 13:31:57 -0400 Received: from mail-yw0-f173.google.com ([209.85.161.173]:36863 "EHLO mail-yw0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755220AbdEDRbq (ORCPT ); Thu, 4 May 2017 13:31:46 -0400 Date: Thu, 4 May 2017 13:31:38 -0400 From: Tejun Heo To: Peter Zijlstra Cc: Ingo Molnar , =?utf-8?B?4oCcbGludXgta2VybmVsQHZnZXIua2VybmVsLm9yZ+KAnQ==?= , Linus Torvalds , Mike Galbraith , Paul Turner , Chris Mason , =?utf-8?B?4oCca2VybmVsLXRlYW1AZmIuY29t4oCd?= Subject: Re: [PATCH 1/2] sched/fair: Use task_groups instead of leaf_cfs_rq_list to walk all cfs_rqs Message-ID: <20170504173138.GA7288@htj.duckdns.org> References: <20170426004039.GA3222@wtj.duckdns.org> <20170504133122.a6qjlj3hlblbjxux@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170504133122.a6qjlj3hlblbjxux@hirez.programming.kicks-ass.net> 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, Peter. On Thu, May 04, 2017 at 03:31:22PM +0200, Peter Zijlstra wrote: > Yes we can hit an (almost) dead cfs_rq, but poking the bandwidth > variables thereof is harmless. > > unthrottle_cfs_rq() also stops doing anything much when it finds the > cfs_rq is empty, which must be the case if we're removing it. Yeah, if you're okay with calling the functions on dead cfs_rq's, just wrapping with rcu_read_lock should be enough. > I don't know Paul's opinion on RCU GPs happening while stop_machine(), > but just in case he feels that's fair game, I did add the > rcu_read_lock() thingies. > > The lockdep assert is mostly documentation, to more easily see > it is indeed held when we get there. > > I left print_cfs_stats using the leaf list, no point in printing stuff > that's empty. > > This way we can avoid taking all RQ locks on cgroup destruction. Looks good to me. Thanks. -- tejun