Connecting my smartphone to my PC (via a hub) causes filesystem slowdown

Recently, I noticed that invoking adb [1] took an inordinate amount of time (despite having USB debugging enabled, etcetera). Soon afterward, I noticed that any application that utilised the filesystem (notably, dolphin-25.04.0-3, [2] gwenview-25.04.0-2, [3] and xdg-desktop-portal-kde-6.3.4-2) [4] would be hideously slow until I reinitialised the OS:

After a reboot, it remains perfect, until the moment that I connect my smartphone:

[5] [6] [7]

Unfortunately, disconnecting the smartphone doesn’t remediate the problem. Solely an OS reinitialisation does.

Flamegraphs

  1. ADB

    Before Connection After Connection (Slowed)
  2. Dolphin

    Before Connection After Connection (Slowed)
  3. Gwenview

    Before Connection After Connection (Slowed)

I intended to also do sudo, but wasn’t able to ascertain how to force its authentication to expire in time, as the first video demonstrates…

[8] [9]

Confirmation Process

Without smartphone connected:

  1.  time perf record --output=good-dolphin.data --call-graph dwarf dolphin /
    
  2.  time perf record --output=good-gwenview.data --call-graph dwarf gwenview /
    
  3.  time perf record --output=good-adb.data --call-graph dwarf adb devices -l
    
  4.  time perf record --output=good-sudo.data --call-graph sudo echo ''
    

This forms my control sample, unscientific as it is. Luckily, the disparity is significant.

With smartphone connected:

  1. Ensure the connection is “File Management” at com.android.settings/.Settings$UsbDetailsActivity.

    1.  time perf record --output=bad-dolphin.data --call-graph dwarf dolphin /
      
    2.  time perf record --output=bad-gwenview.data --call-graph dwarf gwenview /
      
    3.  time perf record --output=bad-adb.data --call-graph dwarf adb devices -l
      
    4.  time perf record --output=bad-sudo.data --call-graph sudo echo ''
      

Connection Report

Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: new SuperSpeed USB device number 3 using xhci_hcd
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: LPM exit latency is zeroed, disabling LPM.
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: New USB device found, idVendor=18d1, idProduct=4ee7, bcdDevice= 5.04
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: Product: Fairphone 5 5G
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: Manufacturer: Fairphone
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY kernel: usb 2-1.2: SerialNumber: 0f500db3
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY mtp-probe[260296]: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:01.2/0000:04:00.0/0000:05:02.0/0000:08:00.0/usb2/2-1/2-1.2"
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY mtp-probe[260296]: bus: 2, device: 3 was not an MTP device
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY boltd[1301]: probing: started [1000]
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY mtp-probe[260297]: checking bus 2, device 3: "/sys/devices/pci0000:00/0000:00:01.2/0000:04:00.0/0000:05:02.0/0000:08:00.0/usb2/2-1/2-1.2"
Apr 30 13:58:26 Beedell.RokeJulianLockhart.desktop.SSV2AY mtp-probe[260297]: bus: 2, device: 3 was not an MTP device

Tasks

  1. Ascertain whether anyone else has experienced this.

  2. Ascertain whether it’s related to retrace.fedoraproject.org/faf/reports/bthash/31ed81ff1f32d40bb4ead1ccf5f6dfbdee0f86b6, which occurred when this did.


  1. android-tools-35.0.2-3.fc42.x86_64 ↩︎

  2. dolphin-25.04.0-3.fc42.x86_64 ↩︎

  3. With gwenview-25.04.0-2.fc42.x86_64, I saw:

    I’d never seen that beforehand. ↩︎

  4. xdg-desktop-portal-kde-6.3.4-2.fc42.x86_64 ↩︎

  5. github.com/dkrivoruchko/ScreenStream/issues/303 ↩︎

  6. bugs.kde.org/show_bug.cgi?id=503427 ↩︎

  7. discuss.kde.org/t/33397:

    ↩︎
  8. github.com/KDAB/hotspot/issues/715 ↩︎

  9. unix.stackexchange.com/posts/693939/timeline#comment_1525414 ↩︎

Per the undermentioned, this might be a problem with #plasma:

Does the adb command take longer from the device? (like adb shell cat file.txt) Or take longer to initiate (adb logcat)?

Also does performance improve after killing the adb server with adb kill-server?

I’m not sure it matter, but does it happen with the phone connected directly to the computer without a hub? Could be something odd like the hub’s USB reset not doing something when the phone switches USB modes, causing some flood of errors related to USB, and adb having to wait its turn for actions.

I’d also try quick adb commands from LiveUSBs on GNOME and KDE. If it doesn’t happen on LiveUSB KDE, it could be a later KDE update or config-specific thing.


I’m not too sure how to check for problems, but I usually adb sideload a LineageOS Android ROM zip to my phone; it takes about 40s for the flash to report something on the phone, and as long as that’s about 40s I’m fine with it :stuck_out_tongue: (FreeBSD was the only time I saw it hang).

I’m planning on doing a flash soon; I do this (adb non-sudo, but iirc fastboot needs it)

  • (connect phone in bootloader/fastboot mode to PC USB)
  • fastboot erase --slot=all boot
  • fastboot flash --slot=all boot boot.img
  • (reboot phone to recovery)
  • adb sideload lineageos.zip
  • (reboot phone to OS)
1 Like