Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp525163pxb; Wed, 3 Feb 2021 10:45:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv/PAD6xyMiSxK3VkFOy/1+npWORRF5s67uo1Rmk0aJvWiwsBuHz4I/uVTT7IEAifbtXM8 X-Received: by 2002:a05:6402:215:: with SMTP id t21mr4491051edv.363.1612377909047; Wed, 03 Feb 2021 10:45:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612377909; cv=none; d=google.com; s=arc-20160816; b=euN0RnSqF6+F0toicmXItxfixtWInFubY3I07V+CZuuNvU+fn08D6kF/cBIonOmTjH 8J4bbFiLRTC3WuI1s+nH19MTgJendAqBszoFSfqth/DybKMr8YcgzkXh9YsGxJW6I+jD M0qOtCuGx+sGwTfwnw9HjUbIpPZE4zqTLLcGAOh9Xti7EJdmbiwDB2aYfcZeYtikcwYr ksU4D66F0Rjl2vVxQ5GI7nBUgVXEVQwcqedUEQYEco2/7awFSBHKNzwsVh7Zk8piVZBu Q74abC5GaFnH/VCMYPzlnjAl/XaNtzD4p0BU/ibpUL4ebqOdD4SB0oVph0/XVGOkfW9J V42A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:user-agent :references:in-reply-to:subject:cc:to:from; bh=Y6VQWvBNocWyMOI9KRlgKsLmvy1HocXoBzv4SkNscMY=; b=X1qJk7ANQdOWOyRjCfGzDbFstD8NqLwjorGLUbx+s2JffOREquzos6GCfH/ESeb7cN MdgfGNoiu7y/9E1ZvSzc+B12F48ZC2Otm+iAu40EYpdPwAKPrSsRY+oFe3MYPXpyjOWH SndNhDK0bHVPnEItpznV1OAJbJFBOnTDHJMPupUDGJ8d+SuW7oZccPobCNSuA8KN/+4a j07LDCFzXdmj/9hwvHOVKvVv5TCODW/CGWrG+9VSkcXyHEn0EyD+D5xPxLm6gnVj1o6f l4K0SEuv4olLg6zl4pdGbiEXgDXXWzHtKaTwOfxLNgbTRndQjB1rE/hvUZuY8uthbET9 VD5A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mh24si1679596ejb.282.2021.02.03.10.44.40; Wed, 03 Feb 2021 10:45:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233026AbhBCSnw (ORCPT + 99 others); Wed, 3 Feb 2021 13:43:52 -0500 Received: from foss.arm.com ([217.140.110.172]:45018 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232927AbhBCSnl (ORCPT ); Wed, 3 Feb 2021 13:43:41 -0500 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 B5970D6E; Wed, 3 Feb 2021 10:42:55 -0800 (PST) Received: from e113632-lin (e113632-lin.cambridge.arm.com [10.1.194.46]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 627CB3F719; Wed, 3 Feb 2021 10:42:54 -0800 (PST) From: Valentin Schneider To: Qais Yousef Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Ingo Molnar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Quentin Perret , Pavan Kondeti , Rik van Riel Subject: Re: [PATCH 1/8] sched/fair: Clean up active balance nr_balance_failed trickery In-Reply-To: <20210203151429.rnbdgt7wyoaz2vui@e107158-lin> References: <20210128183141.28097-1-valentin.schneider@arm.com> <20210128183141.28097-2-valentin.schneider@arm.com> <20210203151429.rnbdgt7wyoaz2vui@e107158-lin> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Wed, 03 Feb 2021 18:42:48 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> @@ -9805,9 +9810,6 @@ static int load_balance(int this_cpu, struct rq *this_rq, >> active_load_balance_cpu_stop, busiest, >> &busiest->active_balance_work); >> } >> - >> - /* We've kicked active balancing, force task migration. */ >> - sd->nr_balance_failed = sd->cache_nice_tries+1; > > This has an impact on future calls to need_active_balance() too, no? We enter > this path because need_active_balance() returned true; one of the conditions it > checks for is > > return unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2); > > So since we used to reset nr_balanced_failed to cache_nice_tries+1, the above > condition would be false in the next call or two IIUC. But since we remove > that, we could end up here again soon. > > Was this intentional? > Partially, I'd say :-) If you look at active_load_balance_cpu_stop(), it does sd->nr_balance_failed = 0; when it successfully pulls a task. So we get a reset of the failed counter on pull, which I've preserved. As for interactions with later need_active_balance(), the commit that introduced the current counter write (which is over 15 years old!): 3950745131e2 ("[PATCH] sched: fix SMT scheduling problems") only states the task_hot() issue; thus I'm doubtful whether said interaction was intentional.