1
0
Fork 0

use transparent hugepage

This commit is contained in:
Massaki Archambault 2022-08-30 00:40:49 -04:00
parent 39bc28445b
commit 4cbe134987
4 changed files with 27 additions and 13 deletions

View File

@ -1,6 +1,9 @@
- hosts: all, localhost - hosts: all, localhost
become: yes become: yes
vars: vars:
audio:
source: EasyEffects Source
sink: EasyEffects Sink
vfio_pci_ids: vfio_pci_ids:
- '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V - '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V
- '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT] - '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]

View File

@ -2,6 +2,7 @@
pacman: pacman:
name: name:
- qemu - qemu
# - qemu-audio-jack
- libvirt - libvirt
- bridge-utils - bridge-utils
- ovmf - ovmf

View File

@ -14,21 +14,20 @@ prepare() {
irq-affinity mask C1-3,5-7 \ irq-affinity mask C1-3,5-7 \
cpuset-modify --cpus C0,4 /system.slice \ cpuset-modify --cpus C0,4 /system.slice \
cpuset-modify --cpus C0,4 /user.slice \ cpuset-modify --cpus C0,4 /user.slice \
move-tasks / /host.slice \
cpu-governor performance C0-7 cpu-governor performance C0-7
for _ in $(seq 5); do # for _ in $(seq 5); do
sleep 3 # sleep 3
# assign hugepages # # assign hugepages
sysctl -w vm.nr_hugepages=8192 && break # sysctl -w vm.nr_overcommit_hugepages=8192 && break
done # done
sleep 10 # sleep 10
} }
release() { release() {
systemctl stop win10-usb systemctl stop win10-usb
vfio-isolate restore /tmp/win10.undo vfio-isolate restore /tmp/win10.undo
sysctl -w vm.nr_hugepages=0 # sysctl -w vm.nr_overcommit_hugepages=0
} }
if [ "$1" == "win10" ]; then if [ "$1" == "win10" ]; then

View File

@ -9,7 +9,7 @@
<memory unit='KiB'>16777216</memory> <memory unit='KiB'>16777216</memory>
<currentMemory unit='KiB'>16777216</currentMemory> <currentMemory unit='KiB'>16777216</currentMemory>
<memoryBacking> <memoryBacking>
<hugepages/> <!-- <hugepages/> -->
<locked/> <locked/>
</memoryBacking> </memoryBacking>
<vcpu placement='static'>6</vcpu> <vcpu placement='static'>6</vcpu>
@ -206,16 +206,25 @@
<!-- audio --> <!-- audio -->
<sound model='ich9'> <sound model='ich9'>
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/> <address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
<codec type='micro'/>
<audio id='1'/> <audio id='1'/>
</sound> </sound>
<audio id='1' timerPeriod='40' type='pulseaudio' serverName='/run/user/1000/pulse/native'> <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
<input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'> <input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'/>
<settings frequency='44100' channels='2' format='s16'/>
</input>
<output mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'> <output mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
<settings frequency='48000' channels='2' format='f32'/> <settings frequency='48000' channels='2' format='f32'/>
</output> </output>
</audio> </audio>
<!-- <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
<input mixingEngine='no'/>
<output mixingEngine='no'/>
</audio> -->
<!-- <audio id='1' type='jack'>
<input clientName="win10" connectPorts="{{ audio.source }}"/>
<output clientName="win10" connectPorts="{{ audio.sink }}"/>
</audio> -->
<!-- pci passthrough --> <!-- pci passthrough -->
{% for pci_device_id in pci_device_ids %} {% for pci_device_id in pci_device_ids %}
@ -265,5 +274,7 @@
</qemu:override> </qemu:override>
<qemu:commandline> <qemu:commandline>
<!-- <qemu:env name="PIPEWIRE_RUNTIME_DIR" value="/run/user/1000"/>
<qemu:env name="PIPEWIRE_LATENCY" value="512/48000"/> -->
</qemu:commandline> </qemu:commandline>
</domain> </domain>