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=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, 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 12ED1C433E1 for ; Mon, 17 Aug 2020 15:25:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BBF1F23104 for ; Mon, 17 Aug 2020 15:25:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BBF1F23104 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rowland.harvard.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 3BC576B0002; Mon, 17 Aug 2020 11:25:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 36CFC6B0005; Mon, 17 Aug 2020 11:25:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2831C6B0006; Mon, 17 Aug 2020 11:25:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0029.hostedemail.com [216.40.44.29]) by kanga.kvack.org (Postfix) with ESMTP id 12C366B0002 for ; Mon, 17 Aug 2020 11:25:09 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C0BF9181AEF30 for ; Mon, 17 Aug 2020 15:25:08 +0000 (UTC) X-FDA: 77160433896.28.brass03_11050e827017 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 85AB26C02 for ; Mon, 17 Aug 2020 15:25:08 +0000 (UTC) X-HE-Tag: brass03_11050e827017 X-Filterd-Recvd-Size: 1978 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by imf31.hostedemail.com (Postfix) with SMTP for ; Mon, 17 Aug 2020 15:25:07 +0000 (UTC) Received: (qmail 113589 invoked by uid 1000); 17 Aug 2020 11:25:07 -0400 Date: Mon, 17 Aug 2020 11:25:07 -0400 From: Alan Stern To: Jim Baxter Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-usb@vger.kernel.org, "Resch Carsten \(CM/ESO6\)" , "Rosca, Eugeniu \(ADITG/ESB\)" Subject: Re: PROBLEM: Long Workqueue delays. Message-ID: <20200817152507.GC112820@rowland.harvard.edu> References: <71aafe68-7fe0-6b77-ea8e-83edd3f16c8d@mentor.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71aafe68-7fe0-6b77-ea8e-83edd3f16c8d@mentor.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Queue-Id: 85AB26C02 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Aug 17, 2020 at 12:40:03PM +0100, Jim Baxter wrote: > We have issues with the workqueue of the kernel overloading the CPU 0 > when we we disconnect a USB stick. Do you unmount the stick before disconnecting it? > This results in other items on the shared workqueue being delayed by > around 6.5 seconds with a default kernel configuration and 2.3 seconds > on a config tailored for our RCar embedded platform. > > I am aware there will be delays on the shared workqueue, are the delays > we are seeing considered normal? Assuming the workqueue delay is caused by the USB subsystem, you may be able to get more information by turning on USB dynamic debugging: echo 'module usbcore =p' >/sys/kernel/debug/dynamic_debug/control and seeing what shows up in the dmesg log. One long-running job should not normally be enough to delay an entire workqueues. Workqueues are allowed to spawn multiple threads; they are supposed to resize themselves dynamically as required. Alan Stern