Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
e9f76354
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 3 年多
通知
13
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
e9f76354
编写于
7月 25, 2008
作者:
B
Benjamin Herrenschmidt
浏览文件
操作
浏览文件
下载
差异文件
Merge commit 'jk/jk-merge'
上级
c174aff9
ad1ede12
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
24 addition
and
14 deletion
+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
未找到文件。
arch/powerpc/platforms/cell/spufs/sched.c
浏览文件 @
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
浏览文件 @
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
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录