From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7355C06510 for ; Tue, 2 Jul 2019 11:51:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D46821721 for ; Tue, 2 Jul 2019 11:51:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbfGBLvU (ORCPT ); Tue, 2 Jul 2019 07:51:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:39554 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726544AbfGBLvT (ORCPT ); Tue, 2 Jul 2019 07:51:19 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6D100B116; Tue, 2 Jul 2019 11:51:18 +0000 (UTC) Date: Tue, 2 Jul 2019 13:51:17 +0200 From: Johannes Thumshirn To: Andrea Vai Cc: Jens Axboe , linux-usb@vger.kernel.org, linux-scsi@vger.kernel.org, Himanshu Madhani , Hannes Reinecke , Ming Lei , Omar Sandoval , "Martin K. Petersen" , Greg KH , Alan Stern Subject: Re: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6 Message-ID: <20190702115117.GC4463@x250.microfocus.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 > 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@suse.de +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