use transparent hugepage
This commit is contained in:
parent
39bc28445b
commit
4cbe134987
|
@ -1,6 +1,9 @@
|
|||
- hosts: all, localhost
|
||||
become: yes
|
||||
vars:
|
||||
audio:
|
||||
source: EasyEffects Source
|
||||
sink: EasyEffects Sink
|
||||
vfio_pci_ids:
|
||||
- '8086:15b8' # Intel Corporation Ethernet Connection (2) I219-V
|
||||
- '1002:731f' # Advanced Micro Devices, Inc. [AMD/ATI] Navi 10 [Radeon RX 5700 / 5700 XT]
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pacman:
|
||||
name:
|
||||
- qemu
|
||||
# - qemu-audio-jack
|
||||
- libvirt
|
||||
- bridge-utils
|
||||
- ovmf
|
||||
|
|
|
@ -14,21 +14,20 @@ prepare() {
|
|||
irq-affinity mask C1-3,5-7 \
|
||||
cpuset-modify --cpus C0,4 /system.slice \
|
||||
cpuset-modify --cpus C0,4 /user.slice \
|
||||
move-tasks / /host.slice \
|
||||
cpu-governor performance C0-7
|
||||
|
||||
for _ in $(seq 5); do
|
||||
sleep 3
|
||||
# assign hugepages
|
||||
sysctl -w vm.nr_hugepages=8192 && break
|
||||
done
|
||||
sleep 10
|
||||
# for _ in $(seq 5); do
|
||||
# sleep 3
|
||||
# # assign hugepages
|
||||
# sysctl -w vm.nr_overcommit_hugepages=8192 && break
|
||||
# done
|
||||
# sleep 10
|
||||
}
|
||||
|
||||
release() {
|
||||
systemctl stop win10-usb
|
||||
vfio-isolate restore /tmp/win10.undo
|
||||
sysctl -w vm.nr_hugepages=0
|
||||
# sysctl -w vm.nr_overcommit_hugepages=0
|
||||
}
|
||||
|
||||
if [ "$1" == "win10" ]; then
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<memory unit='KiB'>16777216</memory>
|
||||
<currentMemory unit='KiB'>16777216</currentMemory>
|
||||
<memoryBacking>
|
||||
<hugepages/>
|
||||
<!-- <hugepages/> -->
|
||||
<locked/>
|
||||
</memoryBacking>
|
||||
<vcpu placement='static'>6</vcpu>
|
||||
|
@ -206,17 +206,26 @@
|
|||
<!-- audio -->
|
||||
<sound model='ich9'>
|
||||
<address type='pci' domain='0x0000' bus='0x02' slot='0x02' function='0x0'/>
|
||||
<codec type='micro'/>
|
||||
<audio id='1'/>
|
||||
</sound>
|
||||
<audio id='1' timerPeriod='40' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
|
||||
<input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
|
||||
<settings frequency='44100' channels='2' format='s16'/>
|
||||
</input>
|
||||
<audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'>
|
||||
<input mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'/>
|
||||
<output mixingEngine='yes' fixedSettings='yes' voices='1' bufferLength='100'>
|
||||
<settings frequency='48000' channels='2' format='f32'/>
|
||||
</output>
|
||||
</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 -->
|
||||
{% for pci_device_id in pci_device_ids %}
|
||||
<hostdev mode='subsystem' type='pci' managed='yes'>
|
||||
|
@ -265,5 +274,7 @@
|
|||
</qemu:override>
|
||||
|
||||
<qemu:commandline>
|
||||
<!-- <qemu:env name="PIPEWIRE_RUNTIME_DIR" value="/run/user/1000"/>
|
||||
<qemu:env name="PIPEWIRE_LATENCY" value="512/48000"/> -->
|
||||
</qemu:commandline>
|
||||
</domain>
|
||||
|
|
Loading…
Reference in New Issue