From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754467AbbHOTvg (ORCPT ); Sat, 15 Aug 2015 15:51:36 -0400 Received: from casper.infradead.org ([85.118.1.10]:44993 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754045AbbHOTv3 (ORCPT ); Sat, 15 Aug 2015 15:51:29 -0400 Date: Sat, 15 Aug 2015 11:15:23 +0200 From: Peter Zijlstra To: Morten Rasmussen Cc: mingo@redhat.com, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, Dietmar Eggemann , yuyang.du@intel.com, mturquette@baylibre.com, rjw@rjwysocki.net, Juri Lelli , sgurrappadi@nvidia.com, pang.xunlei@zte.com.cn, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: Re: [RFCv5 PATCH 34/46] sched: Enable idle balance to pull single task towards cpu with higher capacity Message-ID: <20150815091523.GB10304@worktop.programming.kicks-ass.net> References: <1436293469-25707-1-git-send-email-morten.rasmussen@arm.com> <1436293469-25707-35-git-send-email-morten.rasmussen@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1436293469-25707-35-git-send-email-morten.rasmussen@arm.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 07, 2015 at 07:24:17PM +0100, Morten Rasmussen wrote: > +++ b/kernel/sched/fair.c > @@ -7569,6 +7569,13 @@ static int need_active_balance(struct lb_env *env) > return 1; > } > > + if ((capacity_of(env->src_cpu) < capacity_of(env->dst_cpu)) && > + env->src_rq->cfs.h_nr_running == 1 && > + cpu_overutilized(env->src_cpu) && > + !cpu_overutilized(env->dst_cpu)) { > + return 1; > + } > + > return unlikely(sd->nr_balance_failed > sd->cache_nice_tries+2); > } Doesn't this allow for a nice game of ping-pong? Where if a task runs on CPU X and generates interrupts there, its capacity will lower and we'll migrate it over to CPU Y because that isn't receiving interrupts. Now the task is running on Y, will generate interrupts there, and sees X as a more attractive destination. goto 1