Skip to content

Kernel is lagging when copying large files #26

Closed

Description

@StefanescuCristian

I'm building my own kernel from your sources. (4.0/master branch)
I'm only modifying the .config (https://github.com/StefanescuCristian/kernel-pf-ubuntu-build/blob/master/config.ubuntu) to match my needs and the Makefile to make some (unsafe) optimizations.

I've noticed that when using ZEN_INTERACTIVE, when copying large files between disks (internal/usb, it doesn't matter) after some time while the process is running the computer starts to stutter/lag. I can't move my mouse fluently, also the music starts to play with interruptions.

I've tracked down the issue being in setting dirty_background_ratio and dirty_ratio too high.
Leaving them on default will result in a fluent UX while copying files from a disk to another.

I suggest leaving them on default or setting them lower (but not too low too), not higher. (https://bugzilla.kernel.org/show_bug.cgi?id=7372#c11)

Can you try replicating the issue?

Activity

  1. heftig commented on Jul 5, 2015

    @heftig

    True; I've been running with dirty_bytes=256M and dirty_background_bytes=128M for a while here because of this problem. However, I don't know if these are broadly acceptable values and I certainly made no throughput benchmarks.

    @damentz Should we change the interactive config similarly?

  2. heftig commented on Jul 5, 2015

    @heftig

    Okay, I've drastically reduced the dirty limits. Please let me know how well it works.

  3. StefanescuCristian commented on Jul 5, 2015

    @StefanescuCristian
    Author

    Copying the same 3 folders (8.5 GB in total) and doing a find / at the same time, free -m shows only 50MB of free memory (no swap), and everything is smooth.

    I think we can close this. I give you the honor.

  4. weedy commented on Aug 2, 2015

    @weedy

    Just to FYI. I've run dirty_bytes 256MB and dirty_background_bytes 64MB for ages on spinning rust.
    I would think you could double or triple these on SSDs.

    I assume dirty_background_bytes will get flushed in one shot. So I want to keep that within 1-2 seconds based on my max disk bandwidth. dirty_bytes also gets pruned during dirty_expire_centisecs, so that should be long enough to allow for tens of megabytes at a time to be written in chunks.

  5. heftig commented on Aug 2, 2015

    @heftig

    The problem is the slowest storage attached to the system. Apparently USB 2.0 thumbdrives top out at about 20MB/s.

    I think keeping the system usable in a pinch is more important than optimizing throughput. With the old values, I had to hard reboot a system that hung while copying to a USB 3.0 HDD (multiple times).

    In any case, the user can always adjust the values.

  6. weedy commented on Aug 2, 2015

    @weedy

    I agree, that's how I settled on 64MiB.
    Even with that I can still stall my system if I copy enough things concurrently.

    You changing from _ratio to _bytes was the right move.

  7. added a commit that references this issue on Nov 2, 2015
  8. added a commit that references this issue on Dec 17, 2015
  9. added a commit that references this issue on Dec 30, 2015
  10. added a commit that references this issue on Jan 12, 2016
  11. 72 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions