Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
d82bf490
Commit
d82bf490
authored
Aug 20, 2008
by
Paul Mackerras
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'merge' of
git://git.kernel.org/pub/scm/linux/kernel/git/jk/spufs
into merge
parents
a7f5aaf3
cb9808d3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
9 deletions
+17
-9
arch/powerpc/platforms/cell/spufs/run.c
arch/powerpc/platforms/cell/spufs/run.c
+8
-7
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/cell/spufs/sched.c
+9
-2
No files found.
arch/powerpc/platforms/cell/spufs/run.c
View file @
d82bf490
...
@@ -206,11 +206,6 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
...
@@ -206,11 +206,6 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
(
SPU_RUNCNTL_RUNNABLE
|
SPU_RUNCNTL_ISOLATE
);
(
SPU_RUNCNTL_RUNNABLE
|
SPU_RUNCNTL_ISOLATE
);
if
(
runcntl
==
0
)
if
(
runcntl
==
0
)
runcntl
=
SPU_RUNCNTL_RUNNABLE
;
runcntl
=
SPU_RUNCNTL_RUNNABLE
;
}
if
(
ctx
->
flags
&
SPU_CREATE_NOSCHED
)
{
spuctx_switch_state
(
ctx
,
SPU_UTIL_USER
);
ctx
->
ops
->
runcntl_write
(
ctx
,
runcntl
);
}
else
{
}
else
{
unsigned
long
privcntl
;
unsigned
long
privcntl
;
...
@@ -219,9 +214,15 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
...
@@ -219,9 +214,15 @@ static int spu_run_init(struct spu_context *ctx, u32 *npc)
else
else
privcntl
=
SPU_PRIVCNTL_MODE_NORMAL
;
privcntl
=
SPU_PRIVCNTL_MODE_NORMAL
;
ctx
->
ops
->
npc_write
(
ctx
,
*
npc
);
ctx
->
ops
->
privcntl_write
(
ctx
,
privcntl
);
ctx
->
ops
->
privcntl_write
(
ctx
,
privcntl
);
ctx
->
ops
->
runcntl_write
(
ctx
,
runcntl
);
ctx
->
ops
->
npc_write
(
ctx
,
*
npc
);
}
ctx
->
ops
->
runcntl_write
(
ctx
,
runcntl
);
if
(
ctx
->
flags
&
SPU_CREATE_NOSCHED
)
{
spuctx_switch_state
(
ctx
,
SPU_UTIL_USER
);
}
else
{
if
(
ctx
->
state
==
SPU_STATE_SAVED
)
{
if
(
ctx
->
state
==
SPU_STATE_SAVED
)
{
ret
=
spu_activate
(
ctx
,
0
);
ret
=
spu_activate
(
ctx
,
0
);
...
...
arch/powerpc/platforms/cell/spufs/sched.c
View file @
d82bf490
...
@@ -641,8 +641,10 @@ static struct spu *find_victim(struct spu_context *ctx)
...
@@ -641,8 +641,10 @@ static struct spu *find_victim(struct spu_context *ctx)
if
(
tmp
&&
tmp
->
prio
>
ctx
->
prio
&&
if
(
tmp
&&
tmp
->
prio
>
ctx
->
prio
&&
!
(
tmp
->
flags
&
SPU_CREATE_NOSCHED
)
&&
!
(
tmp
->
flags
&
SPU_CREATE_NOSCHED
)
&&
(
!
victim
||
tmp
->
prio
>
victim
->
prio
))
(
!
victim
||
tmp
->
prio
>
victim
->
prio
))
{
victim
=
spu
->
ctx
;
victim
=
spu
->
ctx
;
get_spu_context
(
victim
);
}
}
}
mutex_unlock
(
&
cbe_spu_info
[
node
].
list_mutex
);
mutex_unlock
(
&
cbe_spu_info
[
node
].
list_mutex
);
...
@@ -658,6 +660,7 @@ static struct spu *find_victim(struct spu_context *ctx)
...
@@ -658,6 +660,7 @@ static struct spu *find_victim(struct spu_context *ctx)
* look at another context or give up after X retries.
* look at another context or give up after X retries.
*/
*/
if
(
!
mutex_trylock
(
&
victim
->
state_mutex
))
{
if
(
!
mutex_trylock
(
&
victim
->
state_mutex
))
{
put_spu_context
(
victim
);
victim
=
NULL
;
victim
=
NULL
;
goto
restart
;
goto
restart
;
}
}
...
@@ -670,6 +673,7 @@ static struct spu *find_victim(struct spu_context *ctx)
...
@@ -670,6 +673,7 @@ static struct spu *find_victim(struct spu_context *ctx)
* restart the search.
* restart the search.
*/
*/
mutex_unlock
(
&
victim
->
state_mutex
);
mutex_unlock
(
&
victim
->
state_mutex
);
put_spu_context
(
victim
);
victim
=
NULL
;
victim
=
NULL
;
goto
restart
;
goto
restart
;
}
}
...
@@ -687,6 +691,7 @@ static struct spu *find_victim(struct spu_context *ctx)
...
@@ -687,6 +691,7 @@ static struct spu *find_victim(struct spu_context *ctx)
spu_add_to_rq
(
victim
);
spu_add_to_rq
(
victim
);
mutex_unlock
(
&
victim
->
state_mutex
);
mutex_unlock
(
&
victim
->
state_mutex
);
put_spu_context
(
victim
);
return
spu
;
return
spu
;
}
}
...
@@ -985,9 +990,11 @@ static int spusched_thread(void *unused)
...
@@ -985,9 +990,11 @@ static int spusched_thread(void *unused)
struct
spu_context
*
ctx
=
spu
->
ctx
;
struct
spu_context
*
ctx
=
spu
->
ctx
;
if
(
ctx
)
{
if
(
ctx
)
{
get_spu_context
(
ctx
);
mutex_unlock
(
mtx
);
mutex_unlock
(
mtx
);
spusched_tick
(
ctx
);
spusched_tick
(
ctx
);
mutex_lock
(
mtx
);
mutex_lock
(
mtx
);
put_spu_context
(
ctx
);
}
}
}
}
mutex_unlock
(
mtx
);
mutex_unlock
(
mtx
);
...
@@ -1030,7 +1037,7 @@ void spuctx_switch_state(struct spu_context *ctx,
...
@@ -1030,7 +1037,7 @@ void spuctx_switch_state(struct spu_context *ctx,
node
=
spu
->
node
;
node
=
spu
->
node
;
if
(
old_state
==
SPU_UTIL_USER
)
if
(
old_state
==
SPU_UTIL_USER
)
atomic_dec
(
&
cbe_spu_info
[
node
].
busy_spus
);
atomic_dec
(
&
cbe_spu_info
[
node
].
busy_spus
);
if
(
new_state
==
SPU_UTIL_USER
)
;
if
(
new_state
==
SPU_UTIL_USER
)
atomic_inc
(
&
cbe_spu_info
[
node
].
busy_spus
);
atomic_inc
(
&
cbe_spu_info
[
node
].
busy_spus
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment