]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[POWERPC] spufs: move prio to spu_context
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Feb 2007 20:54:22 +0000 (21:54 +0100)
committerArnd Bergmann <arnd@klappe.arndb.de>
Tue, 13 Feb 2007 20:55:40 +0000 (21:55 +0100)
It doesn't make any sense to have a priority field in the physical spu
structure.  Move it into the spu context instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
arch/powerpc/platforms/cell/spufs/context.c
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/cell/spufs/spufs.h
arch/powerpc/xmon/xmon.c
include/asm-powerpc/spu.h

index f2630dc0db8919f8e28b6e021f2206f78618c1dc..88a8871863039a42f64c7f00abe1dc89b511e1ee 100644 (file)
@@ -53,6 +53,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang)
        ctx->owner = get_task_mm(current);
        if (gang)
                spu_gang_add_ctx(gang, ctx);
+       ctx->prio = current->prio;
        goto out;
 out_free:
        kfree(ctx);
@@ -176,8 +177,7 @@ int spu_acquire_runnable(struct spu_context *ctx)
                ret = spu_activate(ctx, 0);
                if (ret)
                        goto out_unlock;
-       } else
-               ctx->spu->prio = current->prio;
+       }
 
        return 0;
 
index c61a34b1408337e7eeade855789e1f3f1adc5f59..03b357ce39878978e6b65aa1a57b76a3daa62a3c 100644 (file)
@@ -145,7 +145,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx)
        ctx->spu = spu;
        ctx->ops = &spu_hw_ops;
        spu->pid = current->pid;
-       spu->prio = current->prio;
        spu->mm = ctx->owner;
        mm_needs_global_tlbie(spu->mm);
        spu->ibox_callback = spufs_ibox_callback;
@@ -189,7 +188,6 @@ static int spu_unbind_context(struct spu *spu, struct spu_context *ctx)
        spu->dma_callback = NULL;
        spu->mm = NULL;
        spu->pid = 0;
-       spu->prio = MAX_PRIO;
        ctx->ops = &spu_backing_ops;
        ctx->spu = NULL;
        spu->flags = 0;
@@ -223,7 +221,7 @@ static inline void spu_del_wq(wait_queue_head_t * wq, wait_queue_t * wait,
 
 static void spu_prio_wait(struct spu_context *ctx, u64 flags)
 {
-       int prio = current->prio;
+       int prio = ctx->prio;
        wait_queue_head_t *wq = &spu_prio->waitq[prio];
        DEFINE_WAIT(wait);
 
@@ -342,8 +340,6 @@ void spu_yield(struct spu_context *ctx)
                                         __FUNCTION__, spu->number, spu->node);
                                spu_deactivate(ctx);
                                need_yield = 1;
-                       } else {
-                               spu->prio = MAX_PRIO;
                        }
                }
                mutex_unlock(&ctx->state_mutex);
index fa07ec2e2c1a50fefbdec6cd13720d9b16afc1d2..b500e94188b5d3e2ace1332049a56a3036ceef18 100644 (file)
@@ -74,6 +74,9 @@ struct spu_context {
 
        struct list_head gang_list;
        struct spu_gang *gang;
+
+       /* scheduler fields */
+       int prio;
 };
 
 struct spu_gang {
index 77540a2f77040734396570889e6127230d965404..0183e5fbaf46bc7ccb7b159b0035a94c72b23c3c 100644 (file)
@@ -2811,7 +2811,6 @@ static void dump_spu_fields(struct spu *spu)
        DUMP_FIELD(spu, "0x%lx", irqs[2]);
        DUMP_FIELD(spu, "0x%x", slb_replace);
        DUMP_FIELD(spu, "%d", pid);
-       DUMP_FIELD(spu, "%d", prio);
        DUMP_FIELD(spu, "0x%p", mm);
        DUMP_FIELD(spu, "0x%p", ctx);
        DUMP_FIELD(spu, "0x%p", rq);
index b634e16575f2e5586f9e42ecf22dac4dd987ced5..0f9f2dd24a79a651771796536c7a97340c087ae5 100644 (file)
@@ -129,7 +129,6 @@ struct spu {
        struct spu_runqueue *rq;
        unsigned long long timestamp;
        pid_t pid;
-       int prio;
        int class_0_pending;
        spinlock_t register_lock;