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 49420C05027 for ; Fri, 10 Feb 2023 10:09:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231821AbjBJKJL (ORCPT ); Fri, 10 Feb 2023 05:09:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57934 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231584AbjBJKJJ (ORCPT ); Fri, 10 Feb 2023 05:09:09 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BAA134F68 for ; Fri, 10 Feb 2023 02:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=17gnpumNvDg1uLOrdDtUU76XG/ciCpkL2co9kCLrSms=; b=cAmFY7/yTSDJxkKFKu4sBUS4NR N9CYH0kJddJPl7UIEkeR1dBiEZg6PQ455M7fQ1+G4zYwsgS3GGSBGIx9vqanGuiqSnWPqWAcdnq5i fpFoSK9Hz0nmgXCJJDIJIRf81ZSmqT0JuQqfSCti/4DQQsfwlgHIuCBekm9D+QSyKgdeTJG/gpkoc 8zbO6q18Ox7+uwivej9956Ym2X9NO0JaRaUIv5xbNx6Dg5h1mY6XOdXmNKP5zWkg3XkJuSZ7JFwKC +5XrmZkn3nG3MiCTWB43Z7/VMzhy8tnloyXNt65ZCPXXGliXKFbEe196Mio0UNxW5gs4exteYjdQQ krz6oXKA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pQQKl-0030lO-U5; Fri, 10 Feb 2023 10:08:48 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 0376030012F; Fri, 10 Feb 2023 11:08:46 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B5F5520A1CFBA; Fri, 10 Feb 2023 11:08:46 +0100 (CET) Date: Fri, 10 Feb 2023 11:08:46 +0100 From: Peter Zijlstra To: Ricardo Neri Cc: Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Ionela Voinescu , x86@kernel.org, linux-kernel@vger.kernel.org, "Tim C . Chen" Subject: Re: [PATCH v3 06/10] sched/fair: Use the prefer_sibling flag of the current sched domain Message-ID: References: <20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com> <20230207045838.11243-7-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230207045838.11243-7-ricardo.neri-calderon@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 06, 2023 at 08:58:34PM -0800, Ricardo Neri wrote: > SD_PREFER_SIBLING is set from the SMT scheduling domain up to the first > non-NUMA domain (the exception is systems with SD_ASYM_CPUCAPACITY). > > Above the SMT sched domain, all domains have a child. The SD_PREFER_ > SIBLING is honored always regardless of the scheduling domain at which the > load balance takes place. > > There are cases, however, in which the busiest CPU's sched domain has > child but the destination CPU's does not. Consider, for instance a non-SMT > core (or an SMT core with only one online sibling) doing load balance with > an SMT core at the MC level. SD_PREFER_SIBLING will not be honored. We are > left with a fully busy SMT core and an idle non-SMT core. > > Avoid inconsistent behavior. Use the prefer_sibling behavior at the current > scheduling domain, not its child. > > The NUMA sched domain does not have the SD_PREFER_SIBLING flag. Thus, we > will not spread load among NUMA sched groups, as desired. > Like many of the others; I don't much like this. Why not simply detect this asymmetric having of SMT and kill the PREFER_SIBLING flag on the SMT leafs in that case? Specifically, I'm thinking something in the degenerate area where it looks if a given domain has equal depth children or so. Note that this should not be tied to having special hardware, you can create the very same weirdness by just offlining a few SMT siblings and leaving a few on.