Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751559AbdFIHx1 (ORCPT ); Fri, 9 Jun 2017 03:53:27 -0400 Received: from merlin.infradead.org ([205.233.59.134]:57332 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751515AbdFIHx0 (ORCPT ); Fri, 9 Jun 2017 03:53:26 -0400 Date: Fri, 9 Jun 2017 09:53:16 +0200 From: Peter Zijlstra To: subhra mazumdar Cc: linux-kernel@vger.kernel.org, mingo@kernel.org Subject: Re: [RFC PATCH] sched: select_idle_core should select least utilized core Message-ID: <20170609075316.7xiw2q5hts2g3wzc@hirez.programming.kicks-ass.net> References: <1496949992-629076-1-git-send-email-subhra.mazumdar@oracle.com> <20170608195900.GA8337@worktop.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 17 On Thu, Jun 08, 2017 at 03:06:39PM -0700, subhra mazumdar wrote: > > > On 06/08/2017 12:59 PM, Peter Zijlstra wrote: > > On Thu, Jun 08, 2017 at 03:26:32PM -0400, Subhra Mazumdar wrote: > > > Current select_idle_core tries to find a fully idle core and if it fails > > > select_idle_cpu next returns any idle cpu in the llc domain. This is not optimal > > > for architectures with many (more than 2) hyperthreads in a core. This patch > > > changes select_idle_core to find the core with least number of busy > > > hyperthreads and return an idle cpu in that core. > > Yeah, I think not. That makes select_idle_siblings _vastly_ more > > expensive. > I am not sure if the cost will increase vastly. Firstly I removed the > select_idle_cpu for archs that have SMT. But you still do an unconditional scan of the full cache domain, that alone is too expensive.