@@ -205,7 +205,7 @@ Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
205
205
Set fixed amount of cores, topology and pin cores to best die layout; for ` AMD Ryzen 7 3700X 8-Core Processor ` it is
206
206
207
207
``` xml
208
- <vcpu placement =" static" >8</vcpu >
208
+ <vcpu placement =" static" cpuset = " 8-15 " >8</vcpu >
209
209
<iothreads >2</iothreads >
210
210
<cputune >
211
211
<vcpupin vcpu =" 0" cpuset =" 8" />
@@ -234,10 +234,81 @@ and
234
234
235
235
This config maps the last 8 cores to the Windows guest.
236
236
237
+ For hugepages support add or adjust:
238
+
239
+ ``` xml
240
+ <memoryBacking >
241
+ <hugepages >
242
+ <page size =" 2048" unit =" KiB" />
243
+ </hugepages >
244
+ <access mode =" shared" />
245
+ </memoryBacking >
246
+ ```
247
+
237
248
### Host configuration
238
249
250
+ #### Hugepages
251
+
252
+ ``` bash
253
+ grep Hugepagesize /proc/meminfo
254
+ Hugepagesize: 2048 kB
255
+ ```
256
+
257
+ So a value of ` 8192 ` pages at a page size of 2MB equals ** 16GB of RAM reserved** for hugepages.
258
+
259
+ ``` ini
260
+ GRUB_CMDLINE_LINUX_DEFAULT =" ... hugepages=8192"
261
+ ```
262
+
263
+ ` /etc/sysctl.conf `
264
+
265
+ ``` ini
266
+ kernel.shmmax = 17179869184
267
+ vm.nr_hugepages = 8192
268
+ vm.min_free_kbytes = 112640
269
+ vm.hugetlb_shm_group = 1000
270
+ ```
271
+
272
+ #### CPU Governor on performance mode
273
+
239
274
``` bash
240
275
echo ' KERNEL=="cpu8|cpu9|cpu10|cpu11|cpu12|cpu13|cpu14|cpu15", SUBSYSTEM=="cpu", ACTION=="add", ATTR{cpufreq/scaling_governor}="performance"' | sudo tee /etc/udev/rules.d/90-scaling-governor-performance.rules
241
276
# reboot, then confirm changes with
242
277
cat /sys/devices/system/cpu/cpu* /cpufreq/scaling_governor
243
278
```
279
+
280
+ #### Isolate CPU cores from scheduler
281
+
282
+ > Do more testing if this is beneficial or worse for both host and VM performance
283
+
284
+ ``` bash
285
+ sudo vim /etc/default/grub
286
+ ```
287
+
288
+ ``` bash
289
+ GRUB_CMDLINE_LINUX_DEFAULT=" ... isolcpus=8-15"
290
+ ```
291
+
292
+ ``` bash
293
+ sudo update-grub
294
+ ```
295
+
296
+ Reboot to activate.
297
+
298
+ #### IRQL re-balance
299
+
300
+ ` /etc/default/irqbalance `
301
+
302
+ ``` ini
303
+ IRQBALANCE_BANNED_CPULIST =8-15
304
+ ```
305
+
306
+ ``` bash
307
+ sudo systemctl restart irqbalance
308
+ ```
309
+
310
+ ## Resources
311
+
312
+ - [ Sharing files with Virtiofs] ( https://libvirt.org/kbase/virtiofs.html )
313
+ - [ How to install virtiofs drivers on Windows] ( https://virtio-fs.gitlab.io/howto-windows.html )
314
+ - [ WinFsp] ( https://winfsp.dev/rel/ )
0 commit comments