i'm experiencing stuttering on a system with >4GB memory, might be related to memory compaction?
braveheartleo
Status: Interested
Joined: 23 Jan 2012
Posts: 43
Reply Quote
I'm experiencing occassional graphical stuttering on my system with 8GB of memory. The stuttering becomes worse if I write (>500MB) files to a slow USB2.0 flash drive. The same stuttering I do not observe on 3 of my other sytems, a laptop with 4GB of memory, and two netbooks with 2GB of memory each.

I observed that the compact_* values in /proc/vmstat on my 8GB system quickly increases compared to the others, and perhaps this could be a hint to why I'm experiencing the stutters.

As an example, my 8GB desktop that is just started and idling sees this:
:: Code ::
$ grep compact /proc/vmstat && sleep 120 && grep compact /proc/vmstat
compact_migrate_scanned 13908
compact_free_scanned 13906
compact_isolated 72155
compact_stall 0
compact_fail 0
compact_success 0
# -- after 120 secs --
compact_migrate_scanned 24911
compact_free_scanned 18270
compact_isolated 93679
compact_stall 0
compact_fail 0
compact_success 0


And these are the details of the desktop:
:: Code ::
$ inxi -bxx
System:    Host: xbox-am1m Kernel: 4.0-0.dmz.2-liquorix-amd64 x86_64 (64 bit gcc: 4.9.2)
           Desktop: Xfce 4.12.0 (Gtk 2.24.27) dm: lightdm Distro: Ubuntu 15.04 vivid
Machine:   System: ASUS product: All Series
           Mobo: ASUSTeK model: AM1M-A v: Rev X.0x Bios: American Megatrends v: 1101 date: 11/25/2014
CPU:       Quad core AMD Athlon 5350 APU with Radeon R3 (-MCP-) speed/max: 800/2100 MHz
Graphics:  Card: Advanced Micro Devices [AMD/ATI] Kabini [Radeon HD 8400 / R3 Series]
           bus-ID: 00:01.0 chip-ID: 1002:9830
           Display Server: X.Org 1.17.1 driver: radeon Resolution: 1440x900@59.9hz
           GLX Renderer: Gallium 0.4 on AMD KABINI
           GLX Version: 3.0 Mesa 10.6.0-devel (git-7f5a8ac 2015-04-25 vivid-oibaf-ppa) Direct Rendering: Yes
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
           driver: r8169 v: 2.3LK-NAPI port: e000 bus-ID: 01:00.0 chip-ID: 10ec:8168
Drives:    HDD Total Size: 1000.2GB (48.9% used)
Info:      Processes: 187 Uptime: 4 min Memory: 351.4/7418.6MB
           Init: systemd v: 219 runlevel: 5 default: 2 Gcc sys: 4.9.2
           Client: Shell (bash 4.3.301 running in xfce4-terminal) inxi: 2.2.19


In contrast, on my 4GB laptop that is just started and idling as well:
:: Code ::
$ grep compact /proc/vmstat && sleep 120 && grep compact /proc/vmstat
compact_migrate_scanned 102
compact_free_scanned 88
compact_isolated 8102
compact_stall 0
compact_fail 0
compact_success 0
# -- after 120 secs --
compact_migrate_scanned 102
compact_free_scanned 88
compact_isolated 8102
compact_stall 0
compact_fail 0
compact_success 0


And these are the details of the laptop:
:: Code ::
$ inxi -bxx
System:    Host: xbook-t61 Kernel: 4.0-0.dmz.2-liquorix-amd64 x86_64 (64 bit gcc: 4.9.2)
           Desktop: Xfce 4.12.0 (Gtk 2.24.27) dm: lightdm Distro: Ubuntu 15.04 vivid
Machine:   System: LENOVO product: 7659AC5 v: ThinkPad T61 Chassis: type: 10
           Mobo: LENOVO model: 7659AC5 Bios: LENOVO v: 7LETC9WW (2.29 ) date: 03/18/2011
CPU:       Dual core Intel Core2 Duo T7300 (-MCP-) speed/max: 1200/2001 MHz
Graphics:  Card: Intel Mobile GM965/GL960 Integrated Graphics Controller (primary)
           bus-ID: 00:02.0 chip-ID: 8086:2a02
           Display Server: X.Org 1.17.1 driver: intel Resolution: 1440x900@60.1hz
           GLX Renderer: Mesa DRI Intel 965GM
           GLX Version: 2.1 Mesa 10.6.0-devel (git-7f5a8ac 2015-04-25 vivid-oibaf-ppa) Direct Rendering: Yes
Network:   Card-1: Intel 82566MM Gigabit Network Connection
           driver: e1000e v: 2.3.2-k port: 1840 bus-ID: 00:19.0 chip-ID: 8086:1049
           Card-2: Intel PRO/Wireless 4965 AG or AGN [Kedron] Network Connection
           driver: iwl4965 v: in-tree: bus-ID: 03:00.0 chip-ID: 8086:4230
Drives:    HDD Total Size: 508.0GB (11.8% used)
Info:      Processes: 180 Uptime: 6 min Memory: 296.9/3883.6MB
           Init: systemd v: 219 runlevel: 5 default: 2 Gcc sys: 4.9.2 alt: 4.6
           Client: Shell (bash 4.3.301 running in xfce4-terminal) inxi: 2.2.16


Would the stutterings I'm observing on my 8GB desktop be related to memory compaction code? How can I minimize the stuttering?

Let me just add that there is no stuttering while using Ubuntu's lowlatency distro kernel. And the compact_* values in /proc/vmstat remain zero.
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 737
Reply Quote
Disabled memory compaction and compression in the latest release, it just occurred to me after this post that those two features take cpu time and can create a more inconsistent experience.

Here's the latest changelog, can you try the latest kernel and see how it works for you?:

:: Code ::
linux-liquorix (4.0-3) unstable; urgency=medium

  * disable compressed page cache (for non-realtime systems)
    - disable CONFIG_ZSMALLOC
    - disable CONFIG_ZBUD
    - disable CONFIG_ZPOOL
    - disable CONFIG_ZSWAP
  * disable Contiguous Memory Allocator (for large non-realtime systems)
    - disable CONFIG_CMA
  * disable memory compaction (for large non-realtime systems)
    - disable CONFIG_BALLOON_COMPACTION
    - disable CONFIG_COMPACTION
    - disable CONFIG_TRANSPARENT_HUGEPAGE (was enabled on x86)
  * enable allocation of 3rd-level pagetables from highmem
    - enable CONFIG_HIGHPTE (x86 only)
  * merge USB and AHCI patches from Matthew Garrett
    - fix poor power consumption on Broadwell systems
    - properly recognize unknown USB ports as fixed
  * merge 4.0.1
  * update version to 1.dmz.1

 -- Steven Barrett <steven@liquorix.net>  Wed, 29 Apr 2015 18:59:37 -0500

Back to top
braveheartleo
Status: Interested
Joined: 23 Jan 2012
Posts: 43
Reply Quote
Hi damentz,

My desktop system now runs smooth as silk without the memory compaction code. Thank you.

Regarding disabling the other kernel configs (CONFIG_ZSWAP, CONFIG_ZSMALLOC, etc) perhaps we could leave those enabled? For example:

* Zswap (CONFIG_ZSWAP) is not used until one passes zswap.enabled=1 to the kernel boot params.

* Zram (CONFIG_ZRAM depends on CONFIG_ZSMALLOC) is not used unless activated in userspace via zram-config (*buntu).

These functions are disabled by default, thereby have no direct effect on latency, and need manual activation (assuming that no kernel config was changed that overrides this behavior). There might be some who are making use of these techniques that serve a purpose [1]. I use zram for the memory constrained devices like my netbooks (because swapping to hdd is much slower compared to a compressed cache in memory).

[1] askubuntu.com/questions/471912/zram-vs-zswap-vs-zcache-ultimate-guide-when-to-use-which-one
Back to top
damentz
Status: Assistant
Joined: 09 Sep 2008
Posts: 737
Reply Quote
Sorry, my mistake, I should have read the descriptions of these options more carefully. Check techpatterns.com/forums/about2444.html for my full response.
Back to top
chunker
Status: Curious
Joined: 22 Sep 2015
Posts: 5
Reply Quote
I just registered here to say thank you for posting this information. I have been experiencing this problem for a while and have never been able to get to the bottom of it. I only really experienced it with large files being transferred to ntfs usb stick and I tried so many things to fix it without any success. I just made the changes outlined in this thread and I can transfer without any glitching or freezing, I cannot believe it!
So, thanks again for the information. I've only just started using the zen patches but I'm very pleased with them so far.
Back to top
Display posts from previous:   

All times are GMT - 8 Hours