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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC2DBE6FE41 for ; Fri, 22 Sep 2023 15:03:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbjIVPDw (ORCPT ); Fri, 22 Sep 2023 11:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232046AbjIVPDu (ORCPT ); Fri, 22 Sep 2023 11:03:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id DCF7DC6 for ; Fri, 22 Sep 2023 08:03:43 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CF4CDDA7; Fri, 22 Sep 2023 08:04:20 -0700 (PDT) Received: from [10.34.100.121] (e126645.nice.arm.com [10.34.100.121]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 49BD13F5A1; Fri, 22 Sep 2023 08:03:42 -0700 (PDT) Message-ID: <2a3c2cf0-44e3-befd-c7b5-d3c1fafbf2cd@arm.com> Date: Fri, 22 Sep 2023 17:03:37 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] sched/fair: Skip cpus with no sched domain attached during NOHZ idle balance Content-Language: en-US To: "Zhang, Rui" , "Lu, Aaron" Cc: "tj@kernel.org" , "dietmar.eggemann@arm.com" , "peterz@infradead.org" , "linux-kernel@vger.kernel.org" , "vincent.guittot@linaro.org" , "longman@redhat.com" , "mingo@redhat.com" , "Pandruvada, Srinivas" References: <20230804090858.7605-1-rui.zhang@intel.com> <20230814031432.GA574314@ziqianlu-dell> <20230911114218.GA334545@ziqianlu-dell> <0d1c440becca151db3f3b05b3fb2c63fe69c2904.camel@intel.com> <0a0ff05cd1ef629cfa0a4c9392f499459fe814e7.camel@intel.com> From: Pierre Gondois In-Reply-To: <0a0ff05cd1ef629cfa0a4c9392f499459fe814e7.camel@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rui, On 9/20/23 09:24, Zhang, Rui wrote: > Hi, Pierre, > > Sorry for the late response. I'm still ramping up on the related code. No worries, I also need to read the code, > > On Thu, 2023-09-14 at 16:53 +0200, Pierre Gondois wrote: >> >> >> On 9/14/23 11:23, Zhang, Rui wrote: >>> Hi, Pierre, >>> >>>> >>>> Yes right indeed, >>>> This happens when putting a CPU offline (as you mentioned >>>> earlier, >>>> putting a CPU offline clears the CPU in the idle_cpus_mask). >>>> >>>> The load balancing related variables >>> >>> including? >> >> I meant the nohz idle variables in the load balancing, so I was >> referring to: >> (struct sched_domain_shared).nr_busy_cpus >> (struct sched_domain).nohz_idle >> nohz.idle_cpus_mask >> nohz.nr_cpus >> (struct rq).nohz_tick_stopped > > IMO, the problem is that, for an isolated CPU, > 1. it is not an idle cpu (nohz.idle_cpus_mask should be cleared) > 2. it is not a busy cpu (sds->nr_busy_cpus should be decreased) > > But current code does not have a third state to describe this, so we > need to either > 1. add extra logic, like on_null_domain() checks I m not sure I understand, do you mean adding on_null_domain() in addition to the one in the present patch ? > or > 2. rely on current logic, but update all related variables correctly, > like you proposed. > > But in any case, we should stick with one direction. > > If we follow the first one, the original patch should be used, which > IMO is simple and straight forward. > If we follow the later one, we'd better audit and remove the current > on_null_domain() usage at the same time. TBH, I'm not confident enough Here aswell, I'm not sure I understand whether you are referring to the on_null_domain() call in the present patch or to the on_null_domain() calls in fair.c ? Regards, Pierre > to make such a change. But if you want to propose something, I'd glad > to test it. > > thanks, > rui >