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
nexedi
linux
Commits
e9f76354
Commit
e9f76354
authored
Jul 25, 2008
by
Benjamin Herrenschmidt
Browse files
Options
Browse Files
Download
Plain Diff
Merge commit 'jk/jk-merge'
parents
c174aff9
ad1ede12
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
14 deletions
+24
-14
arch/powerpc/platforms/cell/spufs/sched.c
arch/powerpc/platforms/cell/spufs/sched.c
+23
-12
arch/powerpc/platforms/cell/spufs/sputrace.c
arch/powerpc/platforms/cell/spufs/sputrace.c
+1
-2
No files found.
arch/powerpc/platforms/cell/spufs/sched.c
View file @
e9f76354
...
...
@@ -312,10 +312,27 @@ static struct spu *aff_ref_location(struct spu_context *ctx, int mem_aff,
*/
node
=
cpu_to_node
(
raw_smp_processor_id
());
for
(
n
=
0
;
n
<
MAX_NUMNODES
;
n
++
,
node
++
)
{
int
available_spus
;
node
=
(
node
<
MAX_NUMNODES
)
?
node
:
0
;
if
(
!
node_allowed
(
ctx
,
node
))
continue
;
available_spus
=
0
;
mutex_lock
(
&
cbe_spu_info
[
node
].
list_mutex
);
list_for_each_entry
(
spu
,
&
cbe_spu_info
[
node
].
spus
,
cbe_list
)
{
if
(
spu
->
ctx
&&
spu
->
ctx
->
gang
&&
spu
->
ctx
->
aff_offset
==
0
)
available_spus
-=
(
spu
->
ctx
->
gang
->
contexts
-
1
);
else
available_spus
++
;
}
if
(
available_spus
<
ctx
->
gang
->
contexts
)
{
mutex_unlock
(
&
cbe_spu_info
[
node
].
list_mutex
);
continue
;
}
list_for_each_entry
(
spu
,
&
cbe_spu_info
[
node
].
spus
,
cbe_list
)
{
if
((
!
mem_aff
||
spu
->
has_mem_affinity
)
&&
sched_spu
(
spu
))
{
...
...
@@ -389,6 +406,9 @@ static int has_affinity(struct spu_context *ctx)
if
(
list_empty
(
&
ctx
->
aff_list
))
return
0
;
if
(
atomic_read
(
&
ctx
->
gang
->
aff_sched_count
)
==
0
)
ctx
->
gang
->
aff_ref_spu
=
NULL
;
if
(
!
gang
->
aff_ref_spu
)
{
if
(
!
(
gang
->
aff_flags
&
AFF_MERGED
))
aff_merge_remaining_ctxs
(
gang
);
...
...
@@ -416,14 +436,8 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx)
if
(
spu
->
ctx
->
flags
&
SPU_CREATE_NOSCHED
)
atomic_dec
(
&
cbe_spu_info
[
spu
->
node
].
reserved_spus
);
if
(
ctx
->
gang
){
mutex_lock
(
&
ctx
->
gang
->
aff_mutex
);
if
(
has_affinity
(
ctx
))
{
if
(
atomic_dec_and_test
(
&
ctx
->
gang
->
aff_sched_count
))
ctx
->
gang
->
aff_ref_spu
=
NULL
;
}
mutex_unlock
(
&
ctx
->
gang
->
aff_mutex
);
}
if
(
ctx
->
gang
)
atomic_dec_if_positive
(
&
ctx
->
gang
->
aff_sched_count
);
spu_switch_notify
(
spu
,
NULL
);
spu_unmap_mappings
(
ctx
);
...
...
@@ -562,10 +576,7 @@ static struct spu *spu_get_idle(struct spu_context *ctx)
goto
found
;
mutex_unlock
(
&
cbe_spu_info
[
node
].
list_mutex
);
mutex_lock
(
&
ctx
->
gang
->
aff_mutex
);
if
(
atomic_dec_and_test
(
&
ctx
->
gang
->
aff_sched_count
))
ctx
->
gang
->
aff_ref_spu
=
NULL
;
mutex_unlock
(
&
ctx
->
gang
->
aff_mutex
);
atomic_dec
(
&
ctx
->
gang
->
aff_sched_count
);
goto
not_found
;
}
mutex_unlock
(
&
ctx
->
gang
->
aff_mutex
);
...
...
arch/powerpc/platforms/cell/spufs/sputrace.c
View file @
e9f76354
...
...
@@ -196,8 +196,7 @@ static int __init sputrace_init(void)
struct
proc_dir_entry
*
entry
;
int
i
,
error
=
-
ENOMEM
;
sputrace_log
=
kcalloc
(
sizeof
(
struct
sputrace
),
bufsize
,
GFP_KERNEL
);
sputrace_log
=
kcalloc
(
bufsize
,
sizeof
(
struct
sputrace
),
GFP_KERNEL
);
if
(
!
sputrace_log
)
goto
out
;
...
...
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