Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761497AbXKIL7i (ORCPT ); Fri, 9 Nov 2007 06:59:38 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752129AbXKIL7b (ORCPT ); Fri, 9 Nov 2007 06:59:31 -0500 Received: from e2.ny.us.ibm.com ([32.97.182.142]:60353 "EHLO e2.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752169AbXKIL7a (ORCPT ); Fri, 9 Nov 2007 06:59:30 -0500 Date: Fri, 9 Nov 2007 17:41:57 +0530 From: Srivatsa Vaddagiri To: "Dmitry Adamushko" Cc: sukadev@us.ibm.com, balbir@in.ibm.com, Containers , ckrm-tech@lists.sourceforge.net, linux-kernel@vger.kernel.org, dhaval@linux.vnet.ibm.com, "Ingo Molnar" , efault@gmx.de Subject: Re: [BUG]: Crash with CONFIG_FAIR_CGROUP_SCHED=y Message-ID: <20071109121157.GA24630@linux.vnet.ibm.com> Reply-To: vatsa@linux.vnet.ibm.com References: <20071108234805.GA2240@us.ibm.com> <20071109070214.GO3143@linux.vnet.ibm.com> <20071109101437.GA22544@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1492 Lines: 42 On Fri, Nov 09, 2007 at 11:59:15AM +0100, Dmitry Adamushko wrote: > > - The second problem exposed by this test is that task_new_fair() > > assumes that parent and child will be part of the same group (which > > needn't be as this test shows). As a result, cfs_rq->curr can be NULL > > for the child. > > Would it be better, logically-wise, to use is_same_group() instead? > Although, we can't have 2 groups with cfs_rq->curr != NULL on the same > CPU... so if the child belongs to another group, it's cfs_rq->curr is > automatically NULL indeed. Yeah ..I feel safe with an explicit !curr check, perhaps with a comment like below added to explain when curr can be NULL? --- kernel/sched_fair.c | 1 + 1 files changed, 1 insertion(+) Index: current/kernel/sched_fair.c =================================================================== --- current.orig/kernel/sched_fair.c +++ current/kernel/sched_fair.c @@ -1022,6 +1022,7 @@ static void task_new_fair(struct rq *rq, update_curr(cfs_rq); place_entity(cfs_rq, se, 1); + /* 'curr' will be NULL if the child belongs to a different group */ if (sysctl_sched_child_runs_first && this_cpu == task_cpu(p) && curr && curr->vruntime < se->vruntime) { /* -- Regards, vatsa - 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/