Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
b5eb5511
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b5eb5511
编写于
10月 03, 2007
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[MIPS] Kill num_online_cpus() loops.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
bd6aeeff
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
18 deletion
+27
-18
arch/mips/kernel/gdb-stub.c
arch/mips/kernel/gdb-stub.c
+2
-2
arch/mips/kernel/smp.c
arch/mips/kernel/smp.c
+21
-12
arch/mips/kernel/smtc.c
arch/mips/kernel/smtc.c
+2
-2
include/asm-mips/mmu_context.h
include/asm-mips/mmu_context.h
+2
-2
未找到文件。
arch/mips/kernel/gdb-stub.c
浏览文件 @
b5eb5511
...
@@ -769,7 +769,7 @@ void handle_exception(struct gdb_regs *regs)
...
@@ -769,7 +769,7 @@ void handle_exception(struct gdb_regs *regs)
/*
/*
* acquire the CPU spinlocks
* acquire the CPU spinlocks
*/
*/
for
(
i
=
num_online_cpus
()
-
1
;
i
>=
0
;
i
--
)
for
_each_online_cpu
(
i
)
if
(
__raw_spin_trylock
(
&
kgdb_cpulock
[
i
])
==
0
)
if
(
__raw_spin_trylock
(
&
kgdb_cpulock
[
i
])
==
0
)
panic
(
"kgdb: couldn't get cpulock %d
\n
"
,
i
);
panic
(
"kgdb: couldn't get cpulock %d
\n
"
,
i
);
...
@@ -1044,7 +1044,7 @@ void handle_exception(struct gdb_regs *regs)
...
@@ -1044,7 +1044,7 @@ void handle_exception(struct gdb_regs *regs)
exit_kgdb_exception:
exit_kgdb_exception:
/* release locks so other CPUs can go */
/* release locks so other CPUs can go */
for
(
i
=
num_online_cpus
()
-
1
;
i
>=
0
;
i
--
)
for
_each_online_cpu
(
i
)
__raw_spin_unlock
(
&
kgdb_cpulock
[
i
]);
__raw_spin_unlock
(
&
kgdb_cpulock
[
i
]);
spin_unlock
(
&
kgdb_lock
);
spin_unlock
(
&
kgdb_lock
);
...
...
arch/mips/kernel/smp.c
浏览文件 @
b5eb5511
...
@@ -375,10 +375,13 @@ void flush_tlb_mm(struct mm_struct *mm)
...
@@ -375,10 +375,13 @@ void flush_tlb_mm(struct mm_struct *mm)
if
((
atomic_read
(
&
mm
->
mm_users
)
!=
1
)
||
(
current
->
mm
!=
mm
))
{
if
((
atomic_read
(
&
mm
->
mm_users
)
!=
1
)
||
(
current
->
mm
!=
mm
))
{
smp_on_other_tlbs
(
flush_tlb_mm_ipi
,
(
void
*
)
mm
);
smp_on_other_tlbs
(
flush_tlb_mm_ipi
,
(
void
*
)
mm
);
}
else
{
}
else
{
int
i
;
cpumask_t
mask
=
cpu_online_map
;
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
unsigned
int
cpu
;
if
(
smp_processor_id
()
!=
i
)
cpu_context
(
i
,
mm
)
=
0
;
cpu_clear
(
smp_processor_id
(),
mask
);
for_each_online_cpu
(
cpu
)
if
(
cpu_context
(
cpu
,
mm
))
cpu_context
(
cpu
,
mm
)
=
0
;
}
}
local_flush_tlb_mm
(
mm
);
local_flush_tlb_mm
(
mm
);
...
@@ -411,10 +414,13 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
...
@@ -411,10 +414,13 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, unsigned l
fd
.
addr2
=
end
;
fd
.
addr2
=
end
;
smp_on_other_tlbs
(
flush_tlb_range_ipi
,
(
void
*
)
&
fd
);
smp_on_other_tlbs
(
flush_tlb_range_ipi
,
(
void
*
)
&
fd
);
}
else
{
}
else
{
int
i
;
cpumask_t
mask
=
cpu_online_map
;
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
unsigned
int
cpu
;
if
(
smp_processor_id
()
!=
i
)
cpu_context
(
i
,
mm
)
=
0
;
cpu_clear
(
smp_processor_id
(),
mask
);
for_each_online_cpu
(
cpu
)
if
(
cpu_context
(
cpu
,
mm
))
cpu_context
(
cpu
,
mm
)
=
0
;
}
}
local_flush_tlb_range
(
vma
,
start
,
end
);
local_flush_tlb_range
(
vma
,
start
,
end
);
preempt_enable
();
preempt_enable
();
...
@@ -453,10 +459,13 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
...
@@ -453,10 +459,13 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long page)
fd
.
addr1
=
page
;
fd
.
addr1
=
page
;
smp_on_other_tlbs
(
flush_tlb_page_ipi
,
(
void
*
)
&
fd
);
smp_on_other_tlbs
(
flush_tlb_page_ipi
,
(
void
*
)
&
fd
);
}
else
{
}
else
{
int
i
;
cpumask_t
mask
=
cpu_online_map
;
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
unsigned
int
cpu
;
if
(
smp_processor_id
()
!=
i
)
cpu_context
(
i
,
vma
->
vm_mm
)
=
0
;
cpu_clear
(
smp_processor_id
(),
mask
);
for_each_online_cpu
(
cpu
)
if
(
cpu_context
(
cpu
,
vma
->
vm_mm
))
cpu_context
(
cpu
,
vma
->
vm_mm
)
=
0
;
}
}
local_flush_tlb_page
(
vma
,
page
);
local_flush_tlb_page
(
vma
,
page
);
preempt_enable
();
preempt_enable
();
...
...
arch/mips/kernel/smtc.c
浏览文件 @
b5eb5511
...
@@ -1264,7 +1264,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
...
@@ -1264,7 +1264,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
if
(
cpu_has_vtag_icache
)
if
(
cpu_has_vtag_icache
)
flush_icache_all
();
flush_icache_all
();
/* Traverse all online CPUs (hack requires contigous range) */
/* Traverse all online CPUs (hack requires contigous range) */
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
{
for
_each_online_cpu
(
i
)
{
/*
/*
* We don't need to worry about our own CPU, nor those of
* We don't need to worry about our own CPU, nor those of
* CPUs who don't share our TLB.
* CPUs who don't share our TLB.
...
@@ -1293,7 +1293,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
...
@@ -1293,7 +1293,7 @@ void smtc_get_new_mmu_context(struct mm_struct *mm, unsigned long cpu)
/*
/*
* SMTC shares the TLB within VPEs and possibly across all VPEs.
* SMTC shares the TLB within VPEs and possibly across all VPEs.
*/
*/
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
{
for
_each_online_cpu
(
i
)
{
if
((
smtc_status
&
SMTC_TLB_SHARED
)
||
if
((
smtc_status
&
SMTC_TLB_SHARED
)
||
(
cpu_data
[
i
].
vpe_id
==
cpu_data
[
cpu
].
vpe_id
))
(
cpu_data
[
i
].
vpe_id
==
cpu_data
[
cpu
].
vpe_id
))
cpu_context
(
i
,
mm
)
=
asid_cache
(
i
)
=
asid
;
cpu_context
(
i
,
mm
)
=
asid_cache
(
i
)
=
asid
;
...
...
include/asm-mips/mmu_context.h
浏览文件 @
b5eb5511
...
@@ -120,7 +120,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
...
@@ -120,7 +120,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{
{
int
i
;
int
i
;
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
for
_each_online_cpu
(
i
)
cpu_context
(
i
,
mm
)
=
0
;
cpu_context
(
i
,
mm
)
=
0
;
return
0
;
return
0
;
...
@@ -284,7 +284,7 @@ drop_mmu_context(struct mm_struct *mm, unsigned cpu)
...
@@ -284,7 +284,7 @@ drop_mmu_context(struct mm_struct *mm, unsigned cpu)
int
i
;
int
i
;
/* SMTC shares the TLB (and ASIDs) across VPEs */
/* SMTC shares the TLB (and ASIDs) across VPEs */
for
(
i
=
0
;
i
<
num_online_cpus
();
i
++
)
{
for
_each_online_cpu
(
i
)
{
if
((
smtc_status
&
SMTC_TLB_SHARED
)
if
((
smtc_status
&
SMTC_TLB_SHARED
)
||
(
cpu_data
[
i
].
vpe_id
==
cpu_data
[
cpu
].
vpe_id
))
||
(
cpu_data
[
i
].
vpe_id
==
cpu_data
[
cpu
].
vpe_id
))
cpu_context
(
i
,
mm
)
=
0
;
cpu_context
(
i
,
mm
)
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录