Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62258
b: refs/heads/master
c: cbc23d3
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and Arnd Bergmann committed Jul 20, 2007
1 parent b5a6dd2 commit 0e00bd2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5fc8d2a92461fcabd00dfd678204cba36b93119
refs/heads/master: cbc23d3e7cb3c9fd3c9fce0bc3f44f687a9517c0
19 changes: 19 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spu_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,25 @@ static void spu_init_channels(struct spu *spu)
}
}

struct spu *spu_alloc_spu(struct spu *req_spu)
{
struct spu *spu, *ret = NULL;

mutex_lock(&spu_mutex);
list_for_each_entry(spu, &cbe_spu_info[req_spu->node].free_spus, list) {
if (spu == req_spu) {
list_del_init(&spu->list);
pr_debug("Got SPU %d %d\n", spu->number, spu->node);
spu_init_channels(spu);
ret = spu;
break;
}
}
mutex_unlock(&spu_mutex);
return ret;
}
EXPORT_SYMBOL_GPL(spu_alloc_spu);

struct spu *spu_alloc_node(int node)
{
struct spu *spu = NULL;
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/powerpc/platforms/cell/spufs/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,10 @@ static struct spu *spu_get_idle(struct spu_context *ctx)
int node = cpu_to_node(raw_smp_processor_id());
int n;

spu = affinity_check(ctx);
if (spu)
return spu_alloc_spu(spu);

for (n = 0; n < MAX_NUMNODES; n++, node++) {
node = (node < MAX_NUMNODES) ? node : 0;
if (!node_allowed(ctx, node))
Expand Down

0 comments on commit 0e00bd2

Please sign in to comment.