Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756123Ab3HLLB0 (ORCPT ); Mon, 12 Aug 2013 07:01:26 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:39269 "EHLO e35.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754817Ab3HLLBX (ORCPT ); Mon, 12 Aug 2013 07:01:23 -0400 Date: Mon, 12 Aug 2013 16:30:45 +0530 From: Srikar Dronamraju To: Jason Low Cc: Ingo Molnar , Peter Zijlstra , LKML , Linus Torvalds , Mike Galbraith , Thomas Gleixner , Paul Turner , Alex Shi , Preeti U Murthy , Vincent Guittot , Morten Rasmussen , Namhyung Kim , Andrew Morton , Kees Cook , Mel Gorman , Rik van Riel , aswin@hp.com, scott.norton@hp.com, chegu_vinod@hp.com, "Bui, Tuan" , Waiman Long , "Makphaibulchoke, Thavatchai" , "Bueso, Davidlohr" Subject: Re: [PATCH] sched: Give idle_balance() a break when it does not move tasks. Message-ID: <20130812110045.GA1925@linux.vnet.ibm.com> Reply-To: Srikar Dronamraju References: <1376296970.1795.9.camel@j-VirtualBox> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1376296970.1795.9.camel@j-VirtualBox> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13081211-4834-0000-0000-00000A12A098 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1209 Lines: 34 > /* > @@ -5298,6 +5300,8 @@ void idle_balance(int this_cpu, struct rq *this_rq) > continue; > > if (sd->flags & SD_BALANCE_NEWIDLE) { > + load_balance_attempted = true; > + > /* If we've pulled tasks over stop searching: */ > pulled_task = load_balance(this_cpu, this_rq, > sd, CPU_NEWLY_IDLE, &balance); > @@ -5322,6 +5326,10 @@ void idle_balance(int this_cpu, struct rq *this_rq) > */ > this_rq->next_balance = next_balance; > } > + > + /* Give idle balance on this CPU a break when it isn't moving tasks */ > + if (load_balance_attempted && !pulled_task) > + this_rq->next_newidle_balance = jiffies + (HZ / 100); > } Looks reasonable. However should we do this per sd and not per rq. i.e move the next_newidle_balance to sched_domain. So if we find a load_balance in newly_idle context that wasn't successful, we skip load_balance for that sd in the next newly idle balance. -- Thanks and Regards Srikar Dronamraju -- 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/