Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752725AbbDBDcN (ORCPT ); Wed, 1 Apr 2015 23:32:13 -0400 Received: from g4t3427.houston.hp.com ([15.201.208.55]:53422 "EHLO g4t3427.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752117AbbDBDcM (ORCPT ); Wed, 1 Apr 2015 23:32:12 -0400 Message-ID: <1427945434.2556.26.camel@j-VirtualBox> Subject: Re: sched: Improve load balancing in the presence of idle CPUs From: Jason Low To: Morten Rasmussen Cc: Preeti U Murthy , "peterz@infradead.org" , "mingo@kernel.org" , Daniel Lezcano , "riel@redhat.com" , "vincent.guittot@linaro.org" , "srikar@linux.vnet.ibm.com" , "pjt@google.com" , "benh@kernel.crashing.org" , "efault@gmx.de" , "linux-kernel@vger.kernel.org" , "iamjoonsoo.kim@lge.com" , "svaidy@linux.vnet.ibm.com" , "tim.c.chen@linux.intel.com" , jason.low2@hp.com Date: Wed, 01 Apr 2015 20:30:34 -0700 In-Reply-To: <20150401170418.GX18994@e105550-lin.cambridge.arm.com> References: <1427741729.5694.24.camel@j-VirtualBox> <551A5CCE.70008@linux.vnet.ibm.com> <1427828056.2492.24.camel@j-VirtualBox> <551B9514.80701@linux.vnet.ibm.com> <20150401170418.GX18994@e105550-lin.cambridge.arm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2549 Lines: 55 On Wed, 2015-04-01 at 18:04 +0100, Morten Rasmussen wrote: > On Wed, Apr 01, 2015 at 07:49:56AM +0100, Preeti U Murthy wrote: > > > > On 04/01/2015 12:24 AM, Jason Low wrote: > > > On Tue, 2015-03-31 at 14:07 +0530, Preeti U Murthy wrote: > > >> Hi Jason, > > >> > > >> On 03/31/2015 12:25 AM, Jason Low wrote: > > >>> Hi Preeti, > > >>> > > >>> I noticed that another commit 4a725627f21d converted the check in > > >>> nohz_kick_needed() from idle_cpu() to rq->idle_balance, causing a > > >>> potentially outdated value to be used if this cpu is able to pull tasks > > >>> using rebalance_domains(), and nohz_kick_needed() directly returning > > >>> false. > > >> > > >> I see that rebalance_domains() will be run at the end of the scheduler > > >> tick interrupt handling. trigger_load_balance() only sets the softirq, > > >> it does not call rebalance_domains() immediately. So the call graph > > >> would be: > > > > > > Oh right, since that only sets the softirq, this wouldn't be the issue, > > > though we would need these changes if we were to incorporate any sort of > > > nohz_kick_needed() logic into the nohz_idle_balance() code path correct? > > > > I am sorry I don't quite get this. Can you please elaborate? > > I think the scenario is that we are in nohz_idle_balance() and decide to > bail out because we have pulled some tasks, but before leaving > nohz_idle_balance() we want to check if more balancing is necessary > using nohz_kick_needed() and potentially kick somebody to continue. > Note that the balance cpu is currently skipped in nohz_idle_balance(), > but if it wasn't the scenario would be possible. This scenario would also be possible if we call rebalance_domains() first again. I'm wondering if adding the nohz_kick_needed(), ect... in nohz_idle_balance() can address the 10 second latency issue while still calling rebalance_domains() first, since it seems more ideal to try balancing on the current awake CPU first, as you also have mentioned > In that case, we can't rely on rq->idle_balance as it would not be > up-to-date. Also, we may even want to use nohz_kick_needed(rq) where rq > != this_rq, in which case we probably also want an updated status. It > seems that rq->idle_balance is only updated at each tick. Yup, that's about what I was describing. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/