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=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 72ED5C06510 for ; Tue, 2 Jul 2019 10:46:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4808F2089C for ; Tue, 2 Jul 2019 10:46:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=unipv-it.20150623.gappssmtp.com header.i=@unipv-it.20150623.gappssmtp.com header.b="UitxjCgk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725991AbfGBKqt (ORCPT ); Tue, 2 Jul 2019 06:46:49 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43367 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725867AbfGBKqt (ORCPT ); Tue, 2 Jul 2019 06:46:49 -0400 Received: by mail-wr1-f66.google.com with SMTP id p13so17196530wru.10 for ; Tue, 02 Jul 2019 03:46:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unipv-it.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:user-agent:mime-version :content-transfer-encoding; bh=9mIX77VsesszTW96gmZViT/lzljGya5DrmFYXssiQzM=; b=UitxjCgkhI6hoKRwmwkLv8eMr6jLTmJUZ+haYwn39HWZ7s94VjadUEkxrhZZSKgizJ DO/8SqYOP9tBer8DSOfmQn/ONgtuS7XwZqO30BzEEs9nsWTT1dv3dI1wVVPhKpcqVrwz CmW/ZVN26S8fSDl9PK3qhpt6Lape6Ntv+RH1Q43lG4+ZYf0T5x6EHA/K6TbkRK6A0v4c jSpcuOSgCDf7vebknx9pH8CzM9X5EJqNbIYlci5OgrCqCyNA67kcQL9B3wBXLDu7ag3L FEahq/hRBANL843AVBENnPeY0SuKm/Mvep7atpq+11mZLAcWt3RtC1iNc473Dxk6OM5v Lq4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:user-agent :mime-version:content-transfer-encoding; bh=9mIX77VsesszTW96gmZViT/lzljGya5DrmFYXssiQzM=; b=JBzsWBN+i5oOKSFXG0F09/dFTm+NFlh/h81o9JNz7D8b9l6RPiPyUid+kPIQx6MaMY o0daTuO57KoHxJ50H9hmcz99ydllN/kYnIN+Y89f/TsOb6dQwtQq+sULV/56j5t7w49b OdUfWRNXHb5K4KvP4Fu0xhXLWONXEE+DUcmg6l5kqPcwdp6+YiHZbNDsSsZ25Pe+MYMQ Au6inE4lwUv4MTjEvIyTbyb9latqf4xAaTiAh/zUUO94n0nRNQPfW+b2hrHyVQsqduLx p2uGg7ptcEixqTR3pTGs2PNQrxpm/xn3zxYULtgEVKEUKG4sEr+25dC0IA/IcrOBLIpw nJ+Q== X-Gm-Message-State: APjAAAU/ZoeEaB5GMyS4OhQhKu9pXpxb/8epvloVjYwQ/hwyN0r6ZJIo COehwIMW61ucCqRGBgfGFORCuw== X-Google-Smtp-Source: APXvYqyfunA/pT/9Y+WYN7pOIW4S9jagoY5RLRfSr4ahsHXb7LVWMIsZPFALTXaiFLUWm548AhyrWQ== X-Received: by 2002:a5d:494d:: with SMTP id r13mr24507695wrs.152.1562064406731; Tue, 02 Jul 2019 03:46:46 -0700 (PDT) Received: from angus.unipv.it (angus.unipv.it. [193.206.67.163]) by smtp.gmail.com with ESMTPSA id c1sm26364690wrh.1.2019.07.02.03.46.46 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 02 Jul 2019 03:46:46 -0700 (PDT) Message-ID: Subject: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6 From: Andrea Vai To: Jens Axboe Cc: 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 Date: Tue, 02 Jul 2019 12:46:45 +0200 Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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 Thanks, and bye Andrea