Internal Hard drive extremely slow unless using barrier=0 on ext4

Bug #1538040 reported by Valerio
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I have a brand new laptop (Asus N551VW, i7-6700HQ, 16 Gb ram) on which i installed Ubuntu 14.04 64bit and a new Samsung SSD 850 PRO 512Gb (latest firmware). I installed the default MySql 5.6.27 on the machine but I noticed a very VERY slow performance of the database (just creating a db and executing some migrations without any data takes around 33 seconds while on lower-hardware co-workers notebooks it takes like 3 seconds). Every sql statement seems to spend most time in "system lock" state, as i could see with a SHOW PROCESSLIST.

I thought it to be an hard drive issue, but executing the hard drive benchmark in Ubuntu gives 500 Mb/s read and 350 Mb/s write speed, which looks mostly normal.

I also tried updating to the new 4.2 kernel, but the issue still there. To make an experiment, i cloned the ssd on a normal hard drive, switched it in and connected the SSD externally with an usb box. I moved mysql data directory to the external disk, and retried the db creation: it took only 2.5 seconds.

Just out of curiosity i tried the same operation on an internal non-ssd disk: when the hd is plugged inside the laptop with sata, the database creation takes more than 2 minutes, while with the data dir on external usb (with the same physical disk) it took less than 10 seconds.

WORKAROUND: Add barrier=0 to root drive mount options with no other modification caused the same script to take 1.5 seconds instead of 33, with a 22x increase in performance.

I have opened his bug on askubuntu (http://askubuntu.com/questions/725182/ssd-extremely-slow-when-connected-with-internal-sata-ok-with-external-usb ) and it was suggested that this coud be an issue of the controller firmware/driver.
The problem is present both in trusty's default kernel (3.19.0-47.53) and in the 4.2 (4.2.0-25.30).

---
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: valerio 2776 F.... pulseaudio
DistroRelease: Ubuntu 14.04
HibernationDevice: RESUME=UUID=e5eee076-9bfc-4547-bf85-0208b98b57a8
InstallationDate: Installed on 2016-01-06 (60 days ago)
InstallationMedia: Ubuntu 14.04.3 LTS "Trusty Tahr" - Beta amd64 (20150805)
Lsusb:
 Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
 Bus 001 Device 003: ID 8087:0a2a Intel Corp.
 Bus 001 Device 002: ID 04f2:b3fd Chicony Electronics Co., Ltd
 Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: ASUSTeK COMPUTER INC. N551VW
NonfreeKernelModules: nvidia
Package: linux (not installed)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.2.0-30-generic root=UUID=5231fd09-180d-4fd2-bad5-e989207b11e7 ro quiet splash elevator=deadline vt.handoff=7
ProcVersionSignature: Ubuntu 4.2.0-30.36~14.04.1-generic 4.2.8-ckt3
PulseList: Error: command ['pacmd', 'list'] failed with exit code 1: No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-4.2.0-30-generic N/A
 linux-backports-modules-4.2.0-30-generic N/A
 linux-firmware 1.127.20
Tags: trusty
Uname: Linux 4.2.0-30-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: True
dmi.bios.date: 11/13/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: N551VW.205
dmi.board.asset.tag: ATN12345678901234567
dmi.board.name: N551VW
dmi.board.vendor: ASUSTeK COMPUTER INC.
dmi.board.version: 1.0
dmi.chassis.asset.tag: ATN12345678901234567
dmi.chassis.type: 10
dmi.chassis.vendor: ASUSTeK COMPUTER INC.
dmi.chassis.version: 1.0
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrN551VW.205:bd11/13/2015:svnASUSTeKCOMPUTERINC.:pnN551VW:pvr1.0:rvnASUSTeKCOMPUTERINC.:rnN551VW:rvr1.0:cvnASUSTeKCOMPUTERINC.:ct10:cvr1.0:
dmi.product.name: N551VW
dmi.product.version: 1.0
dmi.sys.vendor: ASUSTeK COMPUTER INC.

Revision history for this message
Valerio (valerio-morettini) wrote :
Revision history for this message
Valerio (valerio-morettini) wrote :
Download full text (19.7 KiB)

lspci:

00:00.0 Host bridge: Intel Corporation Device 1910 (rev 07)
00:01.0 PCI bridge: Intel Corporation Device 1901 (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
00:04.0 Signal processing controller: Intel Corporation Device 1903 (rev 07)
00:14.0 USB controller: Intel Corporation Device a12f (rev 31)
00:14.2 Signal processing controller: Intel Corporation Device a131 (rev 31)
00:15.0 Signal processing controller: Intel Corporation Device a160 (rev 31)
00:15.1 Signal processing controller: Intel Corporation Device a161 (rev 31)
00:16.0 Communication controller: Intel Corporation Device a13a (rev 31)
00:17.0 SATA controller: Intel Corporation Device a103 (rev 31)
00:1c.0 PCI bridge: Intel Corporation Device a112 (rev f1)
00:1c.3 PCI bridge: Intel Corporation Device a113 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Device a14e (rev 31)
00:1f.2 Memory controller: Intel Corporation Device a121 (rev 31)
00:1f.3 Audio device: Intel Corporation Device a170 (rev 31)
00:1f.4 SMBus: Intel Corporation Device a123 (rev 31)
01:00.0 3D controller: NVIDIA Corporation Device 139b (rev a2)
02:00.0 Network controller: Intel Corporation Wireless 7265 (rev 59)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)
03:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)

lshw:
    description: Notebook
    product: N551VW (ASUS-NotebookSKU)
    vendor: ASUSTeK COMPUTER INC.
    version: 1.0
    serial: FBN0CJ073215469
    width: 64 bits
    capabilities: smbios-3.0 dmi-3.0 vsyscall32
    configuration: boot=normal chassis=notebook family=N sku=ASUS-NotebookSKU uuid=AACF7E31-37C3-407D-AE85-B0B7C1948832
  *-core
       description: Motherboard
       product: N551VW
       vendor: ASUSTeK COMPUTER INC.
       physical id: 0
       version: 1.0
       serial: BSN12345678901234567
       slot: MIDDLE
     *-firmware
          description: BIOS
          vendor: American Megatrends Inc.
          physical id: 0
          version: N551VW.205
          date: 11/13/2015
          size: 64KiB
          capacity: 5952KiB
          capabilities: pci upgrade shadowing cdboot bootselect socketedrom edd int13floppy1200 int13floppy720 int13floppy2880 int5printscreen int9keyboard int14serial int17printer acpi usb smartbattery biosbootspecification uefi
     *-cache:0
          description: L1 cache
          physical id: 11
          slot: L1 Cache
          size: 128KiB
          capacity: 128KiB
          capabilities: synchronous internal write-back data
     *-cache:1
          description: L1 cache
          physical id: 12
          slot: L1 Cache
          size: 128KiB
          capacity: 128KiB
          capabilities: synchronous internal write-back instruction
     *-cache:2
          description: L2 cache
          physical id: 13
          slot: L2 Cache
          size: 1MiB
          capacity: 1MiB
          capabilities: synchronous internal write-back unified
     *-cache:3
          description: L3 cache
          physical id: 14
          slot: L3 Cache
          size: 6MiB
          capacity: 6MiB
          capabilities: ...

Revision history for this message
wildancer (wildancer) wrote :

experiencing the same problem but with a different hardware: I have a Dell XPS 15.

$ lspci
00:00.0 Host bridge: Intel Corporation Sky Lake Host Bridge/DRAM Registers (rev 07)
00:01.0 PCI bridge: Intel Corporation Sky Lake PCIe Controller (x16) (rev 07)
00:02.0 VGA compatible controller: Intel Corporation Device 191b (rev 06)
00:04.0 Signal processing controller: Intel Corporation Device 1903 (rev 07)
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)
00:14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem (rev 31)
00:15.0 Signal processing controller: Intel Corporation Sunrise Point-H LPSS I2C Controller #0 (rev 31)
00:15.1 Signal processing controller: Intel Corporation Sunrise Point-H LPSS I2C Controller #1 (rev 31)
00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)
00:17.0 SATA controller: Intel Corporation Sunrise Point-H SATA Controller [AHCI mode] (rev 31)
00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)
00:1c.1 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #2 (rev f1)
00:1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9 (rev f1)
00:1d.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #13 (rev f1)
00:1d.6 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #15 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)
00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)
00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)
01:00.0 3D controller: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev ff)
02:00.0 Network controller: Broadcom Corporation BCM43602 802.11ac Wireless LAN SoC (rev 01)
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 525a (rev 01)
04:00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd Device a802 (rev 01)

Revision history for this message
wildancer (wildancer) wrote :
Download full text (14.4 KiB)

$ lshw
WARNING: you should run this program as super-user.
arbegas
    description: Computer
    width: 64 bits
    capabilities: vsyscall32
  *-core
       description: Motherboard
       physical id: 0
     *-memory
          description: System memory
          physical id: 0
          size: 15GiB
     *-cpu
          product: Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
          vendor: Intel Corp.
          physical id: 1
          bus info: cpu@0
          size: 3299MHz
          capacity: 3500MHz
          width: 64 bits
          capabilities: fpu fpu_exception wp 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 pdpe1gb rdtscp x86-64 constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb pln pts dtherm hwp hwp_noitfy hwp_act_window hwp_epp intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1 cpufreq
     *-pci
          description: Host bridge
          product: Sky Lake Host Bridge/DRAM Registers
          vendor: Intel Corporation
          physical id: 100
          bus info: pci@0000:00:00.0
          version: 07
          width: 32 bits
          clock: 33MHz
        *-pci:0
             description: PCI bridge
             product: Sky Lake PCIe Controller (x16)
             vendor: Intel Corporation
             physical id: 1
             bus info: pci@0000:00:01.0
             version: 07
             width: 32 bits
             clock: 33MHz
             capabilities: pci normal_decode bus_master cap_list
             configuration: driver=pcieport
             resources: irq:122 ioport:e000(size=4096) memory:dc000000-dd0fffff ioport:b0000000(size=301989888)
           *-generic UNCLAIMED
                description: Unassigned class
                product: Illegal Vendor ID
                vendor: Illegal Vendor ID
                physical id: 0
                bus info: pci@0000:01:00.0
                version: ff
                width: 32 bits
                clock: 66MHz
                capabilities: bus_master vga_palette cap_list
                configuration: latency=255 maxlatency=255 mingnt=255
                resources: memory:dc000000-dcffffff memory:b0000000-bfffffff memory:c0000000-c1ffffff ioport:e000(size=128) memory:dd000000-dd07ffff
        *-display
             description: VGA compatible controller
             product: Intel Corporation
             vendor: Intel Corporation
             physical id: 2
             bus info: pci@0000:00:02.0
             version: 06
             width: 64 bits
             clock: 33MHz
             capabilities: vga_controller bus_master cap_list rom
             configuration: driver=i915 latency=0
             resources: irq:126 memory:db000000-dbffffff memory:70000000-7fffffff ioport:f000(size=64)
        *-generic:0
             descrip...

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

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

Changed in linux-lts-wily (Ubuntu):
status: New → Confirmed
Revision history for this message
penalvch (penalvch) wrote :

Valerio, thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command only once, as it will automatically gather debugging information, in a terminal:
apport-collect 1538040

affects: linux-lts-wily (Ubuntu) → linux (Ubuntu)
Changed in linux (Ubuntu):
importance: Undecided → Low
status: Confirmed → Incomplete
Revision history for this message
Valerio (valerio-morettini) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected
description: updated
Revision history for this message
Valerio (valerio-morettini) wrote : BootDmesg.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : CRDA.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : IwConfig.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : Lspci.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : ProcModules.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : RfKill.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : UdevDb.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : UdevLog.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote : WifiSyslog.txt

apport information

Revision history for this message
Valerio (valerio-morettini) wrote :

These have been logged with the barrier=0 switch active, lemme know if i have to disable it and redo the commands.

Revision history for this message
penalvch (penalvch) wrote :

Valerio, in order to allow additional upstream developers to examine the issue, at your earliest convenience, could you please test the latest upstream kernel available from http://kernel.ubuntu.com/~kernel-ppa/mainline/?C=N;O=D ? Please keep in mind the following:
1) The one to test is at the very top line at the top of the page (not the daily folder).
2) The release names are irrelevant.
3) The folder time stamps aren't indicative of when the kernel actually was released upstream.
4) Install instructions are available at https://wiki.ubuntu.com/Kernel/MainlineBuilds .

If testing on your main install would be inconvenient, one may:
1) Install Ubuntu to a different partition and then test this there.
2) Backup, or clone the primary install.

If the latest kernel did not allow you to test to the issue (ex. you couldn't boot into the OS) please make a comment in your report about this, and continue to test the next most recent kernel version until you can test to the issue. Once you've tested the upstream kernel, please comment on which kernel version specifically you tested. If this issue is fixed in the mainline kernel, please add the following tags by clicking on the yellow circle with a black pencil icon, next to the word Tags, located at the bottom of the report description:
kernel-fixed-upstream
kernel-fixed-upstream-X.Y-rcZ

Where X, and Y are the first two numbers of the kernel version, and Z is the release candidate number if it exists.

If the mainline kernel does not fix the issue, please add the following tags:
kernel-bug-exists-upstream
kernel-bug-exists-upstream-X.Y-rcZ

Please note, an error to install the kernel does not fit the criteria of kernel-bug-exists-upstream.

Also, you don't need to apport-collect further unless specifically requested to do so.

Once testing of the latest upstream kernel is complete, please mark this report Status Confirmed. Please let us know your results.

Thank you for your understanding.

tags: added: latest-bios-205
removed: ext4 sata
description: updated
Revision history for this message
Valerio (valerio-morettini) wrote :

Tested with kernel 4.5rc7 and the issue is still there...sigh.

tags: added: kernel-bug-exists-upstream kernel-bug-exists-upstream-4.5-rc7
Changed in linux (Ubuntu):
status: Incomplete → Confirmed
penalvch (penalvch)
Changed in linux (Ubuntu):
importance: Low → Medium
status: Confirmed → Triaged
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.