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