Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751646AbdFFQeE (ORCPT ); Tue, 6 Jun 2017 12:34:04 -0400 Received: from merlin.infradead.org ([205.233.59.134]:33916 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751593AbdFFQeC (ORCPT ); Tue, 6 Jun 2017 12:34:02 -0400 Date: Tue, 6 Jun 2017 18:33:53 +0200 From: Peter Zijlstra To: Jeffrey Hugo Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Dietmar Eggemann , Austin Christ , Tyler Baicar , Timur Tabi Subject: Re: [PATCH V4 1/2] sched/fair: Fix load_balance() affinity redo path Message-ID: <20170606163353.twc64yj7n7uazj66@hirez.programming.kicks-ass.net> References: <1496442432-330-1-git-send-email-jhugo@codeaurora.org> <1496442432-330-2-git-send-email-jhugo@codeaurora.org> <20170606123011.aehmelhnakvzjybb@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170606123011.aehmelhnakvzjybb@hirez.programming.kicks-ass.net> 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: 1372 Lines: 41 On Tue, Jun 06, 2017 at 02:30:11PM +0200, Peter Zijlstra wrote: > So with that the problem is that active_load_balance_cpu_stop() calls > into can_migrate_task() with ->idle = CPU_IDLE and !dst_grpmask, which > then goes *bang*. Now active_load_balance_cpu_stop() doesn't need to > re-evaluate anything, so ideally it would just skip this entirely, > right? > > So why not do #3: > > --- > kernel/sched/fair.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 47a0c552c77b..fd639d32fa4c 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -8523,6 +8523,13 @@ static int active_load_balance_cpu_stop(void *data) > .src_cpu = busiest_rq->cpu, > .src_rq = busiest_rq, > .idle = CPU_IDLE, So I realized that setting CPU_NEW_IDLE here does the 'same' thing. Except that would be a 'visible' change in the schedstat output (not sure anybody really cares about that). > + /* > + * can_migrate_task() doesn't need to compute new_dst_cpu > + * for active balancing. Since we have CPU_IDLE, but no > + * @dst_grpmask we need to make that test go away with lying > + * about DST_PINNED. > + */ > + .flags = LBF_DST_PINNED, But given this is trivial and doesn't have any visible side effects, this seems 'better'. > }; > > schedstat_inc(sd->alb_count);