Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heavy slow down in graphical applications #8

Closed
nottux opened this issue Jan 13, 2018 · 15 comments
Closed

Heavy slow down in graphical applications #8

nottux opened this issue Jan 13, 2018 · 15 comments

Comments

@nottux
Copy link

nottux commented Jan 13, 2018

When i was playing bombsquad, i have noticed frame drops (from stable 60 fps to 40 fps)
and happened on xonotic too (from benchmark, minimum fps was 48, now 24)
cpu and memory usage is minimal, same as before
while searching in the internet i have found https://security.stackexchange.com/questions/176624/how-do-i-check-if-kpti-is-enabled-on-linux/176654 but it didn't worked so i don't know if its enabled or not
also i found https://askubuntu.com/questions/991874/how-to-disable-page-table-isolation-to-regain-performance-lost-due-to-intel-cpu but since i don't have grub, i assume that i will need to create a file in /etc/kernel/cmdline.d with .conf extension and put pti=off line into it and reboot. I couldn't find any documentary about it
i have intel core i3 i3-380M processor with integrated graphics

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ sudo swupd bundle-list
swupd-client bundle list 3.14.3
   Copyright (C) 2012-2017 Intel Corporation

R-basic
bootloader
c-basic
clr-devops
cryptography
database-basic
desktop
desktop-apps
desktop-apps-extras
desktop-assets
desktop-autostart
desktop-dev
desktop-gnomelibs
desktop-locales
dev-utils
dev-utils-dev
editors
editors-dev
games
games-dev
go-basic
java-basic
kernel-native
koji
kvm-host
libX11client
machine-learning-basic
mail-utils
mail-utils-dev
mixer
network-basic
network-basic-dev
openssh-server
os-clr-on-clr
os-core
os-core-dev
os-core-update
os-core-update-dev
os-installer
os-testsuite
os-testsuite-phoronix
os-utils-gui
os-utils-gui-dev
perl-basic
perl-basic-dev
php-basic
python-basic
python-basic-dev
python-extras
python3-basic
ruby-basic
rust-basic
shells
storage-utils
storage-utils-dev
sysadmin-basic
sysadmin-basic-dev
tcl-basic
telemetrics
user-basic
user-basic-dev
web-server-basic
xfce4-desktop
Current OS version: 20320
@nottux
Copy link
Author

nottux commented Jan 13, 2018

doing it didn't affect anything

@nottux nottux changed the title How i can disable KPTI Graphical slow down in applications Jan 13, 2018
@nottux
Copy link
Author

nottux commented Jan 16, 2018

I can confirm the frame drops no matter which desktop environment i am using, i can't find any workarounds

@nottux nottux changed the title Graphical slow down in applications Heavy slow down in graphical applications Jan 16, 2018
@nottux
Copy link
Author

nottux commented Jan 16, 2018

I have uploaded videos to proof it:
Before slowdown:
Youtube: https://youtu.be/oA6yGPHFGrI , Google Drive: https://drive.google.com/open?id=1jkQCTjTWcI6q8jb4X5UO_qqO1VT-N_BJ
After slowdown:
Youtube: https://youtu.be/9QIlXvdvlIc , Google Drive: https://drive.google.com/open?id=1tCWHQysW8tBzqfu5DIDpksWLHJ7dDgry

Note: after slowdown, cpu usage for recording increased too but cpu usage never hit %60 or more in both situations

@nottux
Copy link
Author

nottux commented Jan 16, 2018

output of: cat /proc/cpuinfo

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ cat /proc/cpuinfo
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i3 CPU       M 380  @ 2.53GHz
stepping	: 5
microcode	: 0x4
cpu MHz		: 1294.824
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm retpoline tpr_shadow vnmi flexpriority ept vpid dtherm arat
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5066.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i3 CPU       M 380  @ 2.53GHz
stepping	: 5
microcode	: 0x4
cpu MHz		: 1470.358
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 2
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm retpoline tpr_shadow vnmi flexpriority ept vpid dtherm arat
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5066.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 2
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i3 CPU       M 380  @ 2.53GHz
stepping	: 5
microcode	: 0x4
cpu MHz		: 1807.030
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 2
apicid		: 4
initial apicid	: 4
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm retpoline tpr_shadow vnmi flexpriority ept vpid dtherm arat
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5066.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

processor	: 3
vendor_id	: GenuineIntel
cpu family	: 6
model		: 37
model name	: Intel(R) Core(TM) i3 CPU       M 380  @ 2.53GHz
stepping	: 5
microcode	: 0x4
cpu MHz		: 1679.491
cache size	: 3072 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 2
apicid		: 5
initial apicid	: 5
fpu		: yes
fpu_exception	: yes
cpuid level	: 11
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm retpoline tpr_shadow vnmi flexpriority ept vpid dtherm arat
bugs		: cpu_meltdown spectre_v1 spectre_v2
bogomips	: 5066.80
clflush size	: 64
cache_alignment	: 64
address sizes	: 36 bits physical, 48 bits virtual
power management:

I gues bugs : cpu_meltdown spectre_v1 spectre_v2 says that meltdown and spectre patches enabled, but it musn't effecting graphical rendering i gues.
Output of dmesg:
dmesg.txt

@ahkok
Copy link
Contributor

ahkok commented Jan 16, 2018

the nopti options appears to be the correct one, according to the sources. Try passing it as a boot option directly, and verifying that /proc/cmdline shows it is properly passed after booting.

@nottux
Copy link
Author

nottux commented Jan 17, 2018

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ cat /proc/cmdline
root=PARTUUID=4b6713b2-0264-4009-b7f0-2914031f51f8 quiet modprobe.blacklist=ccipciedrv,aalbus,aalrms,aalrmc console=tty0 console=ttyS0,115200n8 init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp kvm-intel.nested=1 rootfstype=ext4,btrfs,xfs intel_iommu=igfx_off cryptomgr.notests rcupdate.rcu_expedited=1 i915.fastboot=1 rcu_nocbs=0-64 rw pti=off

pti=off

seems to me i havve passed pti=off option successfully but i will try nopti too

@nottux
Copy link
Author

nottux commented Jan 17, 2018

I have changed pti=off to nopti via these commands:

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ ls /etc/kernel/cmdline.d
my.conf
utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ sudo su -c 'echo nopti > /etc/kernel/cmdline.d/my.conf; chmod 777 /etc/kernel/cmdline.d/my.conf'
Password: 

i will reboot and see the results
UPDATE:
nopti didn't passed and i forget to run sudo clr-boot-manager update, i will rebbot and see the results

@nottux
Copy link
Author

nottux commented Jan 17, 2018

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ cat /proc/cmdline
root=PARTUUID=4b6713b2-0264-4009-b7f0-2914031f51f8 quiet modprobe.blacklist=ccipciedrv,aalbus,aalrms,aalrmc console=tty0 console=ttyS0,115200n8 init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp kvm-intel.nested=1 rootfstype=ext4,btrfs,xfs intel_iommu=igfx_off cryptomgr.notests rcupdate.rcu_expedited=1 i915.fastboot=1 rcu_nocbs=0-64 rw nopti

i did passed nopti successfully and rebooted but frame rates were same , still 20fps lower than before

@nottux
Copy link
Author

nottux commented Jan 17, 2018

I have uploaded https://drive.google.com/open?id=1jkQCTjTWcI6q8jb4X5UO_qqO1VT-N_BJ at 3 January 2018, so that eliminates the updates before 3 January 2018

@fenrus75
Copy link
Contributor

fenrus75 commented Jan 17, 2018 via email

@nottux
Copy link
Author

nottux commented Jan 17, 2018

after adding that file you need to run 'clr-boot-manager update' to have it update the bootloader

i did runned the clr-boot-manager update

UPDATE:
nopti didn't passed and i forget to run sudo clr-boot-manager update, i will rebbot and see the results

@nottux
Copy link
Author

nottux commented Jan 17, 2018

utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ cat /proc/cmdline
root=PARTUUID=4b6713b2-0264-4009-b7f0-2914031f51f8 quiet modprobe.blacklist=ccipciedrv,aalbus,aalrms,aalrmc console=tty0 console=ttyS0,115200n8 init=/usr/lib/systemd/systemd-bootchart initcall_debug tsc=reliable no_timer_check noreplace-smp kvm-intel.nested=1 rootfstype=ext4,btrfs,xfs intel_iommu=igfx_off cryptomgr.notests rcupdate.rcu_expedited=1 i915.fastboot=1 rcu_nocbs=0-64 rw nopti noibrs noibpb
utku@clr-449e9b2a44f8458bb4885604dc172a1c ~ $ sudo '/home/utku/Desktop/spectre-meltdown-checker.sh'
Password: 
Spectre and Meltdown mitigation detection tool v0.23

Checking for vulnerabilities against live running kernel Linux 4.14.13-509.native #1 SMP Sat Jan 13 15:03:45 UTC 2018 x86_64

CVE-2017-5753 [bounds check bypass] aka 'Spectre Variant 1'
* Checking count of LFENCE opcodes in kernel:  UNKNOWN  (couldn't find your kernel image in /boot, if you used netboot, this is normal)
> STATUS:  UNKNOWN  (impossible to check )

CVE-2017-5715 [branch target injection] aka 'Spectre Variant 2'
* Mitigation 1
*   Hardware (CPU microcode) support for mitigation:  NO 
*   Kernel support for IBRS:  NO 
*   IBRS enabled for Kernel space:  NO 
*   IBRS enabled for User space:  NO 
* Mitigation 2
*   Kernel compiled with retpoline option:  UNKNOWN  (couldn't read your kernel configuration)
*   Kernel compiled with a retpoline-aware compiler:  NO 
> STATUS:  VULNERABLE  (IBRS hardware + kernel support OR kernel with retpoline are needed to mitigate the vulnerability)

CVE-2017-5754 [rogue data cache load] aka 'Meltdown' aka 'Variant 3'
* Kernel supports Page Table Isolation (PTI):  NO 
* PTI enabled and active:  NO 
> STATUS:  VULNERABLE  (PTI is needed to mitigate the vulnerability)

A false sense of security is worse than no security at all, see --disclaimer

I have passed nopti noibrs noibpb this time but i still having 20fps frame drop. meltdown and spectre patches musn't drop graphical performance so much

@ahkok
Copy link
Contributor

ahkok commented Jan 17, 2018

If you're going to disable security precautions in your kernel, you are at risk of exposing yourself to the vulnerabilities that they protect against. We strongly advise against doing doing that.

@ahkok
Copy link
Contributor

ahkok commented Jan 17, 2018

Since your original issue was about passing a kernel commandline option, which seems resolved, I'm tempted to close this issue.

@nottux nottux closed this as completed Jan 17, 2018
@nottux
Copy link
Author

nottux commented Jan 17, 2018

I have opened a new issue about frame drops in graphical applications: #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants