Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
a9338ce5
提交
a9338ce5
2月 19, 2012
创建
作者:
Nickolai Zeldovich
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
towards free-standing crange/gc/ns
上级
875bc53a
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
17 行增加
和
27 行删除
+17
-27
crange.hh
include/crange.hh
+2
-4
crange_arch.hh
include/crange_arch.hh
+9
-0
crange.cc
kernel/crange.cc
+4
-12
gc.cc
kernel/gc.cc
+2
-11
没有找到文件。
include/crange.hh
浏览文件 @
a9338ce5
...
@@ -2,8 +2,6 @@
...
@@ -2,8 +2,6 @@
#include "atomic.hh"
#include "atomic.hh"
using
std
::
atomic
;
struct
crange
;
struct
crange
;
struct
crange_locked
;
struct
crange_locked
;
struct
range
;
struct
range
;
...
@@ -18,7 +16,7 @@ class markptr_mark;
...
@@ -18,7 +16,7 @@ class markptr_mark;
template
<
class
T
>
template
<
class
T
>
class
markptr
{
class
markptr
{
protected
:
protected
:
atomic
<
uptr
>
_p
;
std
::
atomic
<
uptr
>
_p
;
public
:
public
:
markptr
()
:
_p
(
0
)
{}
markptr
()
:
_p
(
0
)
{}
...
@@ -88,7 +86,7 @@ struct range : public rcu_freed {
...
@@ -88,7 +86,7 @@ struct range : public rcu_freed {
private
:
private
:
const
u64
key
;
const
u64
key
;
const
u64
size
;
const
u64
size
;
atomic
<
int
>
curlevel
;
// the current levels it appears on
std
::
atomic
<
int
>
curlevel
;
// the current levels it appears on
const
int
nlevel
;
// the number of levels this range should appear
const
int
nlevel
;
// the number of levels this range should appear
crange
*
const
cr
;
// the crange this range is part of
crange
*
const
cr
;
// the crange this range is part of
markptr
<
range
>*
const
next
;
// one next pointer per level
markptr
<
range
>*
const
next
;
// one next pointer per level
...
...
include/crange_arch.hh
0 → 100644
浏览文件 @
a9338ce5
#include "types.h"
#include "kernel.hh"
#include "spinlock.h"
#include "condvar.h"
#include "cpputil.hh"
#include "atomic.hh"
#include "proc.hh"
#include "cpu.hh"
#include "ns.hh"
kernel/crange.cc
浏览文件 @
a9338ce5
#include "types.h"
#include "crange_arch.hh"
#include "kernel.hh"
#include "mmu.h"
#include "spinlock.h"
#include "condvar.h"
#include "queue.h"
#include "proc.hh"
#include "cpu.hh"
#include "gc.hh"
#include "gc.hh"
#include "crange.hh"
#include "crange.hh"
#include "cpputil.hh"
//
//
// Concurrent atomic range operations using skip lists. An insert may split an
// Concurrent atomic range operations using skip lists. An insert may split an
...
@@ -92,7 +84,7 @@ range::print(int l)
...
@@ -92,7 +84,7 @@ range::print(int l)
range
::~
range
()
range
::~
range
()
{
{
dprintf
(
"%d: range_free: 0x%lx 0x%lx-0x%lx(%ld)
\n
"
,
myproc
()
->
cpuid
,
(
u64
)
this
,
key
,
key
+
size
,
size
);
//
dprintf("%d: range_free: 0x%lx 0x%lx-0x%lx(%ld)\n", myproc()->cpuid, (u64) this, key, key+size, size);
cr
->
check
(
this
);
cr
->
check
(
this
);
// assert(curlevel == -1);
// assert(curlevel == -1);
for
(
int
l
=
0
;
l
<
nlevel
;
l
++
)
{
for
(
int
l
=
0
;
l
<
nlevel
;
l
++
)
{
...
@@ -107,7 +99,7 @@ range::dec_ref(void)
...
@@ -107,7 +99,7 @@ range::dec_ref(void)
{
{
int
n
=
curlevel
--
;
int
n
=
curlevel
--
;
if
(
n
==
0
)
{
// now removed from all levels.
if
(
n
==
0
)
{
// now removed from all levels.
dprintf
(
"%d: free_delayed: 0x%lx 0x%lx-0x%lx(%lu) %lu
\n
"
,
myproc
()
->
pid
,
(
long
)
this
,
key
,
key
+
size
,
size
,
myproc
()
->
epoch
);
//
dprintf("%d: free_delayed: 0x%lx 0x%lx-0x%lx(%lu) %lu\n", myproc()->pid, (long) this, key, key + size, size, myproc()->epoch);
cr
->
check
(
this
);
cr
->
check
(
this
);
assert
(
curlevel
==
-
1
);
assert
(
curlevel
==
-
1
);
gc_delayed
(
this
);
gc_delayed
(
this
);
...
@@ -206,7 +198,7 @@ crange::check(struct range *absent)
...
@@ -206,7 +198,7 @@ crange::check(struct range *absent)
{
{
if
(
!
crange_checking
)
if
(
!
crange_checking
)
return
;
return
;
int
t
=
mycpu
()
->
id
;
int
t
=
-
1
;
//
mycpu()->id;
struct
range
*
e
,
*
s
;
struct
range
*
e
,
*
s
;
for
(
int
l
=
0
;
l
<
nlevel
;
l
++
)
{
for
(
int
l
=
0
;
l
<
nlevel
;
l
++
)
{
for
(
e
=
crange_head
->
next
[
l
].
ptr
();
e
;
e
=
s
)
{
for
(
e
=
crange_head
->
next
[
l
].
ptr
();
e
;
e
=
s
)
{
...
...
kernel/gc.cc
浏览文件 @
a9338ce5
#include "types.h"
#include "crange_arch.hh"
#include "kernel.hh"
#include "gc.hh"
#include "mmu.h"
#include "amd64.h"
#include "spinlock.h"
#include "condvar.h"
#include "queue.h"
#include "proc.hh"
#include "cpu.hh"
#include "ns.hh"
#include "atomic.hh"
extern
u64
proc_hash
(
const
u32
&
);
extern
u64
proc_hash
(
const
u32
&
);
extern
xns
<
u32
,
proc
*
,
proc_hash
>
*
xnspid
;
extern
xns
<
u32
,
proc
*
,
proc_hash
>
*
xnspid
;
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论