From bd9c5849f2fc9ec99c6972ac76465d9115332d1a Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Wed, 25 Jul 2007 21:31:09 +1000 Subject: [PATCH] --- yaml --- r: 63029 b: refs/heads/master c: 9d78592ed72dbff1d8825207f8def07858a49768 h: refs/heads/master i: 63027: 728ea6d01106a647ae7bf6430daabe3a0927a8a6 v: v3 --- [refs] | 2 +- trunk/arch/powerpc/platforms/cell/spufs/context.c | 3 ++- trunk/arch/powerpc/platforms/cell/spufs/run.c | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index be52a8e4195d..1d059079bbc5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6f6a6dc0c8ebdb6514ab6bb58ba4b8739957b342 +refs/heads/master: 9d78592ed72dbff1d8825207f8def07858a49768 diff --git a/trunk/arch/powerpc/platforms/cell/spufs/context.c b/trunk/arch/powerpc/platforms/cell/spufs/context.c index 6694f86d7000..9cb081c26e71 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/context.c +++ b/trunk/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; diff --git a/trunk/arch/powerpc/platforms/cell/spufs/run.c b/trunk/arch/powerpc/platforms/cell/spufs/run.c index 0b50fa5cb39d..6abdd8fe2098 100644 --- a/trunk/arch/powerpc/platforms/cell/spufs/run.c +++ b/trunk/arch/powerpc/platforms/cell/spufs/run.c @@ -312,6 +312,7 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) spu_acquire(ctx); if (ctx->state == SPU_STATE_SAVED) { __spu_update_sched_info(ctx); + spu_set_timeslice(ctx); ret = spu_activate(ctx, 0); if (ret) { @@ -322,6 +323,9 @@ long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *event) /* * We have to update the scheduling priority under active_mutex * to protect against find_victim(). + * + * No need to update the timeslice ASAP, it will get updated + * once the current one has expired. */ spu_update_sched_info(ctx); }