Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadbalance pr1 #89

Open
wants to merge 72 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
080b1b3
添加负载均衡功能,支持线程窃取和每个线程在生成时选择队列,还在调
githubmomoko May 13, 2023
417b2d7
正在调试
githubmomoko May 13, 2023
62513ab
放弃了“
githubmomoko May 19, 2023
eccb447
qwq
githubmomoko May 20, 2023
e093737
第一个 bug“
githubmomoko May 20, 2023
4b1bb47
看起来能窃取了,还有 bug“
githubmomoko May 20, 2023
042b8dc
qwq
githubmomoko May 20, 2023
5fd9158
修改前暂存
githubmomoko May 20, 2023
f663052
没有 irq 的版本修好了
githubmomoko May 20, 2023
c793681
bug 修好了,现在跑 parallel 能正确多核并行
githubmomoko May 20, 2023
4999dbd
bug 修好了,现在跑 parallel 能正确多核并行
githubmomoko May 20, 2023
0a53eaa
尝试修改 preempt 相关,还没调完
githubmomoko May 20, 2023
ba1d10d
修改了一下 unbalance 测例
githubmomoko May 20, 2023
af7b596
修改了一点测例
githubmomoko May 20, 2023
73cffc0
暂存
githubmomoko May 24, 2023
b6f862d
暂存
githubmomoko May 25, 2023
bbeaea0
qwq
githubmomoko May 25, 2023
2a87244
暂存
githubmomoko May 26, 2023
a3a0495
MLE:喵喵喵?
githubmomoko May 26, 2023
c30f093
暂存
githubmomoko May 26, 2023
8f2cb3e
暂存
githubmomoko May 26, 2023
fb4f37c
暂存
githubmomoko May 26, 2023
19b1a77
暂存
githubmomoko May 26, 2023
43ba660
我的 resched 被 DDoS 了 qwq
githubmomoko May 27, 2023
6b6cf14
我的 resched 被 DDoS 了 qwq
githubmomoko May 27, 2023
8915476
我的 resched 被 DDoS 了 qwq
githubmomoko May 27, 2023
aa9f753
好歹调通双核了
githubmomoko May 27, 2023
0543458
好歹调通单核了
githubmomoko May 27, 2023
957daaa
暂存:
githubmomoko May 27, 2023
e2f8e9f
弃疗了
githubmomoko May 27, 2023
c3f218a
bug修复
githubmomoko May 28, 2023
8b5bf74
增加笔记
githubmomoko Jun 2, 2023
ef197b8
Merge remote-tracking branch 'upstream/main' into loadbalance_new
githubmomoko Jun 2, 2023
2b8bbb3
完成 unbalance 测例,测试得到,在四核和 unbalance 测例的设定下,线程窃取能增加 10%的性能
githubmomoko Jun 2, 2023
fd196c5
添加 wakeup 测例
githubmomoko Jun 2, 2023
f41087d
调整 wakeup 测例
githubmomoko Jun 2, 2023
23129f7
wakeup?
githubmomoko Jun 2, 2023
caf50e4
Merge remote-tracking branch 'upstream/main' into loadbalance_new
githubmomoko Jun 2, 2023
79ba3bc
添加测试
githubmomoko Jun 2, 2023
c23c3d6
修改一些格式
githubmomoko Jun 2, 2023
f3681f0
remove qwq.txt
githubmomoko Jun 2, 2023
7488c42
delete some files
githubmomoko Jun 2, 2023
0a50cb3
OK
githubmomoko Jun 2, 2023
e805a74
fix some ci
githubmomoko Jun 3, 2023
27541a0
暂存
githubmomoko Jun 4, 2023
9560932
修复 yield test 触发的 bug
githubmomoko Jun 4, 2023
7b1deb0
???
githubmomoko Jun 5, 2023
1061277
修了一个大 bug
githubmomoko Jun 6, 2023
844ad5e
暂存“
githubmomoko Jun 6, 2023
a7a11f9
qwq
githubmomoko Jun 6, 2023
0e5f123
Merge branch 'main' into loadbalance_pr1
equation314 Jun 6, 2023
41167ab
format some codes
equation314 Jun 6, 2023
2c1980e
修改成闭包形式,不知道对不对
githubmomoko Jun 6, 2023
a293812
Merge branch 'loadbalance_pr1' of github.com:131131yhx/arceos into lo…
githubmomoko Jun 6, 2023
e634133
除了 priority 似乎没问题?刚才可能是电脑坏了
githubmomoko Jun 6, 2023
2822e4f
fix bug
githubmomoko Jun 7, 2023
c1a97a3
???
githubmomoko Jun 7, 2023
73e641e
大改前更新
githubmomoko Jun 7, 2023
b7e8443
fix ci, close threadsteal
githubmomoko Jun 7, 2023
0bbb6f4
check gc task
githubmomoko Jun 7, 2023
604df8d
gc task problem fixed
githubmomoko Jun 7, 2023
f115677
fix format
githubmomoko Jun 7, 2023
54f3519
暂存
githubmomoko Jun 7, 2023
468ce47
暂存“
githubmomoko Jun 7, 2023
8a39025
enlarge stack size in axtask/tests.rs
githubmomoko Jun 7, 2023
59856e5
enlarge stack size in axtask/tests.rs
githubmomoko Jun 7, 2023
3f5c541
fix clippy
githubmomoko Jun 7, 2023
38edaa0
fix format
githubmomoko Jun 7, 2023
99678e5
fix format
githubmomoko Jun 7, 2023
bfde7ab
shrink stack size in axconfig
githubmomoko Jun 7, 2023
e811f36
remove a flag check in if_empty_steal
githubmomoko Jun 8, 2023
5e23df0
fix ci
githubmomoko Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"apps/task/sleep",
"apps/task/yield",
"apps/task/priority",
"apps/task/unbalance",

"crates/allocator",
"crates/arm_gic",
Expand Down
8 changes: 7 additions & 1 deletion apps/net/httpserver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@ authors = ["Yuekai Jia <[email protected]>"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["libax/default"]
sched_cfs = ["libax/sched_cfs"]
sched_rr = ["libax/sched_rr"]
sched_fifo = ["libax/sched_fifo"]

[dependencies]
libax = { path = "../../../ulib/libax", features = ["paging", "multitask", "net"] }
libax = { path = "../../../ulib/libax", default-features = false, features = ["paging", "multitask", "net", "irq"] }
1 change: 1 addition & 0 deletions apps/task/parallel/expect_info_smp1_fifo.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use FIFO scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Primary CPU 0 init OK.
part 0: TaskId(4) \[0, 125000)
Expand Down
62 changes: 62 additions & 0 deletions apps/task/parallel/expect_info_smp4_cfs.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
smp = 4
build_mode = release
log_level = info

CPU 0 started
Found physcial memory regions:
.text (READ | EXECUTE | RESERVED)
.rodata (READ | RESERVED)
.data (READ | WRITE | RESERVED)
.percpu (READ | WRITE | RESERVED)
boot stack (READ | WRITE | RESERVED)
.bss (READ | WRITE | RESERVED)
free memory (READ | WRITE | FREE)
Initialize global memory allocator...
Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use Completely Fair scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
CPU 0 init OK
CPU 1 started
CPU 2 started
CPU 3 started
CPU 1 init OK
CPU 2 init OK
CPU 3 init OK
part 0: TaskId([0-9]\+) \[0, 125000)
part 1: TaskId([0-9]\+) \[125000, 250000)
part 2: TaskId([0-9]\+) \[250000, 375000)
part 3: TaskId([0-9]\+) \[375000, 500000)
part 4: TaskId([0-9]\+) \[500000, 625000)
part 5: TaskId([0-9]\+) \[625000, 750000)
part 6: TaskId([0-9]\+) \[750000, 875000)
part 7: TaskId([0-9]\+) \[875000, 1000000)
part 8: TaskId([0-9]\+) \[1000000, 1125000)
part 9: TaskId([0-9]\+) \[1125000, 1250000)
part 10: TaskId([0-9]\+) \[1250000, 1375000)
part 11: TaskId([0-9]\+) \[1375000, 1500000)
part 12: TaskId([0-9]\+) \[1500000, 1625000)
part 13: TaskId([0-9]\+) \[1625000, 1750000)
part 14: TaskId([0-9]\+) \[1750000, 1875000)
part 15: TaskId([0-9]\+) \[1875000, 2000000)
part 15: TaskId([0-9]\+) finished
part 0: TaskId([0-9]\+) finished
part 1: TaskId([0-9]\+) finished
part 2: TaskId([0-9]\+) finished
part 3: TaskId([0-9]\+) finished
part 4: TaskId([0-9]\+) finished
part 5: TaskId([0-9]\+) finished
part 6: TaskId([0-9]\+) finished
part 7: TaskId([0-9]\+) finished
part 8: TaskId([0-9]\+) finished
part 9: TaskId([0-9]\+) finished
part 10: TaskId([0-9]\+) finished
part 11: TaskId([0-9]\+) finished
part 12: TaskId([0-9]\+) finished
part 13: TaskId([0-9]\+) finished
part 14: TaskId([0-9]\+) finished
sum = 61783189038
Parallel summation tests run OK!
Shutting down...
1 change: 1 addition & 0 deletions apps/task/parallel/expect_info_smp4_rr.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use Round-robin scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
CPU 0 init OK
CPU 1 started
Expand Down
1 change: 1 addition & 0 deletions apps/task/parallel/test_cmd
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
test_one "LOG=info" "expect_info_smp1_fifo.out"
test_one "SMP=4 LOG=info APP_FEATURES=sched_rr" "expect_info_smp4_rr.out"
test_one "SMP=4 LOG=info APP_FEATURES=sched_cfs" "expect_info_smp4_cfs.out"
1 change: 1 addition & 0 deletions apps/task/priority/expect_info_smp1_cfs.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Initialize global memory allocator...
Initialize kernel page table...
Initialize scheduling...
use Completely Fair scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Primary CPU 0 init OK.
part 0: TaskId(4) \[0, 40)
Expand Down
1 change: 1 addition & 0 deletions apps/task/priority/expect_info_smp1_fifo.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Initialize global memory allocator...
Initialize kernel page table...
Initialize scheduling...
use FIFO scheduler.
use basic method load balance manager.
Primary CPU 0 init OK.
part 0: TaskId(4) \[0, 40)
part 0: TaskId(4) finished
Expand Down
1 change: 1 addition & 0 deletions apps/task/priority/expect_info_smp1_rr.out
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Initialize global memory allocator...
Initialize kernel page table...
Initialize scheduling...
use Round-robin scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Primary CPU 0 init OK.
part 0: TaskId(4) \[0, 40)
Expand Down
11 changes: 6 additions & 5 deletions apps/task/priority/expect_info_smp4_cfs.out
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ Initialize global memory allocator...
Initialize kernel page table...
Initialize scheduling...
use Completely Fair scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Primary CPU [0-9]\+ init OK.
part 0: TaskId(7) \[0, 40)
part 1: TaskId(8) \[0, 40)
part 2: TaskId(9) \[0, 40)
part 3: TaskId(10) \[0, 40)
part 4: TaskId(11) \[0, 4)
part [0-9]\+: TaskId([0-9]\+) \[0, 40)
part [0-9]\+: TaskId([0-9]\+) \[0, 40)
part [0-9]\+: TaskId([0-9]\+) \[0, 40)
part [0-9]\+: TaskId([0-9]\+) \[0, 40)
part [0-9]\+: TaskId([0-9]\+) \[0, 4)
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
Expand Down
1 change: 1 addition & 0 deletions apps/task/sleep/expect_info_smp4_fifo.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use FIFO scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Hello, main task!
main task sleep for 1\.[0-9]\+s
Expand Down
1 change: 1 addition & 0 deletions apps/task/sleep/expect_info_smp4_rr.out
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use Round-robin scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Hello, main task!
main task sleep for 1\.[0-9]\+s
Expand Down
16 changes: 16 additions & 0 deletions apps/task/unbalance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "arceos-unbalance"
version = "0.1.0"
edition = "2021"
authors = ["Haoxing Ye <[email protected]>"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
default = ["libax/default"]
sched_cfs = ["libax/sched_cfs"]
sched_rr = ["libax/sched_rr"]
sched_fifo = ["libax/sched_fifo"]

[dependencies]
libax = { path = "../../../ulib/libax", default-features = false, features = ["alloc", "paging", "multitask", "irq"] }
101 changes: 101 additions & 0 deletions apps/task/unbalance/expect_info_smp1_cfs.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
smp = 1
build_mode = release
log_level = info

Primary CPU 0 started,
Found physcial memory regions:
.text (READ | EXECUTE | RESERVED)
.rodata (READ | RESERVED)
.data (READ | WRITE | RESERVED)
.percpu (READ | WRITE | RESERVED)
boot stack (READ | WRITE | RESERVED)
.bss (READ | WRITE | RESERVED)
free memory (READ | WRITE | FREE)
Initialize global memory allocator...
Initialize kernel page table...
Initialize platform devices...
Initialize scheduling...
use Completely Fair scheduler.
use basic method load balance manager.
Initialize interrupt handlers...
Primary CPU 0 init OK.
part 24: TaskId(4) [0, 30)
part 23: TaskId(5) [0, 30)
part 22: TaskId(6) [0, 25)
part 21: TaskId(7) [0, 20)
part 20: TaskId(8) [0, 15)
part 19: TaskId(9) [0, 10)
part 18: TaskId(10) [0, 9)
part 17: TaskId(11) [0, 8)
part 16: TaskId(12) [0, 7)
part 15: TaskId(13) [0, 6)
part 14: TaskId(14) [0, 5)
part 13: TaskId(15) [0, 4)
part 12: TaskId(16) [0, 3)
part 11: TaskId(17) [0, 2)
part 10: TaskId(18) [0, 5)
part 9: TaskId(19) [0, 5)
part 8: TaskId(20) [0, 5)
part 7: TaskId(21) [0, 5)
part 6: TaskId(22) [0, 5)
part 5: TaskId(23) [0, 5)
part 4: TaskId(24) [0, 5)
part 3: TaskId(25) [0, 5)
part 2: TaskId(26) [0, 5)
part 1: TaskId(27) [0, 5)
part 0: TaskId(28) [0, 100)
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
part [0-9]\+: TaskId([0-9]\+) finished
sum = 5310778284
leave time:
task 0 =
task 1 =
task 2 =
task 3 =
task 4 =
task 5 =
task 6 =
task 7 =
task 8 =
task 9 =
task 10 =
task 11 =
task 12 =
task 13 =
task 14 =
task 15 =
task 16 =
task 17 =
task 18 =
task 19 =
task 20 =
task 21 =
task 22 =
task 23 =
task 24 =
leave time max:
Unbalance tests run OK!
Shutting down...
Loading