Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
925564a6
提交
925564a6
2月 29, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Clean up some leftover cilk boogers
上级
275a8c9f
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
51 行删除
+10
-51
kernel.hh
include/kernel.hh
+0
-1
cilk.cc
kernel/cilk.cc
+10
-47
main.cc
kernel/main.cc
+0
-3
没有找到文件。
include/kernel.hh
浏览文件 @
925564a6
...
...
@@ -302,7 +302,6 @@ void initbio(void);
void
initinode
(
void
);
void
initdisk
(
void
);
void
inituser
(
void
);
void
initcilk
(
void
);
void
initsamp
(
void
);
void
initpci
(
void
);
void
initnet
(
void
);
...
...
kernel/cilk.cc
浏览文件 @
925564a6
// cilk style run queue
// A work queue is built from NCPU per-core wqueues.
// A core pushes work to the head of its per-core wqueue.
// A core pops work from the head of its per-core wqueue.
// A core pops work from the tail of another core's per-core wqueue.
// cilk style run queue built on wq.cc:
// A core pushes work to the head of its per-core wq.
// A core pops work from the head of its per-core wq.
// A core pops work from the tail of another core's per-core wqueue.
//
// Usage:
// void goo(uptr a0, uptr a1) {
...
...
@@ -37,35 +36,14 @@
#include "proc.hh"
#include "mtrace.h"
#include "wq.hh"
#define NSLOTS (1 << CILKSHIFT)
struct
cilkqueue
{
struct
cilkthread
*
thread
[
NSLOTS
];
volatile
int
head
__mpalign__
;
struct
spinlock
lock
;
volatile
int
tail
;
__padout__
;
}
__mpalign__
;
struct
cilkthread
{
u64
rip
;
u64
arg0
;
u64
arg1
;
struct
cilkframe
*
frame
;
// parent cilkframe
__padout__
;
}
__mpalign__
;
#include "percpu.hh"
struct
cilkstat
{
u64
push
;
u64
full
;
u64
steal
;
__padout__
;
}
__mpalign__
;
static
struct
cilkqueue
queue
[
NCPU
]
__mpalign__
;
static
struct
cilkstat
stat
[
NCPU
]
__mpalign__
;
};
static
percpu
<
cilkstat
>
stat
;
static
struct
cilkframe
*
cilk_frame
(
void
)
...
...
@@ -73,12 +51,6 @@ cilk_frame(void)
return
mycpu
()
->
cilkframe
;
}
static
struct
cilkstat
*
cilk_stat
(
void
)
{
return
&
stat
[
mycpu
()
->
id
];
}
static
void
__cilk_run
(
struct
work
*
w
,
void
*
xfn
,
void
*
arg0
,
void
*
arg1
,
void
*
xframe
)
{
...
...
@@ -87,7 +59,7 @@ __cilk_run(struct work *w, void *xfn, void *arg0, void *arg1, void *xframe)
struct
cilkframe
*
old
=
mycpu
()
->
cilkframe
;
if
(
old
!=
frame
)
cilk_stat
()
->
steal
++
;
stat
->
steal
++
;
mycpu
()
->
cilkframe
=
frame
;
fn
((
uptr
)
arg0
,
(
uptr
)
arg1
);
...
...
@@ -117,10 +89,10 @@ cilk_push(void (*fn)(uptr, uptr), u64 arg0, u64 arg1)
if
(
wq_push
(
w
))
{
freework
(
w
);
fn
(
arg0
,
arg1
);
cilk_stat
()
->
full
++
;
stat
->
full
++
;
}
else
{
cilk_frame
()
->
ref
++
;
cilk_stat
()
->
push
++
;
stat
->
push
++
;
}
}
...
...
@@ -195,13 +167,4 @@ initcilkframe(struct cilkframe *cilk)
{
memset
(
cilk
,
0
,
sizeof
(
*
cilk
));
}
void
initcilk
(
void
)
{
int
i
;
for
(
i
=
0
;
i
<
NCPU
;
i
++
)
initlock
(
&
queue
[
i
].
lock
,
"queue lock"
,
LOCKSTAT_CILK
);
}
#endif // CILKENABLE
kernel/main.cc
浏览文件 @
925564a6
...
...
@@ -89,9 +89,6 @@ cmain(u64 mbmagic, u64 mbaddr)
initinode
();
// inode cache
initdisk
();
// disk
initwq
();
#if CILKENABLE
initcilk
();
#endif
initsamp
();
initlockstat
();
initpci
();
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论