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=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 434A8C0650E for ; Wed, 3 Jul 2019 14:23:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 223CC218A4 for ; Wed, 3 Jul 2019 14:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726966AbfGCOXO (ORCPT ); Wed, 3 Jul 2019 10:23:14 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:48386 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725944AbfGCOXO (ORCPT ); Wed, 3 Jul 2019 10:23:14 -0400 Received: (qmail 2846 invoked by uid 2102); 3 Jul 2019 10:23:13 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 3 Jul 2019 10:23:13 -0400 Date: Wed, 3 Jul 2019 10:23:13 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Johannes Thumshirn cc: Andrea Vai , Jens Axboe , , , Himanshu Madhani , Hannes Reinecke , Ming Lei , Omar Sandoval , "Martin K. Petersen" , Greg KH Subject: Re: Slow I/O on USB media after commit f664a3cc17b7d0a2bc3b3ab96181e1029b0ec0e6 In-Reply-To: <20190703072934.GA4026@x250.microfocus.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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