Received: by 10.223.176.5 with SMTP id f5csp1208878wra; Fri, 2 Feb 2018 13:10:06 -0800 (PST) X-Google-Smtp-Source: AH8x224Ru6H0oPhuC2HtJfTE0opkhX481Q0X1jSwp7r6g96Jjh6Drfez196bK0SoQh2/vNfzdIIK X-Received: by 2002:a17:902:8607:: with SMTP id f7-v6mr36625486plo.273.1517605806254; Fri, 02 Feb 2018 13:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517605806; cv=none; d=google.com; s=arc-20160816; b=0dH66giB0vsOcyAOjsV8snWpdgi8m3xgCOhNYqoq/wjUJ/4F8ykrHcsGkdDUzFqK65 sPp6iIA85WoixcaRDeuGFt5KgPj2jD5LaYfLTsui7AqupCdhmr3BA4jnsZneSqgHzCBE z6/Z+tjyc7lumK/GFXLlznnRfF9C/BT8VsFW1DJW+kE6sfLniBNdDrbUZtFyt05jZNi4 QmGBaYGTCPl+dBxOPzNj9gW0mrZZQVum+M2I1DgHRSuB+V4m4bPE4wNs2KrE0+VfAtFT 7DN5w1Tf+jU5f5cOeAHmK1EFEXtPH87QUfLODwl7mG2S7+zArTAvSwBhJe9JhG3GIbtZ ZPlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=UhkwibcJiKwgx1M7ZzFxwE6B4cAjBcj7JNbJgtZWSdE=; b=P6UR+3VBkMrhaXbulLrrvk5WfJK0qy1mvvbnveDR6hENhKLMydpplANzk6TmM/VZvF 0+EmgRDDIVoJN41O8V68NpjtkqlxWswArEjb0qux1V2X7XDUfMGrZRt+46IR3XYDLgCE uyu8efuSG8OZ8Y4ViAUYj2u1WWBXfmluxozGsLIBPxN3yktb9g8MGI4TfWM9iJpZU2dX LUUm+ZhfK3MtHATyHmy6zRUv67atQc2ZpIu1zJi+wNoJoG0SXzxZDXFUoMF+YnaM1tPr QT1ZKFvZuRQi0JC3S/F9yANPgDoAU1XDNoHbBwyY6m6ovoDEeYaUZuPrwZzax+/lbqpI dvIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ITdnomY4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si2475195pfk.368.2018.02.02.13.09.43; Fri, 02 Feb 2018 13:10:06 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=ITdnomY4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754427AbeBBT7z (ORCPT + 99 others); Fri, 2 Feb 2018 14:59:55 -0500 Received: from merlin.infradead.org ([205.233.59.134]:37188 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754491AbeBBT7t (ORCPT ); Fri, 2 Feb 2018 14:59:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UhkwibcJiKwgx1M7ZzFxwE6B4cAjBcj7JNbJgtZWSdE=; b=ITdnomY44cLtpTKcf+DkXvFjy Iv14Avky10jBwq6pa2aK6hrXaf00afK2cbRPFyJRruwGfas0z1Ee2OyrJ+M8X0cMd8luQ5k1l9/a3 SezMUpTRSfsG+BxcJ12o7+ZlvBme2oGLwYaetCcXIAya+lqPuCykyTJCCXWPnS/veZ5+dSrHkams0 ChATQOg9bef7JJwOHGqVrx8wMWr3d0ecBU4Fb5Ng07/uA4ONXEpALWUEuzGxTiHaP0qvjfMENOgmK 9fhjQYZWrAfUaMuQtIWvDo0DsDX3WWZvXecVm2u5A6Z+IakeCt+pxl5793IwKZDPaa9JoU7Q0wLWF X1gm1M01w==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ehhUu-0003vM-R7; Fri, 02 Feb 2018 19:59:45 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A2B742029F9F9; Fri, 2 Feb 2018 20:59:43 +0100 (CET) Date: Fri, 2 Feb 2018 20:59:43 +0100 From: Peter Zijlstra To: Steven Sistare Cc: subhra mazumdar , linux-kernel@vger.kernel.org, mingo@redhat.com, dhaval.giani@oracle.com Subject: Re: [RESEND RFC PATCH V3] sched: Improve scalability of select_idle_sibling using SMT balance Message-ID: <20180202195943.GR2269@hirez.programming.kicks-ass.net> References: <20180129233102.19018-1-subhra.mazumdar@oracle.com> <20180201123335.GV2249@hirez.programming.kicks-ass.net> <911d42cf-54c7-4776-c13e-7c11f8ebfd31@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <911d42cf-54c7-4776-c13e-7c11f8ebfd31@oracle.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 02, 2018 at 11:53:40AM -0500, Steven Sistare wrote: > On 2/1/2018 7:33 AM, Peter Zijlstra wrote: > > On Mon, Jan 29, 2018 at 03:31:02PM -0800, subhra mazumdar wrote: > >> + rcu_read_lock(); > >> + sd = rcu_dereference(per_cpu(sd_llc, this_cpu)); > >> + if (util) { > >> + for_each_lower_domain(sd) { > >> + if (sd->level == 0) > >> + break; > > > > afaict you really only need this for the core, and here you're assuming > > everything below the LLC is cores. Would it not be much clearer if you > > introduce sd_core. > > > > As is, for_each_lower_domain includes the starting domain, sd->group > > then is the first core group for this cpu. But then you continue to the > > smt domain (on Intel, on other architectures there could be a cluster > > domain in between) and then you bail using that sd->level == 0 hack > > because otherwise things would go *bang*. > > Hi Peter, > > The code here and in smt_balance intentionally visits each level between > the llc and smt, including core-cluster on architectures that define it. > smt_balance thus has the chance to randomly pick a better cluster, > and then within that cluster randomly pick a better core. It makes sense, > as resources are shared within a cluster, and choosing a less loaded cluster > should give better performance. As you suggest in a few other places, > it would be nice to see performance results for this case. We have > SPARC processors with core clusters. > But then you get that atomic crud to contend on the cluster level, which is even worse than it contending on the core level.