@@ -88,6 +88,12 @@ fn guess_max_reasonable_parallelism(
88
88
// than the test runner itself. Overprovisioning CPUs will make everyone
89
89
// sad but should not fail tests, at least...
90
90
let lim_by_cpus = online_cpus / cpus_per_runner;
91
+ into ! (
92
+ "parallelism by cpu count: {} ({} / {})" ,
93
+ lim_by_cpus,
94
+ online_cpus,
95
+ cpus_per_runner
96
+ ) ;
91
97
92
98
let ctl = bhyve_api:: VmmCtlFd :: open ( ) ?;
93
99
let reservoir =
@@ -109,7 +115,9 @@ fn guess_max_reasonable_parallelism(
109
115
. try_into ( )
110
116
. expect ( "physical page count is reasonable" ) ;
111
117
112
- let installed_mb = page_size * total_pages;
118
+ const MiB : usize = 1024 * 1024 ;
119
+
120
+ let installed_mb = page_size * total_pages / MiB ;
113
121
// /!\ Arbitrary choice warning /!\
114
122
//
115
123
// It would be a little rude to spawn so many VMs that we cause the
@@ -119,7 +127,7 @@ fn guess_max_reasonable_parallelism(
119
127
// fraction.
120
128
vmm_mem_limit = installed_mb / 4 ;
121
129
122
- eprintln ! (
130
+ warn ! (
123
131
"phd-runner sees the VMM reservior is unconfigured, and will use \
124
132
up to 25% of system memory ({}MiB) for test VMs. Please consider \
125
133
using `cargo run --bin rsrvrctl set <size MiB>` to set aside \
@@ -129,6 +137,12 @@ fn guess_max_reasonable_parallelism(
129
137
}
130
138
131
139
let lim_by_mem = vmm_mem_limit / memory_mib_per_runner;
140
+ into ! (
141
+ "parallelism by memory: {} ({} / {})" ,
142
+ lim_by_mem,
143
+ vmm_mem_limit,
144
+ memory_mib_per_runner
145
+ ) ;
132
146
133
147
Ok ( std:: cmp:: min ( lim_by_cpus as u16 , lim_by_mem as u16 ) )
134
148
}
0 commit comments