From: Nick Piggin <nickpiggin@yahoo.com.au>

Make sched-remove-degenerate-domains.patch actually work.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>

Catch more (hopefully all) cases.

Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 kernel/sched.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -puN kernel/sched.c~sched-remove-degenerate-domains-fix kernel/sched.c
--- 25/kernel/sched.c~sched-remove-degenerate-domains-fix	2005-06-18 02:55:38.000000000 -0700
+++ 25-akpm/kernel/sched.c	2005-06-18 02:55:38.000000000 -0700
@@ -4876,7 +4876,14 @@ static int __devinit sd_parent_degenerat
 	/* WAKE_BALANCE is a subset of WAKE_AFFINE */
 	if (cflags & SD_WAKE_AFFINE)
 		pflags &= ~SD_WAKE_BALANCE;
-	if ((~sd->flags) & parent->flags)
+	/* Flags needing groups don't count if only 1 group in parent */
+	if (parent->groups == parent->groups->next) {
+		pflags &= ~(SD_LOAD_BALANCE |
+				SD_BALANCE_NEWIDLE |
+				SD_BALANCE_FORK |
+				SD_BALANCE_EXEC);
+	}
+	if (~cflags & pflags)
 		return 0;
 
 	return 1;
_