diff options
author | Christoph Hellwig <hch@lst.de> | 2007-02-13 15:54:22 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-02-13 15:55:40 -0500 |
commit | 8389998ae9ea2888c86c446f7911ddced50052a1 (patch) | |
tree | db92e84e16513497344b9bd42b151934cfd881c3 | |
parent | 6a0641e51011def4e308fd07387047f5ee50647f (diff) |
[POWERPC] spufs: move prio to spu_context
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>
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/context.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 3 | ||||
-rw-r--r-- | arch/powerpc/xmon/xmon.c | 1 | ||||
-rw-r--r-- | include/asm-powerpc/spu.h | 1 |
5 files changed, 6 insertions, 9 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index f2630dc0db89..88a887186303 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c | |||
@@ -53,6 +53,7 @@ struct spu_context *alloc_spu_context(struct spu_gang *gang) | |||
53 | ctx->owner = get_task_mm(current); | 53 | ctx->owner = get_task_mm(current); |
54 | if (gang) | 54 | if (gang) |
55 | spu_gang_add_ctx(gang, ctx); | 55 | spu_gang_add_ctx(gang, ctx); |
56 | ctx->prio = current->prio; | ||
56 | goto out; | 57 | goto out; |
57 | out_free: | 58 | out_free: |
58 | kfree(ctx); | 59 | kfree(ctx); |
@@ -176,8 +177,7 @@ int spu_acquire_runnable(struct spu_context *ctx) | |||
176 | ret = spu_activate(ctx, 0); | 177 | ret = spu_activate(ctx, 0); |
177 | if (ret) | 178 | if (ret) |
178 | goto out_unlock; | 179 | goto out_unlock; |
179 | } else | 180 | } |
180 | ctx->spu->prio = current->prio; | ||
181 | 181 | ||
182 | return 0; | 182 | return 0; |
183 | 183 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index c61a34b14083..03b357ce3987 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -145,7 +145,6 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx) | |||
145 | ctx->spu = spu; | 145 | ctx->spu = spu; |
146 | ctx->ops = &spu_hw_ops; | 146 | ctx->ops = &spu_hw_ops; |
147 | spu->pid = current->pid; | 147 | spu->pid = current->pid; |
148 | spu->prio = current->prio; | ||
149 | spu->mm = ctx->owner; | 148 | spu->mm = ctx->owner; |
150 | mm_needs_global_tlbie(spu->mm); | 149 | mm_needs_global_tlbie(spu->mm); |
151 | spu->ibox_callback = spufs_ibox_callback; | 150 | spu->ibox_callback = spufs_ibox_callback; |
@@ -189,7 +188,6 @@ static int spu_unbind_context(struct spu *spu, struct spu_context *ctx) | |||
189 | spu->dma_callback = NULL; | 188 | spu->dma_callback = NULL; |
190 | spu->mm = NULL; | 189 | spu->mm = NULL; |
191 | spu->pid = 0; | 190 | spu->pid = 0; |
192 | spu->prio = MAX_PRIO; | ||
193 | ctx->ops = &spu_backing_ops; | 191 | ctx->ops = &spu_backing_ops; |
194 | ctx->spu = NULL; | 192 | ctx->spu = NULL; |
195 | spu->flags = 0; | 193 | spu->flags = 0; |
@@ -223,7 +221,7 @@ static inline void spu_del_wq(wait_queue_head_t * wq, wait_queue_t * wait, | |||
223 | 221 | ||
224 | static void spu_prio_wait(struct spu_context *ctx, u64 flags) | 222 | static void spu_prio_wait(struct spu_context *ctx, u64 flags) |
225 | { | 223 | { |
226 | int prio = current->prio; | 224 | int prio = ctx->prio; |
227 | wait_queue_head_t *wq = &spu_prio->waitq[prio]; | 225 | wait_queue_head_t *wq = &spu_prio->waitq[prio]; |
228 | DEFINE_WAIT(wait); | 226 | DEFINE_WAIT(wait); |
229 | 227 | ||
@@ -342,8 +340,6 @@ void spu_yield(struct spu_context *ctx) | |||
342 | __FUNCTION__, spu->number, spu->node); | 340 | __FUNCTION__, spu->number, spu->node); |
343 | spu_deactivate(ctx); | 341 | spu_deactivate(ctx); |
344 | need_yield = 1; | 342 | need_yield = 1; |
345 | } else { | ||
346 | spu->prio = MAX_PRIO; | ||
347 | } | 343 | } |
348 | } | 344 | } |
349 | mutex_unlock(&ctx->state_mutex); | 345 | mutex_unlock(&ctx->state_mutex); |
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index fa07ec2e2c1a..b500e94188b5 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h | |||
@@ -74,6 +74,9 @@ struct spu_context { | |||
74 | 74 | ||
75 | struct list_head gang_list; | 75 | struct list_head gang_list; |
76 | struct spu_gang *gang; | 76 | struct spu_gang *gang; |
77 | |||
78 | /* scheduler fields */ | ||
79 | int prio; | ||
77 | }; | 80 | }; |
78 | 81 | ||
79 | struct spu_gang { | 82 | struct spu_gang { |
diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c index 77540a2f7704..0183e5fbaf46 100644 --- a/arch/powerpc/xmon/xmon.c +++ b/arch/powerpc/xmon/xmon.c | |||
@@ -2811,7 +2811,6 @@ static void dump_spu_fields(struct spu *spu) | |||
2811 | DUMP_FIELD(spu, "0x%lx", irqs[2]); | 2811 | DUMP_FIELD(spu, "0x%lx", irqs[2]); |
2812 | DUMP_FIELD(spu, "0x%x", slb_replace); | 2812 | DUMP_FIELD(spu, "0x%x", slb_replace); |
2813 | DUMP_FIELD(spu, "%d", pid); | 2813 | DUMP_FIELD(spu, "%d", pid); |
2814 | DUMP_FIELD(spu, "%d", prio); | ||
2815 | DUMP_FIELD(spu, "0x%p", mm); | 2814 | DUMP_FIELD(spu, "0x%p", mm); |
2816 | DUMP_FIELD(spu, "0x%p", ctx); | 2815 | DUMP_FIELD(spu, "0x%p", ctx); |
2817 | DUMP_FIELD(spu, "0x%p", rq); | 2816 | DUMP_FIELD(spu, "0x%p", rq); |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index b634e16575f2..0f9f2dd24a79 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -129,7 +129,6 @@ struct spu { | |||
129 | struct spu_runqueue *rq; | 129 | struct spu_runqueue *rq; |
130 | unsigned long long timestamp; | 130 | unsigned long long timestamp; |
131 | pid_t pid; | 131 | pid_t pid; |
132 | int prio; | ||
133 | int class_0_pending; | 132 | int class_0_pending; |
134 | spinlock_t register_lock; | 133 | spinlock_t register_lock; |
135 | 134 | ||