Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp330906rdb; Tue, 31 Oct 2023 08:39:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF1Ys5MIYf5lDPKj691DgCMfWgTallck9sS0IoITRGxz5piY42BMfhRobXQz15nQglqJni/ X-Received: by 2002:a05:6a20:729e:b0:15e:bb88:b771 with SMTP id o30-20020a056a20729e00b0015ebb88b771mr11969421pzk.37.1698766799572; Tue, 31 Oct 2023 08:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698766799; cv=none; d=google.com; s=arc-20160816; b=X3mIXsiJC41Y2WKlgZbJu2ttLbkznay9ga1niyg+8rzre3WJbgkoxUPLo8aqlkh4eK jcgVsqeZwNEUjGq5RLYLbWUkUnyKTs421m5kweZpayHGqqU5pDbDUTkhoAy4Q+rNYRZf GiDCAGH02Zj0+y1O7Wzb7Ne/24Z92n1h48gWiDKBN2ncCCxbP42lg4zdoAXWviMYybZx 5qPP3rlqA728Spib4Iioxw1pxuqrC8qgRWbpHNpZW4T/WmtOt++wft5oqBnGCzhb6CgM KvM7rmCjCVVwJ3cUkmu9s2ypoAdbbusR4N5PxEBezA201X3/71ZAmfSlZVWYjP5vf0sE iAYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=a/0oBLdEuvVG+FY65ee8Xo2Hssx33voepgZJiF3Skt4=; fh=GIDGiU33YGlprRS3TpcqJWW5qIib95T3V/fun85IS28=; b=Y4EE+/Vz6Iq71DNBCobDGLeUZrkQbKQWqAbH0PL6fIeuVuAQ3EaakxHF6qJ+TDAe+z WGZ7cHfI2z7cKQwIm7Uu/NxiAI1PkqJ43oFXw9rlTUCKZvZ5WJc1TjroMPRVpkOLOD5P QhY8MB3LaqnuMOZet8W17XhoBs3e4TXDH73eXtqG4DJVgYGUODGqymZYw+y1ey9YZpBI MP/tk17CeT5QL9bzJbD9kjQNhJwst/KGkptLBcbfyoBnx4g5ZOCl1vFs3bm2GmM2jHsK tJUB3mE5oyX7O596CnuSV9nnu4w1GACoefr8p0qwLbf9HiR56vz7VfIppbcz7qfpUFQi sVCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Etdtygmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id t71-20020a63814a000000b005ab45ee3e7esi1159990pgd.299.2023.10.31.08.39.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 31 Oct 2023 08:39:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=Etdtygmj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id BE19E804C668; Tue, 31 Oct 2023 08:39:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345067AbjJaPju (ORCPT + 99 others); Tue, 31 Oct 2023 11:39:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345023AbjJaPjt (ORCPT ); Tue, 31 Oct 2023 11:39:49 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1CBC1 for ; Tue, 31 Oct 2023 08:39:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=a/0oBLdEuvVG+FY65ee8Xo2Hssx33voepgZJiF3Skt4=; b=EtdtygmjGEf4PO7K9+svL2TCqy gmvbbtXlKH2DhmUD7B015ZFV+Bj8RQBzgV04CBw2s5zd9igOAZ7ckwO0cLO2uoDA7xI7fxvakquDa w9z31yG1MHck9yuS6vtkLeXY8rBTIPPq53TmrEusYvbiqfnEVAkXsMFwwZey8DWIW7bV3GFOgNxLM jP1WoorQ71rMdDmc+qMcxr6YzrASiRtv+UReFpXm8Tvt4hQGOiawaEMiihx88FxumSHw/YMz4lhPo qx6BT/k37nhmQ8JJaYfhINNPXZtuW0KwGHNOEmQMfTB7sDSLr18kUSl728bpTMvHol/r8oyCRmscb 6KK/BAxg==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qxqq0-004u1s-3C; Tue, 31 Oct 2023 15:39:29 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A00CE300473; Tue, 31 Oct 2023 16:39:28 +0100 (CET) Date: Tue, 31 Oct 2023 16:39:28 +0100 From: Peter Zijlstra To: Keisuke Nishimura Cc: Ingo Molnar , Vincent Guittot , linux-kernel@vger.kernel.org, Chen Yu , Shrikanth Hegde , Dietmar Eggemann , Mel Gorman , Valentin Schneider , Julia Lawall Subject: Re: [PATCH v3] sched/fair: Fix the decision for load balance Message-ID: <20231031153928.GD15024@noisy.programming.kicks-ass.net> References: <20231031133821.1570861-1-keisuke.nishimura@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231031133821.1570861-1-keisuke.nishimura@inria.fr> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Tue, 31 Oct 2023 08:39:56 -0700 (PDT) On Tue, Oct 31, 2023 at 02:38:22PM +0100, Keisuke Nishimura wrote: > should_we_balance is called for the decision to do load-balancing. > When sched ticks invoke this function, only one CPU should return > true. However, in the current code, two CPUs can return true. The > following situation, where b means busy and i means idle, is an > example, because CPU 0 and CPU 2 return true. > > [0, 1] [2, 3] > b b i b > > This fix checks if there exists an idle CPU with busy sibling(s) > after looking for a CPU on an idle core. If some idle CPUs with busy > siblings are found, just the first one should do load-balancing. > > Fixes: b1bfeab9b002 ("sched/fair: Consider the idle state of the whole core for load balance") > Signed-off-by: Keisuke Nishimura > Reviewed-by: Chen Yu > Reviewed-by: Shrikanth Hegde > Reviewed-by: Vincent Guittot I'll sit on this until after the merge window, but then I'll queue it for sched/urgent. Thanks!