Linux block layer
 help / color / mirror / Atom feed
From: Christian Hewitt <christianshewitt@gmail.com>
To: Patrik Nilsson <nipatriknilsson@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-amlogic@lists.infradead.org, furkan@fkardame.com,
	Brad Harper <bjharper@gmail.com>
Subject: Re: Deadlock under load with Linux 5.9 and other recent kernels
Date: Mon, 28 Sep 2020 17:36:44 +0400	[thread overview]
Message-ID: <CE8CADEC-593D-4712-A422-97AF44D95210@gmail.com> (raw)
In-Reply-To: <c05ae5ee-535d-ad2a-ce7e-137c428eb83b@gmail.com>


> On 28 Sep 2020, at 3:06 pm, Patrik Nilsson <nipatriknilsson@gmail.com> wrote:
> 
> Hi!
> 
> To me this bug description is very similar to what I'm struggling with on an amd64-platform.
> 
> When I get too much data sent via usb, it seems as the usb controlmsg is delayed so it times out and unmounts the block device.
> 
> I have been working on my related bug for long to get it easily reproducible, but failed. It is there all the time. New hardware is on its way so I can continue my testing.
> 
> Maybe you can test the patch I'm using to see if it works better for you?
> 
> In the meanwhile here is my description of my bug:
> 
>> I have stress tested the usb system. To the USB is now seven mechanical hard disks and two ssd disks connected. Six processes are at the same time writing random data to the disks. One of them is to the ssd disk I couldn't write data to before without it failed. Also the other usb-ssd disk is my root partition.
>> 
>> Before I applied the patch, my root partition sometimes failed to be kept mounted. Now I have not had any crashes.
>> 
>> This is a quick fix for hard disks, but working. It continued to work when I started three virtualbox guests and let them also do work. The guests' hard disks is on my usb-root partition.
>> 
>> It doesn't work if I also use my usb2ethernet adapter (ID 2001:4a00 D-Link Corp.), although my root partition and two randomize tests survived. Maybe a much larger timeout in this case will help? But this I don't find as a good solution.
>> 
>> The behavior is the same on the other (much slower) computer with a different usb hub. I have also tested it with exactly the same setup as earlier, with no mechanical hard disks, and it works with the patch and not without it.
> 
> Best regards,
> Patrik
> 
> ---start of diff---
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 5b768b80d1ee..3c550934815c 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -105,7 +105,7 @@ MODULE_PARM_DESC(use_both_schemes,
>  DECLARE_RWSEM(ehci_cf_port_reset_rwsem);
>  EXPORT_SYMBOL_GPL(ehci_cf_port_reset_rwsem);
> 
> -#define HUB_DEBOUNCE_TIMEOUT    2000
> +#define HUB_DEBOUNCE_TIMEOUT    10000
>  #define HUB_DEBOUNCE_STEP      25
>  #define HUB_DEBOUNCE_STABLE     100
> 
> diff --git a/include/linux/usb.h b/include/linux/usb.h
> index 20c555db4621..e64d441bb78f 100644
> --- a/include/linux/usb.h
> +++ b/include/linux/usb.h
> @@ -1841,8 +1841,8 @@ extern int usb_set_configuration(struct usb_device *dev, int configuration);
>   * USB identifies 5 second timeouts, maybe more in a few cases, and a few
>   * slow devices (like some MGE Ellipse UPSes) actually push that limit.
>   */
> -#define USB_CTRL_GET_TIMEOUT    5000
> -#define USB_CTRL_SET_TIMEOUT    5000
> +#define USB_CTRL_GET_TIMEOUT    10000
> +#define USB_CTRL_SET_TIMEOUT    10000
> 
> 
>  /**
> ---end of diff---

No obvious changes with this patch applied. Here’s output https://pastebin.com/raw/ZMgwNqgm

Christian

      reply	other threads:[~2020-09-28 13:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26  7:55 Deadlock under load with Linux 5.9 and other recent kernels Christian Hewitt
2020-09-26 10:51 ` Jens Axboe
2020-09-26 11:55   ` Christian Hewitt
2020-09-26 12:13     ` Jens Axboe
2020-09-26 12:28       ` Christian Hewitt
2020-09-28  1:37         ` Christian Hewitt
2020-09-28 11:06           ` Patrik Nilsson
2020-09-28 13:36             ` Christian Hewitt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CE8CADEC-593D-4712-A422-97AF44D95210@gmail.com \
    --to=christianshewitt@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=bjharper@gmail.com \
    --cc=furkan@fkardame.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nipatriknilsson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox