Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756586Ab2FOKEY (ORCPT ); Fri, 15 Jun 2012 06:04:24 -0400 Received: from mx2.parallels.com ([64.131.90.16]:35395 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756216Ab2FOKEX (ORCPT ); Fri, 15 Jun 2012 06:04:23 -0400 Message-ID: <4FDB080F.8050907@parallels.com> Date: Fri, 15 Jun 2012 14:01:51 +0400 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Peter Zijlstra CC: , , , , , Subject: Re: [RFC][PATCH 2/4] sched: Push put_prev_task() into pick_next_task() References: <20120614132902.800827488@chello.nl> <20120614133212.690691207@chello.nl> <4FDB050F.7040503@parallels.com> <1339754590.2559.51.camel@twins> In-Reply-To: <1339754590.2559.51.camel@twins> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1243 Lines: 34 On 06/15/2012 02:03 PM, Peter Zijlstra wrote: > On Fri, 2012-06-15 at 13:49 +0400, Glauber Costa wrote: >> On 06/14/2012 05:29 PM, Peter Zijlstra wrote: >>> +static struct task_struct * >>> +pick_next_task_rt(struct rq *rq, struct task_struct *prev) >>> { >>> - struct task_struct *p = _pick_next_task_rt(rq); >>> + struct task_struct *p; >>> + struct rt_rq *rt_rq =&rq->rt; >>> + >>> + if (!rt_rq->rt_nr_running) >>> + return NULL; >>> + >>> + if (rt_rq_throttled(rt_rq)) >>> + return NULL; >>> + >>> + if (prev) >>> + prev->sched_class->put_prev_task(rq, prev); >>> + >> it might be me, but this one sounds strange. If the responsibility of >> putting the task now lays with pic_next_task, you can't return NULL >> without doing this first. > > Its the responsibility of the sched_class::pick_next_task implementation > that will return the next task. Not of the first one called. > > Clearly this needs a comment.. /me adds. hummmm, yeah, you are right. The comment does make it clearer. -- 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/