Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
e0780ce4
提交
e0780ce4
2月 16, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
real tlb flush barrier
上级
f336c8cd
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
19 行增加
和
15 行删除
+19
-15
cpu.hh
cpu.hh
+5
-2
hwvm.cc
hwvm.cc
+8
-7
lapic.cc
lapic.cc
+1
-2
mapbench.cc
mapbench.cc
+1
-1
trap.cc
trap.cc
+4
-3
没有找到文件。
cpu.hh
浏览文件 @
e0780ce4
#include "mmu.h"
#include "atomic.hh"
struct
cilkframe
;
// extern atomic<u64> tlbflush_req;
using
std
::
atomic
;
extern
atomic
<
u64
>
tlbflush_req
;
// Per-CPU state
struct
cpu
{
...
...
@@ -13,7 +16,7 @@ struct cpu {
struct
context
*
scheduler
;
// swtch() here to enter scheduler
struct
cilkframe
*
cilkframe
;
int
timer_printpc
;
//
atomic<u64> tlbflush_done; // last tlb flush req done on this cpu
atomic
<
u64
>
tlbflush_done
;
// last tlb flush req done on this cpu
// Cpu-local storage variables; see below
struct
cpu
*
cpu
;
...
...
hwvm.cc
浏览文件 @
e0780ce4
...
...
@@ -216,17 +216,18 @@ atomic<u64> tlbflush_req;
void
tlbflush
()
{
// u64 myreq = tlbflush_req++;
u64
myreq
=
tlbflush_req
++
;
cli
();
int
myid
=
mycpu
()
->
id
;
lcr3
(
rcr3
());
for
(
int
i
=
0
;
i
<
ncpu
;
i
++
)
if
(
i
!=
my
cpu
()
->
id
)
if
(
i
!=
myid
)
lapic_tlbflush
(
i
);
sti
();
for
(
int
i
=
0
;
i
<
ncpu
;
i
++
)
{
if
(
i
!=
mycpu
()
->
id
)
{
// while (cpus[i].tlbflush_done < myreq) /* spin */ ;
}
}
for
(
int
i
=
0
;
i
<
ncpu
;
i
++
)
if
(
i
!=
myid
)
while
(
cpus
[
i
].
tlbflush_done
<
myreq
)
/* spin */
;
}
lapic.cc
浏览文件 @
e0780ce4
...
...
@@ -6,6 +6,7 @@
#include "kernel.hh"
#include "traps.h"
#include "bits.h"
#include "cpu.hh"
// Local APIC registers, divided by 4 for use as uint[] indices.
#define ID (0x0020/4) // ID
...
...
@@ -179,9 +180,7 @@ lapic_ipi(int cpu, int ino)
void
lapic_tlbflush
(
u32
cpu
)
{
cprintf
(
"lapic_tlbflush: to cpu %d
\n
"
,
cpu
);
lapic_ipi
(
cpu
,
T_TLBFLUSH
);
cprintf
(
"lapic_tlbflush: to cpu %d done
\n
"
,
cpu
);
}
void
...
...
mapbench.cc
浏览文件 @
e0780ce4
...
...
@@ -14,7 +14,7 @@ thr(void *arg)
{
u64
tid
=
(
u64
)
arg
;
for
(
int
i
=
0
;
i
<
1000
0
;
i
++
)
{
for
(
int
i
=
0
;
i
<
1000
;
i
++
)
{
volatile
char
*
p
=
(
char
*
)
(
0x40000UL
+
tid
*
8
*
4096
);
if
(
map
((
void
*
)
p
,
8
*
4096
)
<
0
)
{
printf
(
1
,
"%d: map failed
\n
"
,
tid
);
...
...
trap.cc
浏览文件 @
e0780ce4
...
...
@@ -95,12 +95,13 @@ trap(struct trapframe *tf)
cprintf
(
"cpu%d: spurious interrupt at %x:%lx
\n
"
,
mycpu
()
->
id
,
tf
->
cs
,
tf
->
rip
);
lapiceoi
();
case
T_TLBFLUSH
:
//
nreq = tlbflush_req.load();
case
T_TLBFLUSH
:
{
u64
nreq
=
tlbflush_req
.
load
();
lapiceoi
();
lcr3
(
rcr3
());
//
mycpu()->tlbflush_done = nreq;
mycpu
()
->
tlbflush_done
=
nreq
;
break
;
}
case
T_SAMPCONF
:
lapiceoi
();
sampconf
();
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论