On Wed, 3 Jul 2019, Johannes Thumshirn wrote: > On Wed, Jul 03, 2019 at 12:36:30AM +0200, Andrea Vai wrote: > > On 02/07/19 13:51:17, Johannes Thumshirn wrote: > > > On Tue, Jul 02, 2019 at 12:46:45PM +0200, Andrea Vai wrote: > > > > Hi, > > > > I have a problem writing data to a USB pendrive, and it seems > > > > kernel-related. With the help of Greg an Alan (thanks) and some > > > > bisect, I found out the offending commit being > > > > > > > > commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6 > > > > > > > > [...] > > > > > > Hi, > > > > > > Can you please check what IO scheduler you have set for your USB pendrive? > > > > > > i.e. with: > > > cat /sys/block/$DISK/queue/scheduler > > > > > > > # cat /sys/block/sdf/queue/scheduler > > [mq-deadline] none > > One thing you can try as well is building a kernel with CONFIG_IOSCHED_BFQ and > use it. Deadline is probably not the best choice for a slow drive. Andrea, another thing you could try is to collect a usbmon trace under one of the "slow" kernels. Follow the instructions in Documentation/usb/usbmon.txt. I think you could kill the file-copy operation after just a couple of seconds; that should provide enough trace information to help see what causes the slowdown. (If you want, do the same test with a "fast" kernel and then we'll compare the results.) Alan Stern