Poor hard disk performance under kernel 4.15 series (HWE stack)

Bug #1793013 reported by indigocat
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-signed-hwe (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hi!

I've noticed that the disk I/O performance has dropped in the 4.15 series (Ubuntu 16.04 HWE), at least on mechanical hard drives; I'm working on an early Thinkpad T410s with 4Gb of RAM and a 1.8" 250Gb microSATA Toshiba hard drive.

Both 4.4 (lts-xenial) and 4.18 (liquorix) series are better performing than the 4.15 series, which shows a lot of r/w activity during application startup in comparison to the aforementioned kernels.

I've run some primitive benchmarks on all 3 kernel series, 3 passes each, showing the following average rates:

# Kernel 4.15.0-34
## I/O Scheduler: [deadline]
### $ time sh -c "dd if=/dev/zero of=testfile bs=1024k count=1k && sync && rm -f testfile"
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 29,1757 s, 36,8 MB/s
sh -c 0,01s user 1,33s system 4% cpu 31,724 total

# Kernel 4.18-liquorix (https://liquorix.net)
## I/O Scheduler: [deadline]
### time sh -c "dd if=/dev/zero of=testfile bs=1024k count=1k && sync && rm -f testfile"
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 23,7735 s, 45,2 MB/s
sh -c 0,15s user 1,25s system 4% cpu 28,193 total

# Kernel 4.4 lts-xenial
## I/O Scheduler: [deadline]
### $ time sh -c "dd if=/dev/zero of=testfile bs=1024k count=1k && sync && rm -f testfile"
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 23,9265 s, 44,9 MB/s
sh -c 0,00s user 1,68s system 5% cpu 32,312 total

As you can see, disk I/O is quite similar on both 4.4 and 4.18 series, but drops over a 25% on kernel 4.15.

It may not be noticeable on a modern machine with SSD drives, but it's quite a drag on mechanical drives. Even opening Emacs+Spacemacs takes over a minute under kernel 4.15, in contrast to the 20+ seconds under kernels 4.4 and 4.18-liquorix.

What further information would you need from me to pinpoint probable bottlenecks?

ProblemType: Bug
DistroRelease: elementary 0.4.1
Package: linux-image-4.15.0-34-generic 4.15.0-34.37~16.04.1 [origin: Ubuntu]
Uname: Linux 4.18.0-8.1-liquorix-amd64 x86_64
NonfreeKernelModules: nvidia_uvm nvidia wl
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
CurrentDesktop: Pantheon
Date: Mon Sep 17 16:43:06 2018
InstallationDate: Installed on 2017-09-24 (358 days ago)
InstallationMedia: elementary OS 0.4.1 "Loki" - Stable amd64 (20170814)
SourcePackage: linux-signed-hwe
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
indigocat (indigocat) wrote :
Revision history for this message
indigocat (indigocat) wrote :

I did some more tests today.
Note: this is a mechanical MicroSATA laptop drive.

# WRITE
## 4.15.0-36

$ sync; dd if=/dev/zero of=tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 34,2693 s, 31,3 MB/s

$ sync; dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 21,7465 s, 49,4 MB/s

$ sync; dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 22,4577 s, 47,8 MB/s

Average: 42,83 MB/s WRITE

## 4.4.0-137

$ sync; dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 19,0247 s, 56,4 MB/s

$ sync; dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 20,5483 s, 52,3 MB/s

$ sync; dd if=/dev/zero of=/tmp/tempfile bs=1M count=1024; sync
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 20,5732 s, 52,2 MB/s

Average: 53,63 MB/s WRITE

# READ
## 4.15.0-36

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 24,635 s, 43,6 MB/s

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 24,4772 s, 43,9 MB/s

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 25,8508 s, 41,5 MB/s

Average: 43 MB/s READ

## 4.4.0-137

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
vm.drop_caches = 3
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 25,4324 s, 42,2 MB/s

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
vm.drop_caches = 3
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 25,1271 s, 42,7 MB/s

$ sudo sysctl -w vm.drop_caches=3; dd if=/tmp/tempfile of=/dev/null bs=1M count=1024
vm.drop_caches = 3
1024+0 registros leídos
1024+0 registros escritos
1073741824 bytes (1,1 GB, 1,0 GiB) copied, 25,0382 s, 42,9 MB/s

Average: 42,6 MB/s READ

We could say that kernel 4.4 and 4.15 read speeds are almost the same, but write speed on kernel 4.15 is about 25% slower; this matters on older machines that use swap, perhaps not so much on higher-end machines relying on SSDs.

Revision history for this message
indigocat (indigocat) wrote :

Hello,

has anyone experienced this slowdown on similar hardware?

tags: added: kernel-bug
indigocat (indigocat)
Changed in linux-signed-hwe (Ubuntu):
status: New → Invalid
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.