From patchwork Wed Dec 10 19:03:08 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Detsch X-Patchwork-Id: 13289 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 4EDC6DDEFA for ; Thu, 11 Dec 2008 06:11:58 +1100 (EST) X-Original-To: cbe-oss-dev@ozlabs.org Delivered-To: cbe-oss-dev@ozlabs.org Received: from igw1.br.ibm.com (igw1.br.ibm.com [32.104.18.24]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id C8C8D474F9 for ; Thu, 11 Dec 2008 06:03:40 +1100 (EST) Received: from d24relay01.br.ibm.com (unknown [9.8.31.16]) by igw1.br.ibm.com (Postfix) with ESMTP id 7556732C371 for ; Wed, 10 Dec 2008 16:59:12 -0200 (BRDT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBAK2iOQ3596462 for ; Wed, 10 Dec 2008 17:02:44 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBAJ3ArP021756 for ; Wed, 10 Dec 2008 17:03:10 -0200 Received: from [9.8.13.23] ([9.8.13.23]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id mBAJ38vv021705 for ; Wed, 10 Dec 2008 17:03:09 -0200 Date: Wed, 10 Dec 2008 17:03:08 -0200 From: adetsch@br.ibm.com Message-Id: <200812101903.mBAJ38vv021705@d24av02.br.ibm.com> To: cbe-oss-dev@ozlabs.org Subject: [Cbe-oss-dev] (no subject) X-BeenThere: cbe-oss-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Discussion about Open Source Software for the Cell Broadband Engine List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: cbe-oss-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org From 0a46b71f2caa52cfd2e6184112cb77deddbbb8bf Mon Sep 17 00:00:00 2001 In-Reply-To: <200812101654.05091.adetsch@br.ibm.com> References: <200812101654.05091.adetsch@br.ibm.com> From: Andre Detsch Date: Wed, 10 Dec 2008 16:03:08 -0300 Subject: [PATCH 06/18] powerpc/spufs: Time slice lazily loaded contexts. MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200812101703.08583.adetsch@br.ibm.com> All SPUs are stopped. All contexts are either executing library code or they have major faulted in spu_run. Signed-off-by: Luke Browning Signed-off-by: Andre Detsch --- arch/powerpc/platforms/cell/spufs/sched.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) if (spu_prio->nr_waiting) { diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 3c83bd3..acd584e 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -1244,9 +1244,13 @@ static noinline int spusched_tick(struct spu_gang *gang, goto out; /* - * If nrunnable is zero, then all of the contexts are in user mode. + * If nrunnable is zero, then all of the contexts are in user mode + * and by definition nfaulting is equal to zero. Otherwise if they + * are equal, all of the contexts in spu_run have faulted. In both + * cases, all spus are stopped and we should yield assuming there + * is another gang on the runqueue. */ - yield = !atomic_read(&gang->nrunnable); + yield = atomic_read(&gang->nrunnable) == atomic_read(&gang->nfaulting); if (yield || ((ctx->policy != SCHED_FIFO) && (!--ctx->time_slice))) {