fstrim slows down mixed ssd/hdd considerable

Bug #1393335 reported by Michael Vogt
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
util-linux (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I have a ssd/hdd system where the ssd is used for the system and most of home is on a large hdd.

I noticed that the weekly fstrim cron job slows the system down considerable, including e.g. firefox and
the desktop. iotop reports:
"""
otal DISK READ : 0.00 B/s | Total DISK WRITE : 0.00 B/s
Actual DISK READ: 0.00 B/s | Actual DISK WRITE: 7.71 K/s
 TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
24504 be/4 root 0.00 B/s 0.00 B/s 0.00 % 99.99 % fstrim --all
"""

So hardly any real io activity but still massive slowdown with 3.16.0-24-generic.

E.g. a dpkg operation while fstrim is running:
"""
# time dpkg -i 2vcard_0.5-3_all.deb
real 0m8.221s
user 0m0.895s
sys 0m0.671s

# time dpkg -i 2vcard_0.5-3_all.deb
real 0m8.215s
user 0m0.895s
sys 0m0.705s

# killall fstrim
# time dpkg -i 2vcard_0.5-3_all.deb
real 0m2.023s
user 0m0.992s
sys 0m0.703s

# time dpkg -i 2vcard_0.5-3_all.deb
real 0m1.709s
user 0m0.958s
sys 0m0.738s
"""

This may of course be simply a kernel problem but I do get similar result for both 3.16 and 3.13.

Michael Vogt (mvo)
description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

It's not really that surprising -- it needs to iterate over the mounts, find free blocks, and tell the disk controller to trim them; on a developer machine where there is usually a lot of data turnaround over a week, this usually has to process dozens of GB.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in util-linux (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.