Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758870AbZCSQ4d (ORCPT ); Thu, 19 Mar 2009 12:56:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754030AbZCSQ4X (ORCPT ); Thu, 19 Mar 2009 12:56:23 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:57836 "EHLO e23smtp08.au.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753323AbZCSQ4X (ORCPT ); Thu, 19 Mar 2009 12:56:23 -0400 Date: Thu, 19 Mar 2009 22:27:36 +0530 From: Vaidyanathan Srinivasan To: Gautham R Shenoy Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, Suresh Siddha , Balbir Singh Subject: Re: [PATCH 3 6/6] sched: Fix sd_parent_degenerate for SD_POWERSAVINGS_BALANCE. Message-ID: <20090319165736.GO2990@dirshya.in.ibm.com> Reply-To: svaidy@linux.vnet.ibm.com References: <20090318092054.24787.18730.stgit@sofia.in.ibm.com> <20090318092248.24787.38811.stgit@sofia.in.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20090318092248.24787.38811.stgit@sofia.in.ibm.com> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2204 Lines: 60 * Gautham R Shenoy [2009-03-18 14:52:48]: > Currently a sched_domain having a single group can be prevented from getting > degenerated if it contains a SD_POWERSAVINGS_BALANCE flag. But since it has > only one group, it won't have any scope for performing powersavings balance as > it does not have a sibling group to pull from. > > Apart from not provide any powersavings, it also fails to participate > in normal load-balancing. > > Fix this by allowing such a sched_domain to degenerate and pass on the > responsibility of performing the POWERSAVINGS_BALANCE to it's parent domain. > > Signed-off-by: Gautham R Shenoy > Cc: Vaidyanathan Srinivasan > --- > > kernel/sched.c | 14 ++++++++++++++ > 1 files changed, 14 insertions(+), 0 deletions(-) > > diff --git a/kernel/sched.c b/kernel/sched.c > index 651550c..0e7882a 100644 > --- a/kernel/sched.c > +++ b/kernel/sched.c > @@ -6970,6 +6970,20 @@ sd_parent_degenerate(struct sched_domain *sd, struct sched_domain *parent) > SD_SHARE_PKG_RESOURCES); > if (nr_node_ids == 1) > pflags &= ~SD_SERIALIZE; > + > + /* > + * If the only flag that is preventing us from degenerating > + * a domain with a single group is SD_POWERSAVINGS_BALANCE > + * check if it can be transferred to the new parent, > + * and degenerate this domain. With a single > + * group, it anyway can't contribute to power-aware load > + * balancing. can't contribute to any form of load balancing or power savings. (SD_POWERSAVINGS_BALANCE flags has not being listed in the flags needing more than 1 group) > + */ > + if (pflags & SD_POWERSAVINGS_BALANCE && parent->parent) { > + pflags &= ~SD_POWERSAVINGS_BALANCE; > + parent->parent->flags |= > + sd_power_saving_flags(parent->level); > + } > } > if (~cflags & pflags) > return 0; --Vaidy -- 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/