Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753464AbbGBLmb (ORCPT ); Thu, 2 Jul 2015 07:42:31 -0400 Received: from foss.arm.com ([217.140.101.70]:49205 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbbGBLmZ (ORCPT ); Thu, 2 Jul 2015 07:42:25 -0400 Date: Thu, 2 Jul 2015 12:44:55 +0100 From: Morten Rasmussen To: Peter Zijlstra Cc: Yuyang Du , Rabin Vincent , Mike Galbraith , "mingo@redhat.com" , "linux-kernel@vger.kernel.org" , Paul Turner , Ben Segall Subject: Re: [PATCH?] Livelock in pick_next_task_fair() / idle_balance() Message-ID: <20150702114454.GB7598@e105550-lin.cambridge.arm.com> References: <20150630143057.GA31689@axis.com> <1435728995.9397.7.camel@gmail.com> <20150701145551.GA15690@axis.com> <20150701204404.GH25159@twins.programming.kicks-ass.net> <20150701232511.GA5197@intel.com> <20150702105359.GY19282@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150702105359.GY19282@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 Content-Length: 1351 Lines: 30 On Thu, Jul 02, 2015 at 12:53:59PM +0200, Peter Zijlstra wrote: > On Thu, Jul 02, 2015 at 07:25:11AM +0800, Yuyang Du wrote: > > And obviously, the idle balancing livelock SHOULD happen: one CPU pulls > > tasks from the other, makes the other idle, and this iterates... > > > > That being said, it is also obvious to prevent the livelock from happening: > > idle pulling until the source rq's nr_running is 1, becuase otherwise we > > just avoid idleness by making another idleness. > > Well, ideally the imbalance calculation would be so that it would avoid > this from happening in the first place. Its a 'balance' operation, not a > 'steal everything'. > > We want to take work -- as we have none -- but we want to ensure that > afterwards we have equal work, ie we're balanced. Agreed, I think this is the true problem. See my other reply. > > So clearly that all is hosed. Now Morten was looking into simplifying > calculate_imbalance() recently. Yes. I'm held up doing other stuff at the moment, but I think calculate_imbalance() needs some attention and I'm planning on looking at that next. -- 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/