From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751803AbcEKHYV (ORCPT ); Wed, 11 May 2016 03:24:21 -0400 Received: from mga04.intel.com ([192.55.52.120]:26092 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751611AbcEKHYB (ORCPT ); Wed, 11 May 2016 03:24:01 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,608,1455004800"; d="scan'208";a="950725277" Date: Wed, 11 May 2016 07:42:30 +0800 From: Yuyang Du To: Peter Zijlstra Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, clm@fb.com, matt@codeblueprint.co.uk, mgalbraith@suse.de, tglx@linutronix.de, fweisbec@gmail.com Subject: Re: [RFC][PATCH 5/7] sched: Rewrite select_idle_siblings() Message-ID: <20160510234230.GC4870@intel.com> References: <20160509104807.284575300@infradead.org> <20160509105210.703304637@infradead.org> <20160510210550.GB4870@intel.com> <20160511070029.GE3193@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160511070029.GE3193@twins.programming.kicks-ass.net> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 11, 2016 at 09:00:29AM +0200, Peter Zijlstra wrote: > On Wed, May 11, 2016 at 05:05:50AM +0800, Yuyang Du wrote: > > On Mon, May 09, 2016 at 12:48:12PM +0200, Peter Zijlstra wrote: > > > + i = select_idle_core(p, sd, target); > > > + if ((unsigned)i < nr_cpumask_bits) > > > + return i; > > > + > > > + i = select_idle_cpu(p, sd, target); > > > + if ((unsigned)i < nr_cpumask_bits) > > > + return i; > > > + > > > + i = select_idle_smt(p, sd, target); > > > + if ((unsigned)i < nr_cpumask_bits) > > > + return i; > > > > First, on smt, these three scans have a lot of overlap, > > Limited, we stop doing the idle_core scan the moment we fail to find > one. And on a busy system it is unlikely to come back. > > Which leaves us with the straight idle_cpu scan. Sure, the one time we > fail to find an idle core and fall through we'll scan double, but that > should be rare. Yes, I was sorta well educated about how important finding an idle is ("one stack, game over"), which therefore is sure worth the effort. Looks to me, it is just about how much opportunisic-spinning should be applied here. Great. Do you have any suggestion about doing other part of select_task_rq_fair?