From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43034C433C1 for ; Wed, 24 Mar 2021 16:06:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1365661A09 for ; Wed, 24 Mar 2021 16:06:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236944AbhCXQF6 (ORCPT ); Wed, 24 Mar 2021 12:05:58 -0400 Received: from mga14.intel.com ([192.55.52.115]:39449 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236945AbhCXQFt (ORCPT ); Wed, 24 Mar 2021 12:05:49 -0400 IronPort-SDR: mIXDIwNuNSNww3tqiDEKRXhG9uIWigDVwDQjodkHW802SLVxJoqV/9n9dq/8X8O9MQeNIxNs8W SmSMZXpSQqlw== X-IronPort-AV: E=McAfee;i="6000,8403,9933"; a="190155627" X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="190155627" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 09:05:46 -0700 IronPort-SDR: ihobvkSHEzABqpoTdtN8IMvlv+aBrg0xYM69wLElOD+RCg7CUwlr3wKwgHKKa2aQVtfWuSdjdy FSShduImxACw== X-IronPort-AV: E=Sophos;i="5.81,275,1610438400"; d="scan'208";a="413835847" Received: from schen9-mobl.amr.corp.intel.com ([10.254.92.177]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Mar 2021 09:05:46 -0700 Subject: Re: [PATCH] sched/fair: Rate limit calls to update_blocked_averages() for NOHZ To: Vincent Guittot Cc: Joel Fernandes , linux-kernel , Paul McKenney , Frederic Weisbecker , Dietmar Eggeman , Qais Yousef , Ben Segall , Daniel Bristot de Oliveira , Ingo Molnar , Juri Lelli , Mel Gorman , Peter Zijlstra , Steven Rostedt , "Uladzislau Rezki (Sony)" , Neeraj upadhyay , Aubrey Li References: <20210122154600.1722680-1-joel@joelfernandes.org> <20210129172727.GA30719@vingu-book> <274d8ae5-8f4d-7662-0e04-2fbc92b416fc@linux.intel.com> <20210324134437.GA17675@vingu-book> From: Tim Chen Message-ID: Date: Wed, 24 Mar 2021 09:05:45 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20210324134437.GA17675@vingu-book> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/24/21 6:44 AM, Vincent Guittot wrote: > Hi Tim, > > IIUC your problem, we call update_blocked_averages() but because of: > > if (this_rq->avg_idle < curr_cost + sd->max_newidle_lb_cost) { > update_next_balance(sd, &next_balance); > break; > } > > the for_each_domain loop stops even before running load_balance on the 1st > sched domain level which means that update_blocked_averages() was called > unnecessarily. > That's right > And this is even more true with a small sysctl_sched_migration_cost which allows newly > idle LB for very small this_rq->avg_idle. We could wonder why you set such a low value > for sysctl_sched_migration_cost which is lower than the max_newidle_lb_cost of the > smallest domain but that's probably because of task_hot(). > > if avg_idle is lower than the sd->max_newidle_lb_cost of the 1st sched_domain, we should > skip spin_unlock/lock and for_each_domain() loop entirely > > Maybe something like below: > The patch makes sense. I'll ask our benchmark team to queue this patch for testing. Tim