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 > Author: Jens Axboe <axboe@xxxxxxxxx> > Date: Thu Nov 1 16:36:27 2018 -0600 > > scsi: kill off the legacy IO path > > This removes the legacy (non-mq) IO path for SCSI. > > So, here I am to notify you about the problem and ask you if I can > help in any way to work it out and fix it. > > The problem is that if I copy a file from the internal SATA HD to the > pendrive, it takes ~10 times to complete (in respect of the time > needed with the patch reverted). > > The test script, which I use to detect if the problem triggers or not, > is: > > #!/bin/bash > logfile=... > uname -a | tee -a $logfile > echo -n "Begin: " | tee -a $logfile > date | tee -a $logfile > touch inizio > SECONDS=0 > mount UUID="05141239-4ea5-494d-aa91-acd67db89ce5" /mnt/pendrive > cp /NoBackup/buttare/testfile /mnt/pendrive > umount /mnt/pendrive > tempo=$SECONDS > touch fine > echo -n "...end: " | tee -a $logfile > date | tee -a $logfile > echo "It took $tempo seconds!" | tee -a $logfile > > If I run the test with a 512MB file it takes >10min vs. half a minute. > > The problem is still present in last tested git (cloned today in the > morning). > > You can see the previous discussion that lead to these results at > > https://marc.info/?t=155922230700001&r=1&w=2 Hi, Can you please check what IO scheduler you have set for your USB pendrive? i.e. with: cat /sys/block/$DISK/queue/scheduler Thanks, Johannes -- Johannes Thumshirn SUSE Labs Filesystems jthumshirn@xxxxxxx +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850