From 9d78592ed72dbff1d8825207f8def07858a49768 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 25 Jul 2007 21:31:09 +1000 Subject: [POWERPC] spusched: Fix initial timeslice calculation Currently we calculate the first timeslice for every context incorrectly - alloc_spu_context calls spu_set_timeslice before we set ctx->prio so we always calculate the longest possible timeslice for the lowest possible priority. This patch makes sure to update the schedule-related fields before calculating the timeslice and also makes sure we update the timeslice for a non-running context when entering spu_run so a priority change affects the context as soon as possible. Signed-off-by: Christoph Hellwig Signed-off-by: Jeremy Kerr Signed-off-by: Paul Mackerras --- arch/powerpc/platforms/cell/spufs/context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'arch/powerpc/platforms/cell/spufs/context.c') diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 6694f86d700..9cb081c26e7 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c @@ -59,7 +59,8 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) INIT_LIST_HEAD(&ctx->aff_list); if (gang) spu_gang_add_ctx(gang, ctx); - ctx->cpus_allowed = current->cpus_allowed; + + __spu_update_sched_info(ctx); spu_set_timeslice(ctx); ctx->stats.util_state = SPU_UTIL_IDLE_LOADED; -- cgit v1.2.3-18-g5258