Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
e182a345
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e182a345
编写于
10月 26, 2011
作者:
P
Pekka Enberg
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'slab/next' and 'slub/partial' into slab/for-linus
上级
3cfef952
fe353178
dcc3be6a
变更
6
展开全部
隐藏空白更改
内联
并排
Showing
6 changed file
with
425 addition
and
182 deletion
+425
-182
Documentation/vm/00-INDEX
Documentation/vm/00-INDEX
+0
-2
include/linux/mm_types.h
include/linux/mm_types.h
+13
-1
include/linux/slub_def.h
include/linux/slub_def.h
+4
-0
mm/slab.c
mm/slab.c
+7
-12
mm/slub.c
mm/slub.c
+392
-166
tools/slub/slabinfo.c
tools/slub/slabinfo.c
+9
-1
未找到文件。
Documentation/vm/00-INDEX
浏览文件 @
e182a345
...
...
@@ -30,8 +30,6 @@ page_migration
- description of page migration in NUMA systems.
pagemap.txt
- pagemap, from the userspace perspective
slabinfo.c
- source code for a tool to get reports about slabs.
slub.txt
- a short users guide for SLUB.
unevictable-lru.txt
...
...
include/linux/mm_types.h
浏览文件 @
e182a345
...
...
@@ -79,9 +79,21 @@ struct page {
};
/* Third double word block */
struct
list_head
lru
;
/* Pageout list, eg. active_list
union
{
struct
list_head
lru
;
/* Pageout list, eg. active_list
* protected by zone->lru_lock !
*/
struct
{
/* slub per cpu partial pages */
struct
page
*
next
;
/* Next partial slab */
#ifdef CONFIG_64BIT
int
pages
;
/* Nr of partial slabs left */
int
pobjects
;
/* Approximate # of objects */
#else
short
int
pages
;
short
int
pobjects
;
#endif
};
};
/* Remainder is not double word aligned */
union
{
...
...
include/linux/slub_def.h
浏览文件 @
e182a345
...
...
@@ -36,12 +36,15 @@ enum stat_item {
ORDER_FALLBACK
,
/* Number of times fallback was necessary */
CMPXCHG_DOUBLE_CPU_FAIL
,
/* Failure of this_cpu_cmpxchg_double */
CMPXCHG_DOUBLE_FAIL
,
/* Number of times that cmpxchg double did not match */
CPU_PARTIAL_ALLOC
,
/* Used cpu partial on alloc */
CPU_PARTIAL_FREE
,
/* USed cpu partial on free */
NR_SLUB_STAT_ITEMS
};
struct
kmem_cache_cpu
{
void
**
freelist
;
/* Pointer to next available object */
unsigned
long
tid
;
/* Globally unique transaction id */
struct
page
*
page
;
/* The slab from which we are allocating */
struct
page
*
partial
;
/* Partially allocated frozen slabs */
int
node
;
/* The node of the page (or -1 for debug) */
#ifdef CONFIG_SLUB_STATS
unsigned
stat
[
NR_SLUB_STAT_ITEMS
];
...
...
@@ -79,6 +82,7 @@ struct kmem_cache {
int
size
;
/* The size of an object including meta data */
int
objsize
;
/* The size of an object without meta data */
int
offset
;
/* Free pointer offset. */
int
cpu_partial
;
/* Number of per cpu partial objects to keep around */
struct
kmem_cache_order_objects
oo
;
/* Allocation and freeing of slabs */
...
...
mm/slab.c
浏览文件 @
e182a345
...
...
@@ -1851,15 +1851,15 @@ static void dump_line(char *data, int offset, int limit)
unsigned
char
error
=
0
;
int
bad_count
=
0
;
printk
(
KERN_ERR
"%03x:"
,
offset
);
printk
(
KERN_ERR
"%03x:
"
,
offset
);
for
(
i
=
0
;
i
<
limit
;
i
++
)
{
if
(
data
[
offset
+
i
]
!=
POISON_FREE
)
{
error
=
data
[
offset
+
i
];
bad_count
++
;
}
printk
(
" %02x"
,
(
unsigned
char
)
data
[
offset
+
i
]);
}
printk
(
"
\n
"
);
print_hex_dump
(
KERN_CONT
,
""
,
0
,
16
,
1
,
&
data
[
offset
],
limit
,
1
);
if
(
bad_count
==
1
)
{
error
^=
POISON_FREE
;
...
...
@@ -3039,14 +3039,9 @@ static void check_slabp(struct kmem_cache *cachep, struct slab *slabp)
printk
(
KERN_ERR
"slab: Internal list corruption detected in "
"cache '%s'(%d), slabp %p(%d). Hexdump:
\n
"
,
cachep
->
name
,
cachep
->
num
,
slabp
,
slabp
->
inuse
);
for
(
i
=
0
;
i
<
sizeof
(
*
slabp
)
+
cachep
->
num
*
sizeof
(
kmem_bufctl_t
);
i
++
)
{
if
(
i
%
16
==
0
)
printk
(
"
\n
%03x:"
,
i
);
printk
(
" %02x"
,
((
unsigned
char
*
)
slabp
)[
i
]);
}
printk
(
"
\n
"
);
print_hex_dump
(
KERN_ERR
,
""
,
DUMP_PREFIX_OFFSET
,
16
,
1
,
slabp
,
sizeof
(
*
slabp
)
+
cachep
->
num
*
sizeof
(
kmem_bufctl_t
),
1
);
BUG
();
}
}
...
...
@@ -4584,7 +4579,7 @@ static const struct file_operations proc_slabstats_operations = {
static
int
__init
slab_proc_init
(
void
)
{
proc_create
(
"slabinfo"
,
S_IWUSR
|
S_IRU
GO
,
NULL
,
&
proc_slabinfo_operations
);
proc_create
(
"slabinfo"
,
S_IWUSR
|
S_IRU
SR
,
NULL
,
&
proc_slabinfo_operations
);
#ifdef CONFIG_DEBUG_SLAB_LEAK
proc_create
(
"slab_allocators"
,
0
,
NULL
,
&
proc_slabstats_operations
);
#endif
...
...
mm/slub.c
浏览文件 @
e182a345
此差异已折叠。
点击以展开。
tools/slub/slabinfo.c
浏览文件 @
e182a345
...
...
@@ -42,6 +42,7 @@ struct slabinfo {
unsigned
long
deactivate_remote_frees
,
order_fallback
;
unsigned
long
cmpxchg_double_cpu_fail
,
cmpxchg_double_fail
;
unsigned
long
alloc_node_mismatch
,
deactivate_bypass
;
unsigned
long
cpu_partial_alloc
,
cpu_partial_free
;
int
numa
[
MAX_NODES
];
int
numa_partial
[
MAX_NODES
];
}
slabinfo
[
MAX_SLABS
];
...
...
@@ -455,6 +456,11 @@ static void slab_stats(struct slabinfo *s)
s
->
alloc_from_partial
*
100
/
total_alloc
,
s
->
free_remove_partial
*
100
/
total_free
);
printf
(
"Cpu partial list %8lu %8lu %3lu %3lu
\n
"
,
s
->
cpu_partial_alloc
,
s
->
cpu_partial_free
,
s
->
cpu_partial_alloc
*
100
/
total_alloc
,
s
->
cpu_partial_free
*
100
/
total_free
);
printf
(
"RemoteObj/SlabFrozen %8lu %8lu %3lu %3lu
\n
"
,
s
->
deactivate_remote_frees
,
s
->
free_frozen
,
s
->
deactivate_remote_frees
*
100
/
total_alloc
,
...
...
@@ -1145,7 +1151,7 @@ static void read_slab_dir(void)
switch
(
de
->
d_type
)
{
case
DT_LNK
:
alias
->
name
=
strdup
(
de
->
d_name
);
count
=
readlink
(
de
->
d_name
,
buffer
,
sizeof
(
buffer
));
count
=
readlink
(
de
->
d_name
,
buffer
,
sizeof
(
buffer
)
-
1
);
if
(
count
<
0
)
fatal
(
"Cannot read symlink %s
\n
"
,
de
->
d_name
);
...
...
@@ -1209,6 +1215,8 @@ static void read_slab_dir(void)
slab
->
order_fallback
=
get_obj
(
"order_fallback"
);
slab
->
cmpxchg_double_cpu_fail
=
get_obj
(
"cmpxchg_double_cpu_fail"
);
slab
->
cmpxchg_double_fail
=
get_obj
(
"cmpxchg_double_fail"
);
slab
->
cpu_partial_alloc
=
get_obj
(
"cpu_partial_alloc"
);
slab
->
cpu_partial_free
=
get_obj
(
"cpu_partial_free"
);
slab
->
alloc_node_mismatch
=
get_obj
(
"alloc_node_mismatch"
);
slab
->
deactivate_bypass
=
get_obj
(
"deactivate_bypass"
);
chdir
(
".."
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录